Skip to main content

pool

VoltAgent Service


VoltAgent Service / database/pool

database/pool

Functions

getVoltagentPool()

getVoltagentPool(): Promise<DatabasePool>

Defined in: database/pool.ts:105

Get or create Slonik pool for voltagent service (used by agentRegistry). Uses DATABASE_URL_VOLTAGENT if set, otherwise falls back to DATABASE_URL, or constructs from POSTGRES_* variables.

IMPORTANT: DATABASE_URL_VOLTAGENT should use a service role with rolbypassrls to bypass RLS policies for loading all agents (system, org, user).

Returns

Promise<DatabasePool>


closeVoltagentPool()

closeVoltagentPool(): Promise<void>

Defined in: database/pool.ts:165

Close the voltagent pools (for graceful shutdown)

Returns

Promise<void>


query()

query<T>(sqlQuery, values?): Promise<{ rows: T[]; rowCount: number; }>

Defined in: database/pool.ts:184

Execute a query using the voltagent pg pool

This provides a pg-compatible interface (string query with $1, $2 placeholders and values array). Used by WorkflowBuilder for compatibility with existing code patterns.

Type Parameters

T

T extends QueryResultRow = QueryResultRow

Parameters

sqlQuery

string

values?

unknown[]

Returns

Promise<{ rows: T[]; rowCount: number; }>