File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11import { printSchema , getIntrospectionQuery , buildClientSchema } from 'graphql'
22import { ConstructivePreset , makePgService } from 'graphile-settings'
33import { makeSchema } from 'graphile-build'
4- import { getPgPool } from 'pg-cache'
4+ import { buildConnectionString , getPgPool } from 'pg-cache'
55import type { GraphileConfig } from 'graphile-config'
66import * as http from 'node:http'
77import * as https from 'node:https'
@@ -20,7 +20,13 @@ export async function buildSchemaSDL(opts: BuildSchemaOptions): Promise<string>
2020 // Get pool config for connection string
2121 const pool = getPgPool ( { database } )
2222 const poolConfig = ( pool as any ) . options || { }
23- const connectionString = `postgres://${ poolConfig . user || 'postgres' } :${ poolConfig . password || '' } @${ poolConfig . host || 'localhost' } :${ poolConfig . port || 5432 } /${ database } `
23+ const connectionString = buildConnectionString (
24+ poolConfig . user || 'postgres' ,
25+ poolConfig . password || '' ,
26+ poolConfig . host || 'localhost' ,
27+ poolConfig . port || 5432 ,
28+ database ,
29+ )
2430
2531 // Build v5 preset
2632 const preset : GraphileConfig . Preset = {
You can’t perform that action at this time.
0 commit comments