| 480 | |
| 481 | // Postgres----------------------------------------------------------------------------------------------------------- |
| 482 | const resetPostgres = async ( |
| 483 | db: PgDatabase<any, any>, |
| 484 | pgTables: { [key: string]: PgTable }, |
| 485 | ) => { |
| 486 | const tablesToTruncate = Object.entries(pgTables).map(([_, table]) => { |
| 487 | const config = getPgTableConfig(table); |
| 488 | config.schema = config.schema === undefined ? 'public' : config.schema; |
| 489 | |
| 490 | return `"${config.schema}"."${config.name}"`; |
| 491 | }); |
| 492 | |
| 493 | await db.execute(sql.raw(`truncate ${tablesToTruncate.join(',')} cascade;`)); |
| 494 | }; |
| 495 | |
| 496 | const filterPgSchema = (schema: { |
| 497 | [key: string]: |