MCPcopy
hub / github.com/ocodista/trampar-de-casa / getPostgresClient

Function getPostgresClient

packages/db/src/postgres/getPostgresClient.ts:8–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6let client: PostgresClient | null = null
7
8export const getPostgresClient = () => {
9 if (!client) {
10 console.log('🔌 Connecting to Postgres...')
11 const pool = new Pool({
12 connectionString: process.env.POSTGRES_URL,
13 ssl: false,
14 })
15
16 pool.on('connect', () => {
17 console.log('✅ Connected to Postgres successfully')
18 })
19
20 pool.on('error', (err) => {
21 console.error('❌ Postgres connection error:', err.message)
22 })
23
24 client = new PostgresClient(pool)
25 }
26
27 return client
28}

Callers 15

updateSkillsOnDatabaseFunction · 0.90
seed.tsFile · 0.90
injectSkills.tsFile · 0.90
getRolesFunction · 0.90
saveOpeningsFunction · 0.90
top40RolesFunction · 0.90
getSubscriberRolesFunction · 0.90
rolesRendererFunction · 0.90
setupDataMatchRolesFunction · 0.90
subsToQueueFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected