@nestjs/typeorm
Version:
Nest - modern, fast, powerful node.js web framework (@typeorm)
21 lines (20 loc) • 997 B
TypeScript
import { DynamicModule } from '@nestjs/common';
import { DataSource, DataSourceOptions } from 'typeorm';
import { EntityClassOrSchema } from './interfaces/entity-class-or-schema.type';
import { TypeOrmModuleAsyncOptions, TypeOrmModuleOptions } from './interfaces/typeorm-options.interface';
/**
* @publicApi
*/
export declare class TypeOrmModule {
/**
* Registers the TypeORM module with the given options.
*
* @param options The TypeORM data source options.
* @param name Optional data source name. When provided, it overrides
* `options.name` (if any) so the data source name can be configured
* separately from the connection options – mirroring `forRootAsync`.
*/
static forRoot(options?: TypeOrmModuleOptions, name?: string): DynamicModule;
static forFeature(entities?: EntityClassOrSchema[], dataSource?: DataSource | DataSourceOptions | string): DynamicModule;
static forRootAsync(options: TypeOrmModuleAsyncOptions): DynamicModule;
}