-
Notifications
You must be signed in to change notification settings - Fork 203
/
typeorm-options.interface.ts
45 lines (42 loc) 路 1.18 KB
/
typeorm-options.interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { Type } from '@nestjs/common';
import { ModuleMetadata } from '@nestjs/common/interfaces';
import { ConnectionOptions } from 'typeorm';
export type TypeOrmModuleOptions = {
/**
* Number of times to retry connecting
* Default: 10
*/
retryAttempts?: number;
/**
* Delay between connection retry attempts (ms)
* Default: 3000
*/
retryDelay?: number;
/**
* If `true`, entities will be loaded automatically.
*/
autoLoadEntities?: boolean;
/**
* If `true`, connection will not be closed on application shutdown.
*/
keepConnectionAlive?: boolean;
/**
* If `true`, will show verbose error messages on each connection retry.
*/
verboseRetryLog?: boolean;
} & Partial<ConnectionOptions>;
export interface TypeOrmOptionsFactory {
createTypeOrmOptions(
connectionName?: string,
): Promise<TypeOrmModuleOptions> | TypeOrmModuleOptions;
}
export interface TypeOrmModuleAsyncOptions
extends Pick<ModuleMetadata, 'imports'> {
name?: string;
useExisting?: Type<TypeOrmOptionsFactory>;
useClass?: Type<TypeOrmOptionsFactory>;
useFactory?: (
...args: any[]
) => Promise<TypeOrmModuleOptions> | TypeOrmModuleOptions;
inject?: any[];
}