Skip to main content

SqbModuleOptions

Options accepted by SqbModule.forRoot().

interface SqbModuleOptions {
useValue?: SqbClientConnectionOptions;
token?: InjectionToken;
envPrefix?: string;
logger?: LoggerService | string;
global?: boolean;
}
FieldTypeDescription
useValueSqbClientConnectionOptionsStatic connection configuration used to build the SqbClient provider.
tokenInjectionTokenProvider 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.
envPrefixstringPrefix used to fill unset useValue fields from environment variables. Default: 'SQB_'.
loggerLoggerService | stringA NestJS logger instance, or a string logger context, used for connection lifecycle logging.
globalbooleanIf true, registers the module as a global NestJS module.
SqbModule.forRoot({
useValue: { dialect: 'postgres', host: 'localhost', database: 'mydb' },
global: true,
});

See also