postgres
Workspace API / services/db/postgres
services/db/postgres
Interfaces
PoolHealth
Defined in: services/db/postgres.ts:401
Connection pool health metrics
Properties
total
total:
number
Defined in: services/db/postgres.ts:402
idle
idle:
number
Defined in: services/db/postgres.ts:403
waiting
waiting:
number
Defined in: services/db/postgres.ts:404
active
active:
number
Defined in: services/db/postgres.ts:405
utilization
utilization:
number
Defined in: services/db/postgres.ts:406
maxSize
maxSize:
number
Defined in: services/db/postgres.ts:407
isHealthy
isHealthy:
boolean
Defined in: services/db/postgres.ts:408
Functions
getPool()
getPool():
Promise<Pool>
Defined in: services/db/postgres.ts:187
Get connection pool for app database (singleton)
Returns
Promise<Pool>
getRagPool()
getRagPool():
Promise<Pool>
Defined in: services/db/postgres.ts:226
Get connection pool for RAG database (singleton)
Returns
Promise<Pool>
getRagClient()
getRagClient():
Promise<PoolClient>
Defined in: services/db/postgres.ts:269
Get a client from the RAG database pool
Returns
Promise<PoolClient>
queryRag()
queryRag<
T>(text,params?):Promise<QueryResult<T>>
Defined in: services/db/postgres.ts:277
Execute a query on the RAG database with circuit breaker protection
Type Parameters
T
T extends QueryResultRow = QueryResultRow
Parameters
text
string
params?
any[]
Returns
Promise<QueryResult<T>>
getClient()
getClient():
Promise<PoolClient>
Defined in: services/db/postgres.ts:307
Get a client from the pool
Returns
Promise<PoolClient>
query()
query<
T>(text,params?):Promise<QueryResult<T>>
Defined in: services/db/postgres.ts:315
Execute a query with circuit breaker protection
Type Parameters
T
T extends QueryResultRow = QueryResultRow
Parameters
text
string
params?
any[]
Returns
Promise<QueryResult<T>>
closePool()
closePool():
Promise<void>
Defined in: services/db/postgres.ts:393
Close connection pool (public API)
Returns
Promise<void>
getPoolHealth()
getPoolHealth():
Promise<PoolHealth>
Defined in: services/db/postgres.ts:414
Get health metrics for app database connection pool
Returns
Promise<PoolHealth>
getRagPoolHealth()
getRagPoolHealth():
Promise<PoolHealth>
Defined in: services/db/postgres.ts:459
Get health metrics for RAG database connection pool
Returns
Promise<PoolHealth>
getAllPoolsHealth()
getAllPoolsHealth():
Promise<{app:PoolHealth;rag:PoolHealth;healthy:boolean; }>
Defined in: services/db/postgres.ts:504
Get combined health metrics for all database pools
Returns
Promise<{ app: PoolHealth; rag: PoolHealth; healthy: boolean; }>