MCPcopy Create free account
hub / github.com/comuline/api / connectDB

Function connectDB

src/modules/v1/database.ts:18–28  ·  view source on GitHub ↗
(url: string, env: string)

Source from the content-addressed store, hash-verified

16}
17
18export const connectDB = (url: string, env: string) => {
19 if (env === "development") {
20 neonConfig.wsProxy = (host) => `${host}:5433/v1`
21 neonConfig.useSecureWebSocket = false
22 neonConfig.pipelineTLS = false
23 neonConfig.pipelineConnect = false
24 }
25
26 const pool = new Pool({ connectionString: url, ssl: true })
27 return drizzle(pool, { schema })
28}

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected