Skip to main content

SqbClientConnectionOptions

The connection configuration accepted by @sqb/nestjs, passed via SqbModuleOptions.useValue or returned by SqbModuleAsyncOptions.useFactory. It extends @sqb/connect's ClientConfiguration with two module-specific fields.

interface SqbClientConnectionOptions extends ClientConfiguration {
shutdownWaitMs?: number;
lazyConnect?: boolean;
}
FieldTypeDescription
shutdownWaitMsnumberNumber of ms to wait while closing the connection pool on application shutdown. Default: 10.
lazyConnectbooleanIf true, does not connect to the database on application start; the pool connects lazily on first use instead. Default: false.

All other fields (dialect, driver, host, port, database, user, password, schema, pool, driverOptions, defaults, ...) are inherited from ClientConfiguration. Any field left unset here is filled in from SQB_* environment variables — see envPrefix in the NestJS Integration guide.

See also