| 83 | const POSTGRES_STUDIO_STUFF: StudioStuff = { |
| 84 | adapter: 'postgres', |
| 85 | async createExecutor(connectionString) { |
| 86 | const postgresModule = await import('postgres') |
| 87 | |
| 88 | const connectionURL = new URL(connectionString) |
| 89 | |
| 90 | for (const queryParameter of PRISMA_ORM_SPECIFIC_QUERY_PARAMETERS) { |
| 91 | connectionURL.searchParams.delete(queryParameter) |
| 92 | } |
| 93 | |
| 94 | const postgres = postgresModule.default(connectionURL.toString()) |
| 95 | |
| 96 | process.once('SIGINT', () => postgres.end()) |
| 97 | process.once('SIGTERM', () => postgres.end()) |
| 98 | |
| 99 | return createPostgresJSExecutor(postgres) |
| 100 | }, |
| 101 | } |
| 102 | |
| 103 | type Database = { new (path: string): import('better-sqlite3').Database } |