egon-orm-workspace / @egon-orm/postgres / PostgresOptions
Interface: PostgresOptions ​
Defined in: postgres/src/options.ts:46
The options of postgres. Every option may also be given as undefined, which is the same as leaving it out (connectionString: process.env.DATABASE_URL).
Connect with connectionString, or with host, port, user, password, database and ssl, or both (the separate settings win). With none of them, pg reads the usual PG* environment variables.
Example ​
const options: PostgresOptions = {
connectionString: process.env.DATABASE_URL,
pool: { max: 10, idleTimeoutMs: 30_000, connectionTimeoutMs: 5_000 },
applicationName: "my-app",
};Properties ​
applicationName? ​
readonly applicationName?: string;Defined in: postgres/src/options.ts:68
Shown in pg_stat_activity (Postgres application_name).
connectionString? ​
readonly connectionString?: string;Defined in: postgres/src/options.ts:48
A postgres:// URL.
database? ​
readonly database?: string;Defined in: postgres/src/options.ts:54
host? ​
readonly host?: string;Defined in: postgres/src/options.ts:49
password? ​
readonly password?: string | (() => string | Promise<string>);Defined in: postgres/src/options.ts:53
A password, or a function that returns one (for rotating credentials).
planCacheSize? ​
readonly planCacheSize?: number;Defined in: postgres/src/options.ts:64
How many compiled query shapes the adapter keeps. Default 1,000.
pool? ​
readonly pool?: PostgresPoolOptions | Pool;Defined in: postgres/src/options.ts:62
Settings for the pool the adapter creates, or an existing pg.Pool to use as it is. A pool you pass in stays yours: the adapter does not change its settings and close() does not end it.
port? ​
readonly port?: number;Defined in: postgres/src/options.ts:50
ssl? ​
readonly ssl?: boolean | ConnectionOptions;Defined in: postgres/src/options.ts:56
true, or TLS options for node:tls.
statementTimeoutMs? ​
readonly statementTimeoutMs?: number;Defined in: postgres/src/options.ts:66
A server-side limit for every statement, in milliseconds (Postgres statement_timeout).
user? ​
readonly user?: string;Defined in: postgres/src/options.ts:51

