security/codeql-dependabot-gitleaks
| 1 | import pg from "@medusajs/deps/pg" |
| 2 | |
| 3 | const { Client } = pg as any |
| 4 | |
| 5 | export const DEFAULT_HOST = "localhost" |
| 6 | export const DEFAULT_PORT = 5432 |
| 7 | |
| 8 | type PostgresConnection = { |
| 9 | user?: string |
| 10 | password?: string |
| 11 | connectionString?: string |
| 12 | database?: string |
| 13 | host?: string |
| 14 | port?: number |
| 15 | } |
| 16 | |
| 17 | export default async (connect: PostgresConnection) => { |
| 18 | const client = new Client(connect) |
| 19 | |
| 20 | await client.connect() |
| 21 | |
| 22 | return client |
| 23 | } |