SqbModuleOptions
Options accepted by SqbModule.forRoot().
interface SqbModuleOptions {
useValue?: SqbClientConnectionOptions;
token?: InjectionToken;
envPrefix?: string;
logger?: LoggerService | string;
global?: boolean;
}
| Field | Type | Description |
|---|---|---|
useValue | SqbClientConnectionOptions | Static connection configuration used to build the SqbClient provider. |
token | InjectionToken | Provider token to register the SqbClient instance under. Defaults to the SqbClient class itself, so consumers can inject it by type; pass a custom token (e.g. a string) to run multiple connections in the same application. |
envPrefix | string | Prefix used to fill unset useValue fields from environment variables. Default: 'SQB_'. |
logger | LoggerService | string | A NestJS logger instance, or a string logger context, used for connection lifecycle logging. |
global | boolean | If true, registers the module as a global NestJS module. |
SqbModule.forRoot({
useValue: { dialect: 'postgres', host: 'localhost', database: 'mydb' },
global: true,
});