@depup/typeorm-extension 3.9.0-depup.0 → 4.0.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +268 -134
- package/README.md +4 -6
- package/bin/cli.mjs +538 -267
- package/bin/cli.mjs.map +1 -0
- package/changes.json +3 -11
- package/dist/index.d.mts +1456 -0
- package/dist/index.mjs +3123 -2972
- package/dist/index.mjs.map +1 -1
- package/package.json +50 -56
- package/bin/cli.cjs +0 -275
- package/dist/cli/commands/database/create.d.ts +0 -27
- package/dist/cli/commands/database/drop.d.ts +0 -23
- package/dist/cli/commands/database/index.d.ts +0 -2
- package/dist/cli/commands/index.d.ts +0 -2
- package/dist/cli/commands/seed/create.d.ts +0 -21
- package/dist/cli/commands/seed/index.d.ts +0 -2
- package/dist/cli/commands/seed/run.d.ts +0 -24
- package/dist/cli/index.d.ts +0 -2
- package/dist/data-source/find/index.d.ts +0 -2
- package/dist/data-source/find/module.d.ts +0 -3
- package/dist/data-source/find/type.d.ts +0 -22
- package/dist/data-source/index.d.ts +0 -4
- package/dist/data-source/options/index.d.ts +0 -4
- package/dist/data-source/options/module.d.ts +0 -8
- package/dist/data-source/options/singleton.d.ts +0 -4
- package/dist/data-source/options/type.d.ts +0 -26
- package/dist/data-source/options/utils/env.d.ts +0 -4
- package/dist/data-source/options/utils/index.d.ts +0 -2
- package/dist/data-source/options/utils/merge.d.ts +0 -2
- package/dist/data-source/singleton.d.ts +0 -5
- package/dist/data-source/type.d.ts +0 -2
- package/dist/database/driver/cockroachdb.d.ts +0 -4
- package/dist/database/driver/index.d.ts +0 -9
- package/dist/database/driver/mongodb.d.ts +0 -6
- package/dist/database/driver/mssql.d.ts +0 -6
- package/dist/database/driver/mysql.d.ts +0 -7
- package/dist/database/driver/oracle.d.ts +0 -6
- package/dist/database/driver/postgres.d.ts +0 -8
- package/dist/database/driver/sqlite.d.ts +0 -3
- package/dist/database/driver/types.d.ts +0 -20
- package/dist/database/driver/utils/build.d.ts +0 -3
- package/dist/database/driver/utils/character-set.d.ts +0 -2
- package/dist/database/driver/utils/charset.d.ts +0 -2
- package/dist/database/driver/utils/create.d.ts +0 -2
- package/dist/database/driver/utils/index.d.ts +0 -4
- package/dist/database/index.d.ts +0 -3
- package/dist/database/methods/check/index.d.ts +0 -2
- package/dist/database/methods/check/module.d.ts +0 -7
- package/dist/database/methods/check/types.d.ts +0 -51
- package/dist/database/methods/create/index.d.ts +0 -1
- package/dist/database/methods/create/module.d.ts +0 -10
- package/dist/database/methods/drop/index.d.ts +0 -1
- package/dist/database/methods/drop/module.d.ts +0 -10
- package/dist/database/methods/index.d.ts +0 -4
- package/dist/database/methods/type.d.ts +0 -43
- package/dist/database/utils/context.d.ts +0 -3
- package/dist/database/utils/index.d.ts +0 -5
- package/dist/database/utils/migration.d.ts +0 -2
- package/dist/database/utils/query.d.ts +0 -3
- package/dist/database/utils/schema.d.ts +0 -3
- package/dist/database/utils/type.d.ts +0 -32
- package/dist/env/constants.d.ts +0 -68
- package/dist/env/index.d.ts +0 -3
- package/dist/env/module.d.ts +0 -4
- package/dist/env/type.d.ts +0 -36
- package/dist/env/utils.d.ts +0 -3
- package/dist/errors/base.d.ts +0 -2
- package/dist/errors/driver.d.ts +0 -6
- package/dist/errors/index.d.ts +0 -3
- package/dist/errors/options.d.ts +0 -7
- package/dist/helpers/entity/error.d.ts +0 -20
- package/dist/helpers/entity/index.d.ts +0 -5
- package/dist/helpers/entity/join-columns.d.ts +0 -16
- package/dist/helpers/entity/metadata.d.ts +0 -10
- package/dist/helpers/entity/property-names.d.ts +0 -11
- package/dist/helpers/entity/uniqueness.d.ts +0 -28
- package/dist/helpers/index.d.ts +0 -1
- package/dist/index.cjs +0 -3258
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/query/index.d.ts +0 -4
- package/dist/query/module.d.ts +0 -5
- package/dist/query/parameter/fields/index.d.ts +0 -2
- package/dist/query/parameter/fields/module.d.ts +0 -25
- package/dist/query/parameter/fields/type.d.ts +0 -6
- package/dist/query/parameter/filters/index.d.ts +0 -2
- package/dist/query/parameter/filters/module.d.ts +0 -35
- package/dist/query/parameter/filters/type.d.ts +0 -12
- package/dist/query/parameter/index.d.ts +0 -5
- package/dist/query/parameter/pagination/index.d.ts +0 -2
- package/dist/query/parameter/pagination/module.d.ts +0 -26
- package/dist/query/parameter/pagination/type.d.ts +0 -3
- package/dist/query/parameter/relations/index.d.ts +0 -2
- package/dist/query/parameter/relations/module.d.ts +0 -27
- package/dist/query/parameter/relations/type.d.ts +0 -8
- package/dist/query/parameter/sort/index.d.ts +0 -2
- package/dist/query/parameter/sort/module.d.ts +0 -26
- package/dist/query/parameter/sort/type.d.ts +0 -6
- package/dist/query/type.d.ts +0 -16
- package/dist/query/utils/alias.d.ts +0 -2
- package/dist/query/utils/index.d.ts +0 -3
- package/dist/query/utils/key.d.ts +0 -1
- package/dist/query/utils/option.d.ts +0 -1
- package/dist/seeder/entity.d.ts +0 -42
- package/dist/seeder/executor.d.ts +0 -24
- package/dist/seeder/factory/index.d.ts +0 -4
- package/dist/seeder/factory/manager.d.ts +0 -8
- package/dist/seeder/factory/module.d.ts +0 -17
- package/dist/seeder/factory/type.d.ts +0 -12
- package/dist/seeder/factory/utils.d.ts +0 -7
- package/dist/seeder/index.d.ts +0 -6
- package/dist/seeder/module.d.ts +0 -5
- package/dist/seeder/type.d.ts +0 -44
- package/dist/seeder/utils/file-path.d.ts +0 -7
- package/dist/seeder/utils/index.d.ts +0 -3
- package/dist/seeder/utils/prepare.d.ts +0 -2
- package/dist/seeder/utils/template.d.ts +0 -1
- package/dist/utils/code-transformation/constants.d.ts +0 -4
- package/dist/utils/code-transformation/index.d.ts +0 -2
- package/dist/utils/code-transformation/module.d.ts +0 -3
- package/dist/utils/entity.d.ts +0 -2
- package/dist/utils/file-path.d.ts +0 -9
- package/dist/utils/file-system.d.ts +0 -1
- package/dist/utils/has-property.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/object.d.ts +0 -2
- package/dist/utils/promise.d.ts +0 -1
- package/dist/utils/separator.d.ts +0 -3
- package/dist/utils/slash.d.ts +0 -2
- package/dist/utils/tsconfig/index.d.ts +0 -2
- package/dist/utils/tsconfig/module.d.ts +0 -2
- package/dist/utils/tsconfig/type.d.ts +0 -13
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1456 @@
|
|
|
1
|
+
import { DataSource, DataSourceOptions, EntityMetadata, EntitySchema, EntityTarget, Migration, ObjectLiteral, ObjectType, QueryRunner, Repository, SaveOptions, SelectQueryBuilder } from "typeorm";
|
|
2
|
+
import { CompilerOptions, TypeAcquisition } from "typescript";
|
|
3
|
+
import { DatabaseType } from "typeorm/driver/types/DatabaseType.js";
|
|
4
|
+
//#region src/errors/base.d.ts
|
|
5
|
+
declare class TypeormExtensionError extends Error {}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/errors/driver.d.ts
|
|
8
|
+
declare class DriverError extends TypeormExtensionError {
|
|
9
|
+
constructor(message?: string);
|
|
10
|
+
static undeterminable(): DriverError;
|
|
11
|
+
static notSupported(driverName: string): DriverError;
|
|
12
|
+
static schemaAlterationNotSupported(driverName: string): DriverError;
|
|
13
|
+
static columnConversionExpressionNotSupported(driverName: string): DriverError;
|
|
14
|
+
static columnGenerationExpressionUnknown(columnName: string): DriverError;
|
|
15
|
+
static connectionClosed(): DriverError;
|
|
16
|
+
static databaseNotFound(database: string): DriverError;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/errors/entity-metadata.d.ts
|
|
20
|
+
declare class EntityMetadataError extends TypeormExtensionError {
|
|
21
|
+
constructor(message?: string);
|
|
22
|
+
static notRegistered(name: string): EntityMetadataError;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/errors/entity-relation-lookup.d.ts
|
|
26
|
+
type EntityRelationLookupErrorOptions = {
|
|
27
|
+
message: string;
|
|
28
|
+
relation: string;
|
|
29
|
+
columns: string[];
|
|
30
|
+
};
|
|
31
|
+
declare class EntityRelationLookupError extends TypeormExtensionError {
|
|
32
|
+
/**
|
|
33
|
+
* The property name of the relation.
|
|
34
|
+
*/
|
|
35
|
+
relation: string;
|
|
36
|
+
/**
|
|
37
|
+
* The property names of the join columns.
|
|
38
|
+
*/
|
|
39
|
+
columns: string[];
|
|
40
|
+
constructor(options: EntityRelationLookupErrorOptions);
|
|
41
|
+
static notReferenced(relation: string, columns: string[]): EntityRelationLookupError;
|
|
42
|
+
static notFound(relation: string, columns: string[]): EntityRelationLookupError;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/errors/options.d.ts
|
|
46
|
+
declare class OptionsError extends TypeormExtensionError {
|
|
47
|
+
constructor(message?: string);
|
|
48
|
+
static undeterminable(): OptionsError;
|
|
49
|
+
static notFound(): OptionsError;
|
|
50
|
+
static databaseNotDefined(): OptionsError;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/database/schema/drift/type.d.ts
|
|
54
|
+
/**
|
|
55
|
+
* A single reconciling statement, in the shape typeorm's schema builder emits it.
|
|
56
|
+
*/
|
|
57
|
+
type SchemaDriftStatement = {
|
|
58
|
+
query: string;
|
|
59
|
+
parameters?: unknown[];
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The difference between the database schema and the entity metadata.
|
|
63
|
+
*
|
|
64
|
+
* The up statements would reconcile the database schema with the entity metadata,
|
|
65
|
+
* the down statements would revert that reconciliation.
|
|
66
|
+
*/
|
|
67
|
+
type SchemaDrift = {
|
|
68
|
+
/**
|
|
69
|
+
* Whether the database schema deviates from the entity metadata.
|
|
70
|
+
*/
|
|
71
|
+
exists: boolean;
|
|
72
|
+
up: SchemaDriftStatement[];
|
|
73
|
+
down: SchemaDriftStatement[];
|
|
74
|
+
};
|
|
75
|
+
type SchemaDriftOptions = {
|
|
76
|
+
/**
|
|
77
|
+
* Report no drift if the data source has no migrations registered.
|
|
78
|
+
*
|
|
79
|
+
* Useful for a data source which is shared between a migration driven
|
|
80
|
+
* environment (postgres, mysql, ...) and a synchronize driven one
|
|
81
|
+
* (e.g. an in-memory sqlite test database wired with `migrations: []`).
|
|
82
|
+
*
|
|
83
|
+
* default: false
|
|
84
|
+
*/
|
|
85
|
+
skipWithoutMigrations?: boolean;
|
|
86
|
+
};
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/errors/schema.d.ts
|
|
89
|
+
declare class SchemaDriftError extends TypeormExtensionError {
|
|
90
|
+
/**
|
|
91
|
+
* The statements which would reconcile the database schema
|
|
92
|
+
* with the entity metadata.
|
|
93
|
+
*/
|
|
94
|
+
readonly statements: SchemaDriftStatement[];
|
|
95
|
+
constructor(statements?: SchemaDriftStatement[], message?: string);
|
|
96
|
+
static detected(statements: SchemaDriftStatement[]): SchemaDriftError;
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/errors/schema-alteration.d.ts
|
|
100
|
+
/**
|
|
101
|
+
* The database is in neither the state the alteration expects nor the one it
|
|
102
|
+
* would produce, so there is nothing it can safely do.
|
|
103
|
+
*
|
|
104
|
+
* Raised instead of returning quietly, because a repair migration which does
|
|
105
|
+
* not repair anything is indistinguishable from a successful one — the guard
|
|
106
|
+
* exists to make a run resumable, not to swallow a wrong description of the
|
|
107
|
+
* database.
|
|
108
|
+
*/
|
|
109
|
+
declare class SchemaAlterationError extends TypeormExtensionError {
|
|
110
|
+
static tableNotFound(table: string): SchemaAlterationError;
|
|
111
|
+
static columnNotFound(table: string, column: string): SchemaAlterationError;
|
|
112
|
+
static columnMismatch(table: string, column: string): SchemaAlterationError;
|
|
113
|
+
static indexNotFound(table: string, name: string): SchemaAlterationError;
|
|
114
|
+
static foreignKeyNotFound(table: string, name: string): SchemaAlterationError;
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/database/core/type.d.ts
|
|
118
|
+
/**
|
|
119
|
+
* A connection against a database server (never a TypeORM DataSource).
|
|
120
|
+
*
|
|
121
|
+
* execute() takes a statement in the server's native language:
|
|
122
|
+
* SQL text for SQL speaking servers, a JSON encoded command document
|
|
123
|
+
* for mongodb (executed via db.command()).
|
|
124
|
+
*
|
|
125
|
+
* Lifecycle: open() performs the handshake once — concurrent and repeated
|
|
126
|
+
* calls share the same attempt — and is optional, since execute() opens
|
|
127
|
+
* the connection on demand. close() is terminal: a closed connection cannot
|
|
128
|
+
* be reopened, and closing a never-opened connection is a no-op.
|
|
129
|
+
*/
|
|
130
|
+
interface IDatabaseConnection {
|
|
131
|
+
open(): Promise<void>;
|
|
132
|
+
execute(statement: string): Promise<unknown>;
|
|
133
|
+
close(): Promise<void>;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Factory for database server connections.
|
|
137
|
+
*
|
|
138
|
+
* create() is cheap — no I/O happens before open().
|
|
139
|
+
* The optional database argument overrides the connection's target database
|
|
140
|
+
* (e.g. the initial database, or a freshly created database). When omitted,
|
|
141
|
+
* the server side default (maintenance database) is used.
|
|
142
|
+
*/
|
|
143
|
+
interface IDatabaseConnectionFactory {
|
|
144
|
+
create(database?: string): IDatabaseConnection;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Filesystem effects for file backed databases (better-sqlite3).
|
|
148
|
+
*/
|
|
149
|
+
interface IFileSystem {
|
|
150
|
+
assertDirectoryWritable(path: string): Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Whether the file exists and is writable.
|
|
153
|
+
* A missing file yields false; any other failure propagates.
|
|
154
|
+
*/
|
|
155
|
+
isFileWritable(path: string): Promise<boolean>;
|
|
156
|
+
/**
|
|
157
|
+
* Create an empty file. Fails when the file already exists.
|
|
158
|
+
*/
|
|
159
|
+
createFile(path: string): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Remove the file. Returns false when it did not exist;
|
|
162
|
+
* any other failure propagates.
|
|
163
|
+
*/
|
|
164
|
+
removeFile(path: string): Promise<boolean>;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Dialect neutral connection facts, derived once per operation
|
|
168
|
+
* from the resolved DataSourceOptions.
|
|
169
|
+
*/
|
|
170
|
+
type ConnectionParams = {
|
|
171
|
+
database?: string;
|
|
172
|
+
host?: string;
|
|
173
|
+
user?: string;
|
|
174
|
+
password?: string;
|
|
175
|
+
port?: number;
|
|
176
|
+
ssl?: unknown;
|
|
177
|
+
url?: string;
|
|
178
|
+
connectString?: string;
|
|
179
|
+
sid?: string | number;
|
|
180
|
+
serviceName?: string;
|
|
181
|
+
domain?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Driver specific connection options which are not connection facts of their
|
|
184
|
+
* own, e.g. the tedious `options` object of the mssql driver
|
|
185
|
+
* (encrypt, trustServerCertificate, instanceName, ...).
|
|
186
|
+
*/
|
|
187
|
+
driverOptions?: Record<string, any>;
|
|
188
|
+
charset?: string;
|
|
189
|
+
characterSet?: string;
|
|
190
|
+
schema?: string;
|
|
191
|
+
template?: string;
|
|
192
|
+
extra?: Record<string, any>;
|
|
193
|
+
};
|
|
194
|
+
type DatabaseCreateOperation = {
|
|
195
|
+
params: ConnectionParams;
|
|
196
|
+
ifNotExist: boolean;
|
|
197
|
+
initialDatabase?: string;
|
|
198
|
+
};
|
|
199
|
+
type DatabaseDropOperation = {
|
|
200
|
+
params: ConnectionParams;
|
|
201
|
+
ifExist: boolean;
|
|
202
|
+
initialDatabase?: string;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* A dialect owns the create/drop orchestration for one driver type and
|
|
206
|
+
* receives its connection factory (or filesystem) via the constructor.
|
|
207
|
+
*
|
|
208
|
+
* Implementations must stay pure: types, typed errors and pure helpers only —
|
|
209
|
+
* no native clients, no I/O, no environment state.
|
|
210
|
+
*/
|
|
211
|
+
interface IDatabaseDialect {
|
|
212
|
+
create(operation: DatabaseCreateOperation): Promise<unknown>;
|
|
213
|
+
drop(operation: DatabaseDropOperation): Promise<unknown>;
|
|
214
|
+
}
|
|
215
|
+
type DatabaseDialectName = 'postgres' | 'cockroachdb' | 'mysql' | 'mssql' | 'oracle' | 'mongodb' | 'better-sqlite3';
|
|
216
|
+
/**
|
|
217
|
+
* Composition overrides for building a dialect —
|
|
218
|
+
* used by tests and the caller supplied connection escape hatch.
|
|
219
|
+
* Only the slot a dialect actually consumes has an effect.
|
|
220
|
+
*/
|
|
221
|
+
type DatabaseDialectOverrides = {
|
|
222
|
+
connectionFactory?: IDatabaseConnectionFactory;
|
|
223
|
+
fs?: IFileSystem;
|
|
224
|
+
cwd?: string;
|
|
225
|
+
};
|
|
226
|
+
type DatabaseDialectRegistryEntry = {
|
|
227
|
+
buildParams: (options: DataSourceOptions) => ConnectionParams;
|
|
228
|
+
buildDialect: (options: DataSourceOptions, params: ConnectionParams, overrides: DatabaseDialectOverrides) => IDatabaseDialect;
|
|
229
|
+
};
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/database/core/cockroachdb/module.d.ts
|
|
232
|
+
declare class CockroachDBDialect implements IDatabaseDialect {
|
|
233
|
+
protected connectionFactory: IDatabaseConnectionFactory;
|
|
234
|
+
constructor(connectionFactory: IDatabaseConnectionFactory);
|
|
235
|
+
create(operation: DatabaseCreateOperation): Promise<unknown>;
|
|
236
|
+
drop(operation: DatabaseDropOperation): Promise<unknown>;
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/database/core/cockroachdb/statements.d.ts
|
|
240
|
+
/**
|
|
241
|
+
* @link https://github.com/typeorm/typeorm/blob/master/src/driver/cockroachdb/CockroachQueryRunner.ts#L347
|
|
242
|
+
*
|
|
243
|
+
* The double space after the IF NOT EXISTS clause is preserved
|
|
244
|
+
* from the previous implementation.
|
|
245
|
+
*/
|
|
246
|
+
declare function buildCockroachDBCreateDatabaseQuery(database: string, ifNotExist: boolean): string;
|
|
247
|
+
/**
|
|
248
|
+
* @link https://github.com/typeorm/typeorm/blob/master/src/driver/cockroachdb/CockroachQueryRunner.ts#L356
|
|
249
|
+
*/
|
|
250
|
+
declare function buildCockroachDBDropDatabaseQuery(database: string, ifExist: boolean): string;
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/database/core/mongodb/module.d.ts
|
|
253
|
+
declare class MongoDBDialect implements IDatabaseDialect {
|
|
254
|
+
protected connectionFactory: IDatabaseConnectionFactory;
|
|
255
|
+
constructor(connectionFactory: IDatabaseConnectionFactory);
|
|
256
|
+
/**
|
|
257
|
+
* Connecting to the target database creates it lazily server side.
|
|
258
|
+
*/
|
|
259
|
+
create(operation: DatabaseCreateOperation): Promise<unknown>;
|
|
260
|
+
drop(operation: DatabaseDropOperation): Promise<unknown>;
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/database/core/mongodb/statements.d.ts
|
|
264
|
+
/**
|
|
265
|
+
* MongoDB statements are JSON encoded command documents,
|
|
266
|
+
* executed via db.command() by the adapter.
|
|
267
|
+
*
|
|
268
|
+
* @link https://www.mongodb.com/docs/manual/reference/command/dropDatabase/
|
|
269
|
+
*/
|
|
270
|
+
declare function buildMongoDBDropDatabaseCommand(): string;
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region src/database/core/mongodb/uri.d.ts
|
|
273
|
+
declare function buildMongoDBConnectionUri(params: ConnectionParams, database?: string): string;
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/database/core/mssql/module.d.ts
|
|
276
|
+
declare class MsSQLDialect implements IDatabaseDialect {
|
|
277
|
+
protected connectionFactory: IDatabaseConnectionFactory;
|
|
278
|
+
constructor(connectionFactory: IDatabaseConnectionFactory);
|
|
279
|
+
create(operation: DatabaseCreateOperation): Promise<unknown>;
|
|
280
|
+
drop(operation: DatabaseDropOperation): Promise<unknown>;
|
|
281
|
+
}
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region src/database/core/mssql/statements.d.ts
|
|
284
|
+
/**
|
|
285
|
+
* @link https://github.com/typeorm/typeorm/blob/master/src/driver/sqlserver/SqlServerQueryRunner.ts#L416
|
|
286
|
+
*
|
|
287
|
+
* NOTE: the previous implementation appended a `CHARACTER SET` clause,
|
|
288
|
+
* which is not valid T-SQL (SQL Server uses `COLLATE <collation_name>`).
|
|
289
|
+
* The clause was removed; a proper collation option is future work.
|
|
290
|
+
*/
|
|
291
|
+
declare function buildMsSQLCreateDatabaseQuery(params: ConnectionParams, ifNotExist: boolean): string;
|
|
292
|
+
/**
|
|
293
|
+
* @link https://github.com/typeorm/typeorm/blob/master/src/driver/sqlserver/SqlServerQueryRunner.ts#L425
|
|
294
|
+
*/
|
|
295
|
+
declare function buildMsSQLDropDatabaseQuery(database: string, ifExist: boolean): string;
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region src/database/core/mysql/module.d.ts
|
|
298
|
+
/**
|
|
299
|
+
* Serves mysql AND mariadb.
|
|
300
|
+
*/
|
|
301
|
+
declare class MySQLDialect implements IDatabaseDialect {
|
|
302
|
+
protected connectionFactory: IDatabaseConnectionFactory;
|
|
303
|
+
constructor(connectionFactory: IDatabaseConnectionFactory);
|
|
304
|
+
create(operation: DatabaseCreateOperation): Promise<unknown>;
|
|
305
|
+
drop(operation: DatabaseDropOperation): Promise<unknown>;
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/database/core/mysql/statements.d.ts
|
|
309
|
+
declare const MYSQL_FOREIGN_KEY_CHECKS_OFF = "SET FOREIGN_KEY_CHECKS=0;";
|
|
310
|
+
declare const MYSQL_FOREIGN_KEY_CHECKS_ON = "SET FOREIGN_KEY_CHECKS=1;";
|
|
311
|
+
declare const MYSQL_FOREIGN_KEY_CHECKS_SELECT = "SELECT @@SESSION.foreign_key_checks AS `value`;";
|
|
312
|
+
/**
|
|
313
|
+
* Infer the CHARACTER SET from a collation (charset) when it is not
|
|
314
|
+
* explicitly configured, e.g. utf8mb4_general_ci -> utf8mb4.
|
|
315
|
+
*/
|
|
316
|
+
declare function deriveMySQLCharacterSet(charset: string, characterSet?: string): string | undefined;
|
|
317
|
+
/**
|
|
318
|
+
* @link https://github.com/typeorm/typeorm/blob/master/src/driver/mysql/MysqlQueryRunner.ts#L297
|
|
319
|
+
*/
|
|
320
|
+
declare function buildMySQLCreateDatabaseQuery(params: ConnectionParams, ifNotExist: boolean): string;
|
|
321
|
+
/**
|
|
322
|
+
* @link https://github.com/typeorm/typeorm/blob/master/src/driver/mysql/MysqlQueryRunner.ts#L306
|
|
323
|
+
*/
|
|
324
|
+
declare function buildMySQLDropDatabaseQuery(database: string, ifExist: boolean): string;
|
|
325
|
+
//#endregion
|
|
326
|
+
//#region src/database/core/oracle/module.d.ts
|
|
327
|
+
declare class OracleDialect implements IDatabaseDialect {
|
|
328
|
+
protected connectionFactory: IDatabaseConnectionFactory;
|
|
329
|
+
constructor(connectionFactory: IDatabaseConnectionFactory);
|
|
330
|
+
create(operation: DatabaseCreateOperation): Promise<unknown>;
|
|
331
|
+
/**
|
|
332
|
+
* Dropping a database is not supported for oracle
|
|
333
|
+
* (preserved behaviour of the previous implementation).
|
|
334
|
+
*/
|
|
335
|
+
drop(_operation: DatabaseDropOperation): Promise<unknown>;
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region src/database/core/oracle/statements.d.ts
|
|
339
|
+
/**
|
|
340
|
+
* Assemble the TNS connect descriptor when none is configured.
|
|
341
|
+
*/
|
|
342
|
+
declare function buildOracleConnectString(params: ConnectionParams): string;
|
|
343
|
+
/**
|
|
344
|
+
* @link https://github.com/typeorm/typeorm/blob/master/src/driver/oracle/OracleQueryRunner.ts#L295
|
|
345
|
+
*
|
|
346
|
+
* NOTE: IF NOT EXISTS is not valid Oracle SQL. The statement is preserved
|
|
347
|
+
* byte-for-byte from the previous implementation for fidelity — changing
|
|
348
|
+
* it is a semantic decision, not a refactor side effect.
|
|
349
|
+
*/
|
|
350
|
+
declare function buildOracleCreateDatabaseQuery(database: string): string;
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/database/core/params.d.ts
|
|
353
|
+
declare function buildConnectionParams(options: DataSourceOptions): ConnectionParams;
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/database/core/postgres/module.d.ts
|
|
356
|
+
declare class PostgresDialect implements IDatabaseDialect {
|
|
357
|
+
protected connectionFactory: IDatabaseConnectionFactory;
|
|
358
|
+
constructor(connectionFactory: IDatabaseConnectionFactory);
|
|
359
|
+
create(operation: DatabaseCreateOperation): Promise<unknown>;
|
|
360
|
+
drop(operation: DatabaseDropOperation): Promise<unknown>;
|
|
361
|
+
}
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/database/core/postgres/statements.d.ts
|
|
364
|
+
declare function buildPostgresDatabaseExistsQuery(database: string): string;
|
|
365
|
+
/**
|
|
366
|
+
* @link https://github.com/typeorm/typeorm/blob/master/src/driver/postgres/PostgresQueryRunner.ts#L326
|
|
367
|
+
*/
|
|
368
|
+
declare function buildPostgresCreateDatabaseQuery(params: ConnectionParams): string;
|
|
369
|
+
declare function buildPostgresCreateSchemaQuery(schema: string): string;
|
|
370
|
+
/**
|
|
371
|
+
* @link https://github.com/typeorm/typeorm/blob/master/src/driver/postgres/PostgresQueryRunner.ts#L343
|
|
372
|
+
*/
|
|
373
|
+
declare function buildPostgresDropDatabaseQuery(database: string, ifExist: boolean): string;
|
|
374
|
+
//#endregion
|
|
375
|
+
//#region src/database/core/sqlite/module.d.ts
|
|
376
|
+
/**
|
|
377
|
+
* better-sqlite3 never opens a server connection —
|
|
378
|
+
* create/drop are filesystem effects following SQL database semantics:
|
|
379
|
+
* create produces the file (or fails when it exists, unless ifNotExist),
|
|
380
|
+
* drop removes it (or fails when it is missing, unless ifExist).
|
|
381
|
+
*/
|
|
382
|
+
declare class SQLiteDialect implements IDatabaseDialect {
|
|
383
|
+
protected fs: IFileSystem;
|
|
384
|
+
protected cwd: string;
|
|
385
|
+
constructor(fs: IFileSystem, cwd: string);
|
|
386
|
+
create(operation: DatabaseCreateOperation): Promise<unknown>;
|
|
387
|
+
drop(operation: DatabaseDropOperation): Promise<unknown>;
|
|
388
|
+
}
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region src/database/core/sqlite/path.d.ts
|
|
391
|
+
declare function resolveSQLiteDatabasePath(database: string, cwd: string): string;
|
|
392
|
+
declare function resolveSQLiteDatabaseDirectory(database: string, cwd: string): string;
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region src/database/core/utils.d.ts
|
|
395
|
+
declare function hasResultRows(input: unknown): boolean;
|
|
396
|
+
//#endregion
|
|
397
|
+
//#region src/database/methods/check/types.d.ts
|
|
398
|
+
type DatabaseCheckContext = {
|
|
399
|
+
/**
|
|
400
|
+
* Options for finding the typeorm DataSource.
|
|
401
|
+
*
|
|
402
|
+
* Default: undefined
|
|
403
|
+
*/
|
|
404
|
+
options?: DataSourceOptions;
|
|
405
|
+
/**
|
|
406
|
+
* Use alias to access already registered DataSource / DataSourceOptions.
|
|
407
|
+
*
|
|
408
|
+
* default: undefined
|
|
409
|
+
*/
|
|
410
|
+
alias?: string;
|
|
411
|
+
/**
|
|
412
|
+
* Indicates whether to destroy the data-source
|
|
413
|
+
* afterward or not.
|
|
414
|
+
* If a datasource previously existed, this option will be ignored.
|
|
415
|
+
*
|
|
416
|
+
* default: true
|
|
417
|
+
*/
|
|
418
|
+
dataSourceCleanup?: boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Use predefined data-source for checks.
|
|
421
|
+
*
|
|
422
|
+
* default: undefined
|
|
423
|
+
*/
|
|
424
|
+
dataSource?: DataSource;
|
|
425
|
+
};
|
|
426
|
+
type DatabaseCheckResult = {
|
|
427
|
+
/**
|
|
428
|
+
* Indicates whether the database
|
|
429
|
+
* has already been created or not.
|
|
430
|
+
*
|
|
431
|
+
* default: false
|
|
432
|
+
*/
|
|
433
|
+
exists: boolean;
|
|
434
|
+
/**
|
|
435
|
+
* Indicates whether the database's schema
|
|
436
|
+
* is up-to-date.
|
|
437
|
+
*
|
|
438
|
+
* default: false
|
|
439
|
+
*/
|
|
440
|
+
schema: boolean;
|
|
441
|
+
/**
|
|
442
|
+
* Array of un applied migrations.
|
|
443
|
+
*
|
|
444
|
+
* default: []
|
|
445
|
+
*/
|
|
446
|
+
migrationsPending: Migration[];
|
|
447
|
+
};
|
|
448
|
+
//#endregion
|
|
449
|
+
//#region src/database/methods/check/module.d.ts
|
|
450
|
+
/**
|
|
451
|
+
* Check database setup progress.
|
|
452
|
+
*
|
|
453
|
+
* @param context
|
|
454
|
+
*/
|
|
455
|
+
declare function checkDatabase(context?: DatabaseCheckContext): Promise<DatabaseCheckResult>;
|
|
456
|
+
//#endregion
|
|
457
|
+
//#region src/utils/tsconfig/type.d.ts
|
|
458
|
+
type StripEnums<T extends Record<string, any>> = { [K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any; };
|
|
459
|
+
interface TSConfig {
|
|
460
|
+
compilerOptions?: StripEnums<CompilerOptions>;
|
|
461
|
+
exclude?: string[];
|
|
462
|
+
compileOnSave?: boolean;
|
|
463
|
+
extends?: string;
|
|
464
|
+
files?: string[];
|
|
465
|
+
include?: string[];
|
|
466
|
+
typeAcquisition?: TypeAcquisition;
|
|
467
|
+
}
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region src/utils/tsconfig/module.d.ts
|
|
470
|
+
declare function readTSConfig(input?: string): Promise<TSConfig>;
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/data-source/find/type.d.ts
|
|
473
|
+
type DataSourceFindOptions = {
|
|
474
|
+
/**
|
|
475
|
+
* Directory where to look for DataSource files.
|
|
476
|
+
*/
|
|
477
|
+
directory?: string;
|
|
478
|
+
/**
|
|
479
|
+
* DataSource file name.
|
|
480
|
+
*/
|
|
481
|
+
fileName?: string;
|
|
482
|
+
/**
|
|
483
|
+
* This option indicates if file paths should be preserved,
|
|
484
|
+
* and treated as if the just-in-time compilation environment is detected.
|
|
485
|
+
*/
|
|
486
|
+
preserveFilePaths?: boolean;
|
|
487
|
+
/**
|
|
488
|
+
* Directory path to the tsconfig.json file
|
|
489
|
+
*
|
|
490
|
+
* Default: process.cwd() + path.sep + tsconfig.json
|
|
491
|
+
*/
|
|
492
|
+
tsconfig?: string | TSConfig;
|
|
493
|
+
};
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/data-source/find/module.d.ts
|
|
496
|
+
declare function findDataSource(context?: DataSourceFindOptions): Promise<DataSource | undefined>;
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region src/data-source/options/type.d.ts
|
|
499
|
+
type DataSourceOptionsBuildContext = {
|
|
500
|
+
/**
|
|
501
|
+
* Data source file name without extension
|
|
502
|
+
*
|
|
503
|
+
* Default: data-source
|
|
504
|
+
*/
|
|
505
|
+
dataSourceName?: string;
|
|
506
|
+
/**
|
|
507
|
+
* Directory where to find dataSource + config
|
|
508
|
+
*
|
|
509
|
+
* Default: process.cwd()
|
|
510
|
+
*/
|
|
511
|
+
directory?: string;
|
|
512
|
+
/**
|
|
513
|
+
* Directory path to the tsconfig.json file
|
|
514
|
+
*
|
|
515
|
+
* Default: process.cwd() + path.sep + tsconfig.json
|
|
516
|
+
*/
|
|
517
|
+
tsconfig?: string | TSConfig;
|
|
518
|
+
/**
|
|
519
|
+
* This option indicates if file paths should be preserved,
|
|
520
|
+
* and treated as if the just-in-time compilation environment is detected.
|
|
521
|
+
*/
|
|
522
|
+
preserveFilePaths?: boolean;
|
|
523
|
+
};
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region src/data-source/options/module.d.ts
|
|
526
|
+
/**
|
|
527
|
+
* Build DataSourceOptions from DataSource or from configuration.
|
|
528
|
+
*
|
|
529
|
+
* @param context
|
|
530
|
+
*/
|
|
531
|
+
declare function buildDataSourceOptions(context?: DataSourceOptionsBuildContext): Promise<DataSourceOptions>;
|
|
532
|
+
//#endregion
|
|
533
|
+
//#region src/data-source/options/singleton.d.ts
|
|
534
|
+
declare function setDataSourceOptions(options: DataSourceOptions, alias?: string): void;
|
|
535
|
+
declare function hasDataSourceOptions(alias?: string): boolean;
|
|
536
|
+
declare function useDataSourceOptions(alias?: string): Promise<DataSourceOptions>;
|
|
537
|
+
//#endregion
|
|
538
|
+
//#region src/data-source/options/utils/env.d.ts
|
|
539
|
+
declare function hasEnvDataSourceOptions(): boolean;
|
|
540
|
+
declare function readDataSourceOptionsFromEnv(): DataSourceOptions | undefined;
|
|
541
|
+
declare function mergeDataSourceOptionsWithEnv(options: DataSourceOptions): DataSourceOptions;
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region src/data-source/options/utils/merge.d.ts
|
|
544
|
+
declare function mergeDataSourceOptions(target: DataSourceOptions, source: DataSourceOptions): DataSourceOptions;
|
|
545
|
+
//#endregion
|
|
546
|
+
//#region src/data-source/singleton.d.ts
|
|
547
|
+
declare function setDataSource(dataSource: DataSource, alias?: string): void;
|
|
548
|
+
declare function hasDataSource(alias?: string): boolean;
|
|
549
|
+
declare function unsetDataSource(alias?: string): void;
|
|
550
|
+
declare function useDataSource(alias?: string): Promise<DataSource>;
|
|
551
|
+
//#endregion
|
|
552
|
+
//#region src/data-source/type.d.ts
|
|
553
|
+
type DataSourceCacheOption = DataSourceOptions['cache'];
|
|
554
|
+
//#endregion
|
|
555
|
+
//#region src/database/methods/type.d.ts
|
|
556
|
+
type DatabaseBaseContext = {
|
|
557
|
+
/**
|
|
558
|
+
* Options for finding the typeorm DataSource.
|
|
559
|
+
*/
|
|
560
|
+
options: DataSourceOptions;
|
|
561
|
+
/**
|
|
562
|
+
* Options for the find method, where to look for the data-source file.
|
|
563
|
+
*/
|
|
564
|
+
findOptions?: DataSourceFindOptions;
|
|
565
|
+
/**
|
|
566
|
+
* Initial database to connect.
|
|
567
|
+
*
|
|
568
|
+
* default: undefined
|
|
569
|
+
*/
|
|
570
|
+
initialDatabase?: string;
|
|
571
|
+
/**
|
|
572
|
+
* Caller supplied server-level connection.
|
|
573
|
+
* It is treated as already open, and the caller owns its lifecycle —
|
|
574
|
+
* the library never opens or closes it.
|
|
575
|
+
*
|
|
576
|
+
* default: undefined
|
|
577
|
+
*/
|
|
578
|
+
connection?: Pick<IDatabaseConnection, 'execute'>;
|
|
579
|
+
};
|
|
580
|
+
type DatabaseBaseContextInput = Partial<DatabaseBaseContext>;
|
|
581
|
+
type DatabaseCreateContext = Omit<DatabaseBaseContext, 'findOptions'> & {
|
|
582
|
+
/**
|
|
583
|
+
* Only create database if not already exist.
|
|
584
|
+
*
|
|
585
|
+
* default: true
|
|
586
|
+
*/
|
|
587
|
+
ifNotExist: boolean;
|
|
588
|
+
/**
|
|
589
|
+
* Synchronize or migrate the database scheme.
|
|
590
|
+
*
|
|
591
|
+
* default: true
|
|
592
|
+
*/
|
|
593
|
+
synchronize: boolean;
|
|
594
|
+
};
|
|
595
|
+
type DatabaseCreateContextInput = Partial<DatabaseCreateContext>;
|
|
596
|
+
type DatabaseDropContext = Omit<DatabaseBaseContext, 'findOptions'> & {
|
|
597
|
+
/**
|
|
598
|
+
* Only drop database if existed.
|
|
599
|
+
*
|
|
600
|
+
* Default: true
|
|
601
|
+
*/
|
|
602
|
+
ifExist?: boolean;
|
|
603
|
+
};
|
|
604
|
+
type DatabaseDropContextInput = Partial<DatabaseDropContext>;
|
|
605
|
+
//#endregion
|
|
606
|
+
//#region src/database/methods/create/module.d.ts
|
|
607
|
+
/**
|
|
608
|
+
* Create database for specified driver in ConnectionOptions.
|
|
609
|
+
*
|
|
610
|
+
* @throws DriverError
|
|
611
|
+
* @throws OptionsError
|
|
612
|
+
*
|
|
613
|
+
* @param input
|
|
614
|
+
*/
|
|
615
|
+
declare function createDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
|
|
616
|
+
//#endregion
|
|
617
|
+
//#region src/database/methods/drop/module.d.ts
|
|
618
|
+
/**
|
|
619
|
+
* Drop database for specified driver in ConnectionOptions.
|
|
620
|
+
*
|
|
621
|
+
* @throws DriverError
|
|
622
|
+
* @throws OptionsError
|
|
623
|
+
*
|
|
624
|
+
* @param input
|
|
625
|
+
*/
|
|
626
|
+
declare function dropDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
|
|
627
|
+
//#endregion
|
|
628
|
+
//#region src/database/driver/cockroachdb.d.ts
|
|
629
|
+
/**
|
|
630
|
+
* @deprecated Use createDatabase() instead — dialect dispatch is automatic.
|
|
631
|
+
*/
|
|
632
|
+
declare function createCockroachDBDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
|
|
633
|
+
/**
|
|
634
|
+
* @deprecated Use dropDatabase() instead — dialect dispatch is automatic.
|
|
635
|
+
*/
|
|
636
|
+
declare function dropCockroachDBDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/database/driver/mongodb.d.ts
|
|
639
|
+
/**
|
|
640
|
+
* @deprecated Use createDatabase() instead — dialect dispatch is automatic.
|
|
641
|
+
*/
|
|
642
|
+
declare function createMongoDBDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
|
|
643
|
+
/**
|
|
644
|
+
* @deprecated Use dropDatabase() instead — dialect dispatch is automatic.
|
|
645
|
+
*/
|
|
646
|
+
declare function dropMongoDBDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
|
|
647
|
+
//#endregion
|
|
648
|
+
//#region src/database/driver/mssql.d.ts
|
|
649
|
+
/**
|
|
650
|
+
* @deprecated Use createDatabase() instead — dialect dispatch is automatic.
|
|
651
|
+
*/
|
|
652
|
+
declare function createMsSQLDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
|
|
653
|
+
/**
|
|
654
|
+
* @deprecated Use dropDatabase() instead — dialect dispatch is automatic.
|
|
655
|
+
*/
|
|
656
|
+
declare function dropMsSQLDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
|
|
657
|
+
//#endregion
|
|
658
|
+
//#region src/database/driver/mysql.d.ts
|
|
659
|
+
/**
|
|
660
|
+
* @deprecated Use createDatabase() instead — dialect dispatch is automatic.
|
|
661
|
+
*/
|
|
662
|
+
declare function createMySQLDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
|
|
663
|
+
/**
|
|
664
|
+
* @deprecated Use dropDatabase() instead — dialect dispatch is automatic.
|
|
665
|
+
*/
|
|
666
|
+
declare function dropMySQLDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
|
|
667
|
+
//#endregion
|
|
668
|
+
//#region src/database/driver/oracle.d.ts
|
|
669
|
+
/**
|
|
670
|
+
* @deprecated Use createDatabase() instead — dialect dispatch is automatic.
|
|
671
|
+
*/
|
|
672
|
+
declare function createOracleDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
|
|
673
|
+
/**
|
|
674
|
+
* @deprecated Use dropDatabase() instead — dialect dispatch is automatic.
|
|
675
|
+
*/
|
|
676
|
+
declare function dropOracleDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
|
|
677
|
+
//#endregion
|
|
678
|
+
//#region src/database/driver/postgres.d.ts
|
|
679
|
+
/**
|
|
680
|
+
* @deprecated Use createDatabase() instead — dialect dispatch is automatic.
|
|
681
|
+
*/
|
|
682
|
+
declare function createPostgresDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
|
|
683
|
+
/**
|
|
684
|
+
* @deprecated Use dropDatabase() instead — dialect dispatch is automatic.
|
|
685
|
+
*/
|
|
686
|
+
declare function dropPostgresDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
|
|
687
|
+
//#endregion
|
|
688
|
+
//#region src/database/driver/sqlite.d.ts
|
|
689
|
+
/**
|
|
690
|
+
* @deprecated Use createDatabase() instead — dialect dispatch is automatic.
|
|
691
|
+
*/
|
|
692
|
+
declare function createSQLiteDatabase(input?: DatabaseCreateContextInput): Promise<unknown>;
|
|
693
|
+
/**
|
|
694
|
+
* @deprecated Use dropDatabase() instead — dialect dispatch is automatic.
|
|
695
|
+
*/
|
|
696
|
+
declare function dropSQLiteDatabase(input?: DatabaseDropContextInput): Promise<unknown>;
|
|
697
|
+
//#endregion
|
|
698
|
+
//#region src/database/schema/alter/checks.d.ts
|
|
699
|
+
/**
|
|
700
|
+
* Run a callback with the mysql/mariadb foreign key checks disabled and restore
|
|
701
|
+
* the previous state afterwards (nesting safe). A no-op wrapper on every other
|
|
702
|
+
* driver, so a migration using it stays portable.
|
|
703
|
+
*
|
|
704
|
+
* Re-adding a constraint which was already enforcing does not need to be
|
|
705
|
+
* re-validated — the check only buys a full table scan, plus a failure mode for
|
|
706
|
+
* rows some past import inserted with the checks off.
|
|
707
|
+
*/
|
|
708
|
+
declare function withForeignKeyChecksDisabled<T>(queryRunner: QueryRunner, fn: () => Promise<T>): Promise<T>;
|
|
709
|
+
//#endregion
|
|
710
|
+
//#region src/database/schema/alter/type.d.ts
|
|
711
|
+
/**
|
|
712
|
+
* Every guarded alteration takes it: raise a `SchemaAlterationError` when the
|
|
713
|
+
* database is in neither the expected nor the desired state, rather than
|
|
714
|
+
* returning `false` and leaving a repair migration to report success without
|
|
715
|
+
* having repaired anything.
|
|
716
|
+
*
|
|
717
|
+
* Being already in the desired state is never an error — that is what keeps a
|
|
718
|
+
* run resumable, and it returns `false` in both modes.
|
|
719
|
+
*
|
|
720
|
+
* @default true
|
|
721
|
+
*/
|
|
722
|
+
type SchemaStrictInput = {
|
|
723
|
+
strict?: boolean;
|
|
724
|
+
};
|
|
725
|
+
type SchemaRenameIndexInput = SchemaStrictInput & {
|
|
726
|
+
/**
|
|
727
|
+
* Table name, optionally schema qualified (e.g. `public.user`).
|
|
728
|
+
*/
|
|
729
|
+
table: string;
|
|
730
|
+
/**
|
|
731
|
+
* Current index name.
|
|
732
|
+
*/
|
|
733
|
+
from: string;
|
|
734
|
+
/**
|
|
735
|
+
* Desired index name.
|
|
736
|
+
*/
|
|
737
|
+
to: string;
|
|
738
|
+
};
|
|
739
|
+
/**
|
|
740
|
+
* What a foreign key constraint consists of, beyond its name.
|
|
741
|
+
*/
|
|
742
|
+
type SchemaForeignKeyMeta = {
|
|
743
|
+
columns: string[];
|
|
744
|
+
referencedTable: string;
|
|
745
|
+
referencedColumns: string[];
|
|
746
|
+
onDelete?: string;
|
|
747
|
+
onUpdate?: string;
|
|
748
|
+
};
|
|
749
|
+
type SchemaRenameForeignKeyInput = SchemaStrictInput & {
|
|
750
|
+
/**
|
|
751
|
+
* Table name, optionally schema qualified (e.g. `public.user`).
|
|
752
|
+
*/
|
|
753
|
+
table: string;
|
|
754
|
+
/**
|
|
755
|
+
* Current constraint name.
|
|
756
|
+
*/
|
|
757
|
+
from: string;
|
|
758
|
+
/**
|
|
759
|
+
* Desired constraint name.
|
|
760
|
+
*/
|
|
761
|
+
to: string;
|
|
762
|
+
/**
|
|
763
|
+
* Used to re-create the constraint when neither `from` nor `to` exists —
|
|
764
|
+
* the state a run interrupted between the drop and the re-add leaves behind
|
|
765
|
+
* on mysql, where it can no longer be read back from the database.
|
|
766
|
+
*
|
|
767
|
+
* Ignored while `from` still exists: the normal path always describes the
|
|
768
|
+
* constraint from the database, so a rename can not silently change it.
|
|
769
|
+
*/
|
|
770
|
+
meta?: SchemaForeignKeyMeta;
|
|
771
|
+
};
|
|
772
|
+
type SchemaColumnType = {
|
|
773
|
+
type: string;
|
|
774
|
+
length?: string | number;
|
|
775
|
+
/**
|
|
776
|
+
* Only compared/applied if defined.
|
|
777
|
+
*/
|
|
778
|
+
nullable?: boolean;
|
|
779
|
+
};
|
|
780
|
+
type SchemaChangeColumnTypeInput = SchemaStrictInput & {
|
|
781
|
+
/**
|
|
782
|
+
* Table name, optionally schema qualified (e.g. `public.user`).
|
|
783
|
+
*/
|
|
784
|
+
table: string;
|
|
785
|
+
column: string;
|
|
786
|
+
/**
|
|
787
|
+
* The column type expected to be present. The helper is a no-op if the
|
|
788
|
+
* column does not match it (e.g. because it is already migrated).
|
|
789
|
+
*/
|
|
790
|
+
from: SchemaColumnType;
|
|
791
|
+
to: SchemaColumnType;
|
|
792
|
+
/**
|
|
793
|
+
* postgres/cockroachdb only — raw SQL computing the new value from the old
|
|
794
|
+
* one, e.g. `client_id::uuid`.
|
|
795
|
+
*
|
|
796
|
+
* `ALTER COLUMN ... TYPE` converts the values with the assignment cast
|
|
797
|
+
* between the two types, and refuses the change when there is none. Pass an
|
|
798
|
+
* expression to describe the conversion in that case; without one, postgres
|
|
799
|
+
* rejects the statement rather than touching the data.
|
|
800
|
+
*
|
|
801
|
+
* Raises a `DriverError` on a dialect which has no counterpart, rather than
|
|
802
|
+
* ignoring it and leaving the server to coerce the values its own way.
|
|
803
|
+
*/
|
|
804
|
+
using?: string;
|
|
805
|
+
};
|
|
806
|
+
//#endregion
|
|
807
|
+
//#region src/database/schema/alter/columns.d.ts
|
|
808
|
+
/**
|
|
809
|
+
* Change the type (and optionally the nullability) of a column, but only if it
|
|
810
|
+
* still matches the `from` description.
|
|
811
|
+
*
|
|
812
|
+
* Returns false when the column already matches `to`, which keeps a repair
|
|
813
|
+
* migration resumable and safe to run against a database which never had the
|
|
814
|
+
* drift. When the column matches neither description (or is missing) the
|
|
815
|
+
* database is not in a state this can act on, and `strict` (the default)
|
|
816
|
+
* raises a `SchemaAlterationError` rather than reporting a repair which did
|
|
817
|
+
* not happen.
|
|
818
|
+
*
|
|
819
|
+
* The column is altered in place, so it keeps the values it holds. That is the
|
|
820
|
+
* reason the statement is built here: typeorm's `changeColumn` drops and
|
|
821
|
+
* re-adds the column as soon as the type or the length differs, which empties
|
|
822
|
+
* it. Drivers this module has no dialect for still go through typeorm — safe
|
|
823
|
+
* on sqlite, which recreates the table and copies the values over.
|
|
824
|
+
*
|
|
825
|
+
* Widening a column a foreign key depends on additionally needs
|
|
826
|
+
* {@see withForeignKeyChecksDisabled} on mysql, and is refused outright by
|
|
827
|
+
* mariadb — there the constraint has to be dropped around the change.
|
|
828
|
+
*
|
|
829
|
+
* postgres converts the values with the assignment cast between the two types
|
|
830
|
+
* and refuses a change which has none; pass `using` to describe the conversion
|
|
831
|
+
* for those.
|
|
832
|
+
*
|
|
833
|
+
* @throws SchemaAlterationError if the column matches neither description and
|
|
834
|
+
* `strict`.
|
|
835
|
+
*/
|
|
836
|
+
declare function changeColumnType(queryRunner: QueryRunner, input: SchemaChangeColumnTypeInput): Promise<boolean>;
|
|
837
|
+
//#endregion
|
|
838
|
+
//#region src/database/schema/alter/foreign-keys.d.ts
|
|
839
|
+
/**
|
|
840
|
+
* Rename a foreign key constraint, preserving its columns, its referenced
|
|
841
|
+
* table/columns and its referential actions — all of which are read back from
|
|
842
|
+
* the database, so the rename can not silently change the constraint.
|
|
843
|
+
*
|
|
844
|
+
* postgres renames the constraint in place, mysql has to drop and re-add it
|
|
845
|
+
* (with the foreign key checks disabled, since the constraint was already
|
|
846
|
+
* enforcing) and to take care of the backing index it may have created under
|
|
847
|
+
* the constraint name.
|
|
848
|
+
*
|
|
849
|
+
* Returns false when a constraint is already named `to`, which keeps a repair
|
|
850
|
+
* migration resumable. If neither name exists — the state an interrupted mysql
|
|
851
|
+
* rename leaves behind, where the constraint took its own description with it —
|
|
852
|
+
* the passed `meta` is used to restore it; without it `strict` (the default)
|
|
853
|
+
* raises a `SchemaAlterationError`, since there is nothing left to rename.
|
|
854
|
+
*
|
|
855
|
+
* @throws DriverError for a driver which can not express the rename.
|
|
856
|
+
* @throws SchemaAlterationError if neither name exists (and no `meta` describes
|
|
857
|
+
* the constraint) and `strict`.
|
|
858
|
+
*/
|
|
859
|
+
declare function renameForeignKey(queryRunner: QueryRunner, input: SchemaRenameForeignKeyInput): Promise<boolean>;
|
|
860
|
+
//#endregion
|
|
861
|
+
//#region src/database/schema/alter/indices.d.ts
|
|
862
|
+
/**
|
|
863
|
+
* Rename an index.
|
|
864
|
+
*
|
|
865
|
+
* Returns false when an index is already named `to` — that is what keeps a
|
|
866
|
+
* repair migration resumable, since mysql commits DDL regardless of the
|
|
867
|
+
* surrounding transaction.
|
|
868
|
+
*
|
|
869
|
+
* When neither name is present (or the table is missing) the database is not
|
|
870
|
+
* in a state this can act on, and `strict` (the default) raises a
|
|
871
|
+
* `SchemaAlterationError` rather than reporting a repair which did not happen.
|
|
872
|
+
*
|
|
873
|
+
* Note that an index which backs a constraint is not reported as an index by
|
|
874
|
+
* the driver: a unique constraint on postgres lives in `table.uniques`, and a
|
|
875
|
+
* foreign key's backing index on mysql only becomes visible once the constraint
|
|
876
|
+
* is dropped (see renameForeignKey).
|
|
877
|
+
*
|
|
878
|
+
* @throws DriverError for a driver which can not express the rename.
|
|
879
|
+
* @throws SchemaAlterationError if neither name exists and `strict`.
|
|
880
|
+
*/
|
|
881
|
+
declare function renameIndex(queryRunner: QueryRunner, input: SchemaRenameIndexInput): Promise<boolean>;
|
|
882
|
+
//#endregion
|
|
883
|
+
//#region src/database/schema/drift/module.d.ts
|
|
884
|
+
/**
|
|
885
|
+
* Compare the database schema against the entity metadata and return the
|
|
886
|
+
* statements which would reconcile the former with the latter.
|
|
887
|
+
*
|
|
888
|
+
* A schema which is built by migrations in production but by synchronize()
|
|
889
|
+
* in tests has no guard against the two descriptions drifting apart. Run this
|
|
890
|
+
* right after the migrations to close that gap:
|
|
891
|
+
*
|
|
892
|
+
* ```ts
|
|
893
|
+
* const drift = await getSchemaDrift(dataSource);
|
|
894
|
+
* if (drift.exists) {
|
|
895
|
+
* console.log(drift.up.map((statement) => statement.query));
|
|
896
|
+
* }
|
|
897
|
+
* ```
|
|
898
|
+
*
|
|
899
|
+
* The inspection itself never writes to the database. A data source built from
|
|
900
|
+
* the passed options is therefore built with `synchronize`, `migrationsRun` and
|
|
901
|
+
* `dropSchema` disabled, and an uninitialized DataSource which has any of them
|
|
902
|
+
* enabled is left untouched and inspected through an own instance — otherwise
|
|
903
|
+
* initializing it would mutate (or drop) the very schema being inspected.
|
|
904
|
+
*/
|
|
905
|
+
declare function getSchemaDrift(input: DataSource | DataSourceOptions, options?: SchemaDriftOptions): Promise<SchemaDrift>;
|
|
906
|
+
/**
|
|
907
|
+
* Throw if the database schema deviates from the entity metadata.
|
|
908
|
+
*
|
|
909
|
+
* @throws SchemaDriftError
|
|
910
|
+
*/
|
|
911
|
+
declare function assertSchemaMatchesMetadata(input: DataSource | DataSourceOptions, options?: SchemaDriftOptions): Promise<void>;
|
|
912
|
+
//#endregion
|
|
913
|
+
//#region src/database/schema/synchronize.d.ts
|
|
914
|
+
declare function synchronizeDatabaseSchema(input: DataSource | DataSourceOptions): Promise<Migration[]>;
|
|
915
|
+
//#endregion
|
|
916
|
+
//#region src/database/utils/context.d.ts
|
|
917
|
+
declare function buildDatabaseCreateContext(input?: DatabaseCreateContextInput): Promise<DatabaseCreateContext>;
|
|
918
|
+
declare function buildDatabaseDropContext(input?: DatabaseDropContextInput): Promise<DatabaseDropContext>;
|
|
919
|
+
//#endregion
|
|
920
|
+
//#region src/database/utils/type.d.ts
|
|
921
|
+
type MigrationGenerateResult = {
|
|
922
|
+
up: string[];
|
|
923
|
+
down: string[];
|
|
924
|
+
content?: string;
|
|
925
|
+
};
|
|
926
|
+
type MigrationGenerateCommandContext = {
|
|
927
|
+
/**
|
|
928
|
+
* Directory where the migration(s) should be stored.
|
|
929
|
+
*/
|
|
930
|
+
directoryPath?: string;
|
|
931
|
+
/**
|
|
932
|
+
* Name of the migration class.
|
|
933
|
+
*/
|
|
934
|
+
name?: string;
|
|
935
|
+
/**
|
|
936
|
+
* DataSource used for reference of existing schema.
|
|
937
|
+
*/
|
|
938
|
+
dataSource: DataSource;
|
|
939
|
+
/**
|
|
940
|
+
* Timestamp in milliseconds.
|
|
941
|
+
*/
|
|
942
|
+
timestamp?: number;
|
|
943
|
+
/**
|
|
944
|
+
* Prettify sql statements.
|
|
945
|
+
*/
|
|
946
|
+
prettify?: boolean;
|
|
947
|
+
/**
|
|
948
|
+
* Only return up- & down-statements instead of backing up the migration to the file system.
|
|
949
|
+
*/
|
|
950
|
+
preview?: boolean;
|
|
951
|
+
};
|
|
952
|
+
//#endregion
|
|
953
|
+
//#region src/database/utils/migration.d.ts
|
|
954
|
+
declare function generateMigration(context: MigrationGenerateCommandContext): Promise<MigrationGenerateResult>;
|
|
955
|
+
//#endregion
|
|
956
|
+
//#region src/database/utils/query.d.ts
|
|
957
|
+
declare function existsQuery<T extends ObjectLiteral = ObjectLiteral>(builder: SelectQueryBuilder<T>, inverse?: boolean): string;
|
|
958
|
+
//#endregion
|
|
959
|
+
//#region src/env/constants.d.ts
|
|
960
|
+
declare enum EnvironmentName {
|
|
961
|
+
DEVELOPMENT = "development",
|
|
962
|
+
PRODUCTION = "production",
|
|
963
|
+
TEST = "test"
|
|
964
|
+
}
|
|
965
|
+
declare enum EnvironmentVariableName {
|
|
966
|
+
ENV = "NODE_ENV",
|
|
967
|
+
SEEDS = "DB_SEEDS",
|
|
968
|
+
SEEDS_ALT = "TYPEORM_SEEDING_SEEDS",
|
|
969
|
+
FACTORIES = "DB_FACTORIES",
|
|
970
|
+
FACTORIES_ALT = "TYPEORM_SEEDING_FACTORIES",
|
|
971
|
+
TYPE = "DB_TYPE",
|
|
972
|
+
TYPE_ALT = "TYPEORM_CONNECTION",
|
|
973
|
+
URL = "DB_URL",
|
|
974
|
+
URL_ALT = "TYPEORM_URL",
|
|
975
|
+
HOST = "DB_HOST",
|
|
976
|
+
HOST_ALT = "TYPEORM_HOST",
|
|
977
|
+
PORT = "DB_PORT",
|
|
978
|
+
PORT_ALT = "TYPEORM_PORT",
|
|
979
|
+
USERNAME = "DB_USERNAME",
|
|
980
|
+
USERNAME_ALT = "TYPEORM_USERNAME",
|
|
981
|
+
PASSWORD = "DB_PASSWORD",
|
|
982
|
+
PASSWORD_ALT = "TYPEORM_PASSWORD",
|
|
983
|
+
DATABASE = "DB_DATABASE",
|
|
984
|
+
DATABASE_ALT = "TYPEORM_DATABASE",
|
|
985
|
+
SID = "DB_SID",
|
|
986
|
+
SID_ALT = "TYPEORM_SID",
|
|
987
|
+
SCHEMA = "DB_SCHEMA",
|
|
988
|
+
SCHEMA_ALT = "TYPEORM_SCHEMA",
|
|
989
|
+
SCHEMA_DROP = "DB_DROP_SCHEMA",
|
|
990
|
+
SCHEMA_DROP_ALT = "TYPEORM_DROP_SCHEMA",
|
|
991
|
+
DRIVER_EXTRA = "DB_DRIVER_EXTRA",
|
|
992
|
+
DRIVER_EXTRA_ALT = "TYPEORM_DRIVER_EXTRA",
|
|
993
|
+
SYNCHRONIZE = "DB_SYNCHRONIZE",
|
|
994
|
+
SYNCHRONIZE_ALT = "TYPEORM_SYNCHRONIZE",
|
|
995
|
+
MIGRATIONS = "DB_MIGRATIONS",
|
|
996
|
+
MIGRATIONS_ALT = "TYPEORM_MIGRATIONS",
|
|
997
|
+
MIGRATIONS_RUN = "DB_MIGRATIONS_RUN",
|
|
998
|
+
MIGRATIONS_RUN_ALT = "TYPEORM_MIGRATIONS_RUN",
|
|
999
|
+
MIGRATIONS_TABLE_NAME = "DB_MIGRATIONS_TABLE_NAME",
|
|
1000
|
+
MIGRATIONS_TABLE_NAME_ALT = "TYPEORM_MIGRATIONS_TABLE_NAME",
|
|
1001
|
+
ENTITIES = "DB_ENTITIES",
|
|
1002
|
+
ENTITIES_ALT = "TYPEORM_ENTITIES",
|
|
1003
|
+
ENTITY_PREFIX = "DB_ENTITY_PREFIX",
|
|
1004
|
+
ENTITY_PREFIX_ALT = "TYPEORM_ENTITY_PREFIX",
|
|
1005
|
+
METADATA_TABLE_NAME = "DB_METADATA_TABLE_NAME",
|
|
1006
|
+
METADATA_TABLE_NAME_ALT = "TYPEORM_METADATA_TABLE_NAME",
|
|
1007
|
+
SUBSCRIBERS = "DB_SUBSCRIBERS",
|
|
1008
|
+
SUBSCRIBERS_ALT = "TYPEORM_SUBSCRIBERS",
|
|
1009
|
+
LOGGING = "DB_LOGGING",
|
|
1010
|
+
LOGGING_ALT = "TYPEORM_LOGGING",
|
|
1011
|
+
LOGGER = "DB_LOGGER",
|
|
1012
|
+
LOGGER_ALT = "TYPEORM_LOGGER",
|
|
1013
|
+
MAX_QUERY_EXECUTION_TIME = "DB_MAX_QUERY_EXECUTION_TIME",
|
|
1014
|
+
MAX_QUERY_EXECUTION_TIME_ALT = "TYPEORM_MAX_QUERY_EXECUTION_TIME",
|
|
1015
|
+
DEBUG = "DB_DEBUG",
|
|
1016
|
+
DEBUG_ALT = "TYPEORM_DEBUG",
|
|
1017
|
+
UUID_EXTENSION = "DB_UUID_EXTENSION",
|
|
1018
|
+
UUID_EXTENSION_ALT = "TYPEORM_UUID_EXTENSION",
|
|
1019
|
+
CACHE = "DB_CACHE",
|
|
1020
|
+
CACHE_ALT = "TYPEORM_CACHE",
|
|
1021
|
+
CACHE_ALWAYS_ENABLED = "DB_CACHE_ALWAYS_ENABLED",
|
|
1022
|
+
CACHE_ALWAYS_ENABLED_ALT = "TYPEORM_CACHE_ALWAYS_ENABLED",
|
|
1023
|
+
CACHE_OPTIONS = "DB_CACHE_OPTIONS",
|
|
1024
|
+
CACHE_OPTIONS_ALT = "TYPEORM_CACHE_OPTIONS",
|
|
1025
|
+
CACHE_DURATION = "DB_CACHE_DURATION",
|
|
1026
|
+
CACHE_DURATION_ALT = "TYPEORM_CACHE_DURATION"
|
|
1027
|
+
}
|
|
1028
|
+
//#endregion
|
|
1029
|
+
//#region src/env/type.d.ts
|
|
1030
|
+
interface Environment {
|
|
1031
|
+
env: `${EnvironmentName}`;
|
|
1032
|
+
seeds: string[];
|
|
1033
|
+
factories: string[];
|
|
1034
|
+
type?: DatabaseType;
|
|
1035
|
+
url?: string;
|
|
1036
|
+
host?: string;
|
|
1037
|
+
port?: number;
|
|
1038
|
+
username?: string;
|
|
1039
|
+
password?: string;
|
|
1040
|
+
database?: string;
|
|
1041
|
+
sid?: string;
|
|
1042
|
+
schema?: string;
|
|
1043
|
+
/**
|
|
1044
|
+
* dropSchema
|
|
1045
|
+
*/
|
|
1046
|
+
schemaDrop?: boolean;
|
|
1047
|
+
extra?: any;
|
|
1048
|
+
synchronize?: boolean;
|
|
1049
|
+
migrations: string[];
|
|
1050
|
+
migrationsRun?: boolean;
|
|
1051
|
+
migrationsTableName?: string;
|
|
1052
|
+
entities: string[];
|
|
1053
|
+
entityPrefix?: string;
|
|
1054
|
+
metadataTableName?: string;
|
|
1055
|
+
subscribers: string[];
|
|
1056
|
+
logging: string[] | boolean | string;
|
|
1057
|
+
logger?: string;
|
|
1058
|
+
maxQueryExecutionTime?: number;
|
|
1059
|
+
debug?: string;
|
|
1060
|
+
cache?: DataSourceCacheOption;
|
|
1061
|
+
uuidExtension?: string;
|
|
1062
|
+
}
|
|
1063
|
+
//#endregion
|
|
1064
|
+
//#region src/env/module.d.ts
|
|
1065
|
+
declare function useEnv(): Environment;
|
|
1066
|
+
declare function useEnv<K extends keyof Environment>(key: K): Environment[K];
|
|
1067
|
+
declare function resetEnv(): void;
|
|
1068
|
+
//#endregion
|
|
1069
|
+
//#region src/helpers/entity/name.d.ts
|
|
1070
|
+
declare function getEntityName<O>(entity: ObjectType<O> | EntitySchema<O> | string): string;
|
|
1071
|
+
//#endregion
|
|
1072
|
+
//#region src/helpers/entity/property-names.d.ts
|
|
1073
|
+
/**
|
|
1074
|
+
* Get (relation-) property names of a given entity.
|
|
1075
|
+
*
|
|
1076
|
+
* @experimental
|
|
1077
|
+
* @param input
|
|
1078
|
+
* @param dataSource
|
|
1079
|
+
*/
|
|
1080
|
+
declare function getEntityPropertyNames<T extends ObjectLiteral>(input: EntityTarget<T> | Repository<T>, dataSource?: DataSource): Promise<string[]>;
|
|
1081
|
+
//#endregion
|
|
1082
|
+
//#region src/helpers/entity/metadata.d.ts
|
|
1083
|
+
/**
|
|
1084
|
+
* Receive metadata for a given repository or entity-target.
|
|
1085
|
+
*
|
|
1086
|
+
* @experimental
|
|
1087
|
+
* @param input
|
|
1088
|
+
* @param dataSource
|
|
1089
|
+
*/
|
|
1090
|
+
declare function getEntityMetadata<T extends ObjectLiteral>(input: Repository<T> | EntityTarget<T>, dataSource?: DataSource): Promise<EntityMetadata>;
|
|
1091
|
+
//#endregion
|
|
1092
|
+
//#region src/helpers/entity/join-columns.d.ts
|
|
1093
|
+
type EntityRelationColumnsValidateOptions<T> = {
|
|
1094
|
+
dataSource?: DataSource;
|
|
1095
|
+
entityTarget: EntityTarget<T>;
|
|
1096
|
+
};
|
|
1097
|
+
/**
|
|
1098
|
+
* Validate join columns of a given entity.
|
|
1099
|
+
* It will look up and append the referenced entities to the input entity.
|
|
1100
|
+
*
|
|
1101
|
+
* @experimental
|
|
1102
|
+
* @param entity
|
|
1103
|
+
* @param options
|
|
1104
|
+
*/
|
|
1105
|
+
declare function validateEntityJoinColumns<T extends ObjectLiteral>(entity: Partial<T>, options: EntityRelationColumnsValidateOptions<T>): Promise<Partial<T>>;
|
|
1106
|
+
//#endregion
|
|
1107
|
+
//#region src/helpers/entity/uniqueness.d.ts
|
|
1108
|
+
type EntityUniquenessCheckOptions<T> = {
|
|
1109
|
+
/**
|
|
1110
|
+
* Repository entity class.
|
|
1111
|
+
*/
|
|
1112
|
+
entityTarget: EntityTarget<T>;
|
|
1113
|
+
/**
|
|
1114
|
+
* Entity to insert/update.
|
|
1115
|
+
*/
|
|
1116
|
+
entity: Partial<T>;
|
|
1117
|
+
/**
|
|
1118
|
+
* Entity found.
|
|
1119
|
+
*/
|
|
1120
|
+
entityExisting?: Partial<T> | null;
|
|
1121
|
+
/**
|
|
1122
|
+
* DataSource to use
|
|
1123
|
+
*/
|
|
1124
|
+
dataSource?: DataSource;
|
|
1125
|
+
};
|
|
1126
|
+
/**
|
|
1127
|
+
* Check if a given entity does not already exist.
|
|
1128
|
+
* Composite unique keys on a null column can only be present once.
|
|
1129
|
+
*
|
|
1130
|
+
* @experimental
|
|
1131
|
+
* @param options
|
|
1132
|
+
*/
|
|
1133
|
+
declare function isEntityUnique<T extends ObjectLiteral>(options: EntityUniquenessCheckOptions<T>): Promise<boolean>;
|
|
1134
|
+
//#endregion
|
|
1135
|
+
//#region src/seeder/factory/type.d.ts
|
|
1136
|
+
/**
|
|
1137
|
+
* The meta argument is undefined, as long as SeederFactory.setMeta() was not called.
|
|
1138
|
+
*/
|
|
1139
|
+
type FactoryCallback<O, Meta = unknown> = (meta: Meta | undefined) => O | Promise<O>;
|
|
1140
|
+
type SeederFactoryItem = {
|
|
1141
|
+
factoryFn: FactoryCallback<any, any>;
|
|
1142
|
+
entity: ObjectType<any> | EntitySchema<any>;
|
|
1143
|
+
};
|
|
1144
|
+
type SeederFactoryContext<O, Meta = unknown> = {
|
|
1145
|
+
name: string;
|
|
1146
|
+
entity: ObjectType<O> | EntitySchema<O>;
|
|
1147
|
+
factoryFn: FactoryCallback<O, Meta>;
|
|
1148
|
+
dataSource?: DataSource;
|
|
1149
|
+
};
|
|
1150
|
+
type SeederFactoryManagerContext = {
|
|
1151
|
+
items?: Record<string, SeederFactoryItem>;
|
|
1152
|
+
dataSource?: DataSource;
|
|
1153
|
+
};
|
|
1154
|
+
//#endregion
|
|
1155
|
+
//#region src/seeder/factory/module.d.ts
|
|
1156
|
+
declare class SeederFactory<O extends Record<string, any>, Meta = unknown> {
|
|
1157
|
+
readonly context: SeederFactoryContext<O, Meta>;
|
|
1158
|
+
meta: Meta | undefined;
|
|
1159
|
+
constructor(context: SeederFactoryContext<O, Meta>);
|
|
1160
|
+
setMeta(value: Meta): this;
|
|
1161
|
+
make(params?: Partial<O>, save?: boolean): Promise<O>;
|
|
1162
|
+
save(params?: Partial<O>, options?: SaveOptions): Promise<O>;
|
|
1163
|
+
saveMany(amount: number, params?: Partial<O>, options?: SaveOptions): Promise<O[]>;
|
|
1164
|
+
private resolve;
|
|
1165
|
+
}
|
|
1166
|
+
//#endregion
|
|
1167
|
+
//#region src/seeder/factory/manager.d.ts
|
|
1168
|
+
declare class SeederFactoryManager {
|
|
1169
|
+
readonly items: Record<string, SeederFactoryItem>;
|
|
1170
|
+
readonly dataSource: DataSource | undefined;
|
|
1171
|
+
constructor(context?: SeederFactoryManagerContext);
|
|
1172
|
+
set<O extends Record<string, any>, Meta = unknown>(entity: ObjectType<O> | EntitySchema<O>, factoryFn: FactoryCallback<O, Meta>): SeederFactoryItem;
|
|
1173
|
+
get<O extends Record<string, any>, Meta = unknown>(entity: ObjectType<O> | EntitySchema<O>): SeederFactory<O, Meta>;
|
|
1174
|
+
}
|
|
1175
|
+
//#endregion
|
|
1176
|
+
//#region src/seeder/factory/utils.d.ts
|
|
1177
|
+
declare function useSeederFactoryManager(): SeederFactoryManager;
|
|
1178
|
+
declare function resetSeederFactoryManager(): void;
|
|
1179
|
+
declare function setSeederFactory<O extends Record<string, any>, Meta = unknown>(entity: ObjectType<O> | EntitySchema<O>, factoryFn: FactoryCallback<O, Meta>): SeederFactoryItem;
|
|
1180
|
+
declare function useSeederFactory<O extends Record<string, any>, Meta = unknown>(entity: ObjectType<O> | EntitySchema<O>): SeederFactory<O, Meta>;
|
|
1181
|
+
declare function prepareSeederFactories(items: SeederFactoryItem[] | string[], root?: string): Promise<void>;
|
|
1182
|
+
//#endregion
|
|
1183
|
+
//#region src/seeder/type.d.ts
|
|
1184
|
+
interface Seeder {
|
|
1185
|
+
/**
|
|
1186
|
+
* Track seeder execution.
|
|
1187
|
+
*
|
|
1188
|
+
* Default: false
|
|
1189
|
+
*/
|
|
1190
|
+
track?: boolean;
|
|
1191
|
+
run(dataSource: DataSource, factoryManager: SeederFactoryManager): Promise<any>;
|
|
1192
|
+
}
|
|
1193
|
+
type SeederConstructor = new () => Seeder;
|
|
1194
|
+
type SeederOptions = {
|
|
1195
|
+
seeds?: SeederConstructor[] | string[];
|
|
1196
|
+
seedName?: string;
|
|
1197
|
+
seedTableName?: string;
|
|
1198
|
+
seedTracking?: boolean;
|
|
1199
|
+
factories?: SeederFactoryItem[] | string[];
|
|
1200
|
+
};
|
|
1201
|
+
/**
|
|
1202
|
+
* A fully resolved seeder configuration
|
|
1203
|
+
* (explicit input ← data-source options ← environment ← built-in defaults).
|
|
1204
|
+
*/
|
|
1205
|
+
type SeederConfig = {
|
|
1206
|
+
seeds: SeederConstructor[] | string[];
|
|
1207
|
+
seedName?: string;
|
|
1208
|
+
seedTableName: string;
|
|
1209
|
+
seedTracking: boolean;
|
|
1210
|
+
factories: SeederFactoryItem[] | string[];
|
|
1211
|
+
};
|
|
1212
|
+
type SeederExecutorOptions = {
|
|
1213
|
+
/**
|
|
1214
|
+
* Root directory of the project.
|
|
1215
|
+
*/
|
|
1216
|
+
root?: string;
|
|
1217
|
+
/**
|
|
1218
|
+
* Directory path to the tsconfig.json file
|
|
1219
|
+
*
|
|
1220
|
+
* Default: process.cwd() + path.sep + tsconfig.json
|
|
1221
|
+
*/
|
|
1222
|
+
tsconfig?: string | TSConfig;
|
|
1223
|
+
/**
|
|
1224
|
+
* This option indicates if file paths should be preserved,
|
|
1225
|
+
* and treated as if the just-in-time compilation environment is detected.
|
|
1226
|
+
*/
|
|
1227
|
+
preserveFilePaths?: boolean;
|
|
1228
|
+
};
|
|
1229
|
+
type SeederPrepareElement = {
|
|
1230
|
+
constructor: SeederConstructor;
|
|
1231
|
+
timestamp?: number;
|
|
1232
|
+
fileName?: string;
|
|
1233
|
+
filePath?: string;
|
|
1234
|
+
};
|
|
1235
|
+
//#endregion
|
|
1236
|
+
//#region src/seeder/config.d.ts
|
|
1237
|
+
declare function resolveSeederConfig(input?: SeederOptions, dataSourceOptions?: SeederOptions, env?: Pick<Environment, 'seeds' | 'factories'>): SeederConfig;
|
|
1238
|
+
//#endregion
|
|
1239
|
+
//#region src/seeder/entity.d.ts
|
|
1240
|
+
declare class SeederEntity {
|
|
1241
|
+
/**
|
|
1242
|
+
* ID of the seeder.
|
|
1243
|
+
*
|
|
1244
|
+
* Indicates order of the executed seeders.
|
|
1245
|
+
*/
|
|
1246
|
+
id?: number;
|
|
1247
|
+
/**
|
|
1248
|
+
* Timestamp of the seeder.
|
|
1249
|
+
*/
|
|
1250
|
+
timestamp: number;
|
|
1251
|
+
/**
|
|
1252
|
+
* Name of the seeder (class name).
|
|
1253
|
+
*/
|
|
1254
|
+
name: string;
|
|
1255
|
+
/**
|
|
1256
|
+
* Instance of seeder constructor.
|
|
1257
|
+
*/
|
|
1258
|
+
instance?: Seeder;
|
|
1259
|
+
/**
|
|
1260
|
+
* File name of the seeder.
|
|
1261
|
+
*/
|
|
1262
|
+
fileName?: string;
|
|
1263
|
+
/**
|
|
1264
|
+
* File path of the seeder.
|
|
1265
|
+
*/
|
|
1266
|
+
filePath?: string;
|
|
1267
|
+
/**
|
|
1268
|
+
* Result of the executed seeder.
|
|
1269
|
+
*/
|
|
1270
|
+
result?: unknown;
|
|
1271
|
+
constructor(ctx: {
|
|
1272
|
+
id?: number;
|
|
1273
|
+
timestamp: number;
|
|
1274
|
+
name: string;
|
|
1275
|
+
constructor?: SeederConstructor;
|
|
1276
|
+
fileName?: string;
|
|
1277
|
+
filePath?: string;
|
|
1278
|
+
});
|
|
1279
|
+
get trackExecution(): boolean | undefined;
|
|
1280
|
+
/**
|
|
1281
|
+
* Decide whether this seeder's execution should be tracked.
|
|
1282
|
+
* The per-seed track property wins over the executor-level default.
|
|
1283
|
+
*/
|
|
1284
|
+
effectiveTracking(fallback: boolean): boolean;
|
|
1285
|
+
/**
|
|
1286
|
+
* Execution-order comparator:
|
|
1287
|
+
* by file name when both entities are file-backed, by timestamp otherwise.
|
|
1288
|
+
*/
|
|
1289
|
+
static compare(a: SeederEntity, b: SeederEntity): number;
|
|
1290
|
+
}
|
|
1291
|
+
//#endregion
|
|
1292
|
+
//#region src/utils/code-transformation/constants.d.ts
|
|
1293
|
+
declare enum CodeTransformation {
|
|
1294
|
+
JUST_IN_TIME = "jit",
|
|
1295
|
+
NONE = "none"
|
|
1296
|
+
}
|
|
1297
|
+
//#endregion
|
|
1298
|
+
//#region src/utils/code-transformation/module.d.ts
|
|
1299
|
+
declare function detectCodeTransformation(): `${CodeTransformation}`;
|
|
1300
|
+
declare function isCodeTransformation(input: string): boolean;
|
|
1301
|
+
//#endregion
|
|
1302
|
+
//#region src/utils/file-path.d.ts
|
|
1303
|
+
declare function transformFilePath(input: string, dist?: string, src?: string): string;
|
|
1304
|
+
declare function resolveFilePath(filePath: string, root?: string): string;
|
|
1305
|
+
declare function parseFilePath(filePath: string, root?: string): {
|
|
1306
|
+
directory: string;
|
|
1307
|
+
name: string;
|
|
1308
|
+
};
|
|
1309
|
+
//#endregion
|
|
1310
|
+
//#region src/utils/file-system.d.ts
|
|
1311
|
+
declare function isDirectory(input: string): Promise<boolean>;
|
|
1312
|
+
//#endregion
|
|
1313
|
+
//#region src/utils/has-property.d.ts
|
|
1314
|
+
declare function hasOwnProperty<X extends Record<string, any>, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown>;
|
|
1315
|
+
declare function hasStringProperty<X extends Record<string, any>, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, string>;
|
|
1316
|
+
//#endregion
|
|
1317
|
+
//#region src/utils/object.d.ts
|
|
1318
|
+
declare function pickRecord(data: Record<string, any>, keys: string[]): Record<string, any>;
|
|
1319
|
+
declare function extendObject<T extends Record<string, any>>(target: T, source: Partial<T>): T;
|
|
1320
|
+
declare function isObject(item: unknown): item is Record<string, any>;
|
|
1321
|
+
//#endregion
|
|
1322
|
+
//#region src/utils/path-resolver/constants.d.ts
|
|
1323
|
+
declare enum PathResolverMode {
|
|
1324
|
+
AUTO = "auto",
|
|
1325
|
+
PRESERVE = "preserve",
|
|
1326
|
+
TRANSFORM = "transform"
|
|
1327
|
+
}
|
|
1328
|
+
//#endregion
|
|
1329
|
+
//#region src/utils/path-resolver/helpers/adjust-file-path.d.ts
|
|
1330
|
+
declare function adjustFilePath<T extends unknown | unknown[]>(input: T, tsconfig?: string | TSConfig): Promise<T>;
|
|
1331
|
+
//#endregion
|
|
1332
|
+
//#region src/utils/path-resolver/helpers/adjust-file-paths.d.ts
|
|
1333
|
+
declare function adjustFilePaths<T extends Record<string, any>>(input: T, keys?: (keyof T)[], tsconfig?: string | TSConfig): Promise<T>;
|
|
1334
|
+
//#endregion
|
|
1335
|
+
//#region src/utils/path-resolver/type.d.ts
|
|
1336
|
+
type PathResolverOptions = {
|
|
1337
|
+
/**
|
|
1338
|
+
* Root directory against which relative paths are absolutized.
|
|
1339
|
+
*
|
|
1340
|
+
* Default: process.cwd()
|
|
1341
|
+
*/
|
|
1342
|
+
root?: string;
|
|
1343
|
+
/**
|
|
1344
|
+
* Tsconfig object or path to the tsconfig file,
|
|
1345
|
+
* resolved against the root directory.
|
|
1346
|
+
*
|
|
1347
|
+
* Default: tsconfig.json
|
|
1348
|
+
*/
|
|
1349
|
+
tsconfig?: string | TSConfig;
|
|
1350
|
+
/**
|
|
1351
|
+
* preserve: never rewrite paths.
|
|
1352
|
+
* transform: always rewrite paths (src -> outDir, .ts -> .js).
|
|
1353
|
+
* auto: rewrite unless a just-in-time environment (e.g. ts-node, tsx) is detected.
|
|
1354
|
+
*
|
|
1355
|
+
* Default: auto
|
|
1356
|
+
*/
|
|
1357
|
+
mode?: `${PathResolverMode}`;
|
|
1358
|
+
};
|
|
1359
|
+
interface IPathResolver {
|
|
1360
|
+
/**
|
|
1361
|
+
* Absolutize a path against the root directory.
|
|
1362
|
+
*/
|
|
1363
|
+
absolutize(input: string): string;
|
|
1364
|
+
/**
|
|
1365
|
+
* Rewrite a path for the runtime environment (src -> outDir, .ts -> .js),
|
|
1366
|
+
* depending on the resolver mode.
|
|
1367
|
+
*/
|
|
1368
|
+
transform(input: string): Promise<string>;
|
|
1369
|
+
/**
|
|
1370
|
+
* Transform the (string or string-array) values of the given keys in place.
|
|
1371
|
+
*/
|
|
1372
|
+
transformKeys<T extends Record<string, any>>(input: T, keys?: (keyof T)[]): Promise<T>;
|
|
1373
|
+
/**
|
|
1374
|
+
* Absolutize and transform a path.
|
|
1375
|
+
*/
|
|
1376
|
+
resolve(input: string): Promise<string>;
|
|
1377
|
+
/**
|
|
1378
|
+
* The lazily read tsconfig backing the transformation.
|
|
1379
|
+
*/
|
|
1380
|
+
tsconfig(): Promise<TSConfig>;
|
|
1381
|
+
}
|
|
1382
|
+
//#endregion
|
|
1383
|
+
//#region src/utils/path-resolver/module.d.ts
|
|
1384
|
+
declare class PathResolver implements IPathResolver {
|
|
1385
|
+
protected root?: string;
|
|
1386
|
+
protected mode: `${PathResolverMode}`;
|
|
1387
|
+
protected tsconfigInput?: string | TSConfig;
|
|
1388
|
+
protected tsconfigPromise?: Promise<TSConfig>;
|
|
1389
|
+
constructor(options?: PathResolverOptions);
|
|
1390
|
+
absolutize(input: string): string;
|
|
1391
|
+
resolve(input: string): Promise<string>;
|
|
1392
|
+
transform(input: string): Promise<string>;
|
|
1393
|
+
transformKeys<T extends Record<string, any>>(input: T, keys?: (keyof T)[]): Promise<T>;
|
|
1394
|
+
tsconfig(): Promise<TSConfig>;
|
|
1395
|
+
protected readTsconfig(): Promise<TSConfig>;
|
|
1396
|
+
protected shouldTransform(): boolean;
|
|
1397
|
+
}
|
|
1398
|
+
declare function createPathResolver(options?: PathResolverOptions): IPathResolver;
|
|
1399
|
+
//#endregion
|
|
1400
|
+
//#region src/utils/promise.d.ts
|
|
1401
|
+
declare function isPromise(p: unknown): p is Promise<unknown>;
|
|
1402
|
+
//#endregion
|
|
1403
|
+
//#region src/utils/separator.d.ts
|
|
1404
|
+
declare function canReplaceWindowsSeparator(input: string): boolean;
|
|
1405
|
+
declare function replaceWindowSeparator(input: string): string;
|
|
1406
|
+
declare function safeReplaceWindowsSeparator(input: string): string;
|
|
1407
|
+
//#endregion
|
|
1408
|
+
//#region src/utils/slash.d.ts
|
|
1409
|
+
declare function hasTrailingSlash(input?: string, queryParams?: boolean): boolean;
|
|
1410
|
+
declare function withoutTrailingSlash(input?: string, queryParams?: boolean): string;
|
|
1411
|
+
//#endregion
|
|
1412
|
+
//#region src/seeder/executor.d.ts
|
|
1413
|
+
declare class SeederExecutor {
|
|
1414
|
+
protected dataSource: DataSource;
|
|
1415
|
+
protected options: SeederExecutorOptions;
|
|
1416
|
+
protected pathResolver: IPathResolver;
|
|
1417
|
+
constructor(dataSource: DataSource, options?: SeederExecutorOptions);
|
|
1418
|
+
execute(input?: SeederOptions): Promise<SeederEntity[]>;
|
|
1419
|
+
protected resolveConfig(input?: SeederOptions): Promise<SeederConfig>;
|
|
1420
|
+
protected loadEntities(config: SeederConfig): Promise<SeederEntity[]>;
|
|
1421
|
+
protected filterPending(all: SeederEntity[], existing: SeederEntity[], config: SeederConfig): SeederEntity[];
|
|
1422
|
+
protected isMatch(seed: SeederEntity, config: SeederConfig): boolean;
|
|
1423
|
+
protected runPending(pending: SeederEntity[], config: SeederConfig, queryRunner?: QueryRunner): Promise<SeederEntity[]>;
|
|
1424
|
+
protected loadExisting(queryRunner: QueryRunner, tableName: string): Promise<SeederEntity[]>;
|
|
1425
|
+
protected buildEntities(seeds?: SeederPrepareElement[]): Promise<SeederEntity[]>;
|
|
1426
|
+
protected checkForDuplicates(entities: SeederEntity[]): void;
|
|
1427
|
+
protected createTableIfNotExist(queryRunner: QueryRunner, tableName: string): Promise<void>;
|
|
1428
|
+
protected track(queryRunner: QueryRunner, seederEntity: SeederEntity, tableName: string): Promise<void>;
|
|
1429
|
+
protected get dataSourceOptions(): DataSourceOptions & SeederOptions;
|
|
1430
|
+
protected get database(): string | undefined;
|
|
1431
|
+
protected get schema(): string | undefined;
|
|
1432
|
+
protected buildTableName(tableName: string): string;
|
|
1433
|
+
protected classNameToTimestamp(className: string): number | undefined;
|
|
1434
|
+
}
|
|
1435
|
+
//#endregion
|
|
1436
|
+
//#region src/seeder/module.d.ts
|
|
1437
|
+
declare function runSeeder(dataSource: DataSource, seeder: SeederConstructor | string, options?: SeederOptions): Promise<SeederEntity | undefined>;
|
|
1438
|
+
declare function runSeeders(dataSource: DataSource, options?: SeederOptions): Promise<SeederEntity[]>;
|
|
1439
|
+
//#endregion
|
|
1440
|
+
//#region src/seeder/utils/file-name.d.ts
|
|
1441
|
+
declare function buildSeederFileName(name: string, timestamp: number, options?: {
|
|
1442
|
+
javascript?: boolean;
|
|
1443
|
+
}): string;
|
|
1444
|
+
//#endregion
|
|
1445
|
+
//#region src/seeder/utils/file-path.d.ts
|
|
1446
|
+
declare function resolveFilePatterns(filesPattern: string[], root?: string): Promise<string[]>;
|
|
1447
|
+
declare function resolveFilePaths(filePaths: string[], root?: string): string[];
|
|
1448
|
+
//#endregion
|
|
1449
|
+
//#region src/seeder/utils/prepare.d.ts
|
|
1450
|
+
declare function prepareSeederSeeds(input: SeederConstructor[] | string[], root?: string): Promise<SeederPrepareElement[]>;
|
|
1451
|
+
//#endregion
|
|
1452
|
+
//#region src/seeder/utils/template.d.ts
|
|
1453
|
+
declare function buildSeederFileTemplate(name: string, timestamp: number): string;
|
|
1454
|
+
//#endregion
|
|
1455
|
+
export { CockroachDBDialect, CodeTransformation, ConnectionParams, DataSourceCacheOption, DataSourceFindOptions, DataSourceOptionsBuildContext, DatabaseBaseContext, DatabaseBaseContextInput, DatabaseCheckContext, DatabaseCheckResult, DatabaseCreateContext, DatabaseCreateContextInput, DatabaseCreateOperation, DatabaseDialectName, DatabaseDialectOverrides, DatabaseDialectRegistryEntry, DatabaseDropContext, DatabaseDropContextInput, DatabaseDropOperation, DriverError, EntityMetadataError, EntityRelationLookupError, Environment, EnvironmentName, EnvironmentVariableName, FactoryCallback, IDatabaseConnection, IDatabaseConnectionFactory, IDatabaseDialect, IFileSystem, IPathResolver, MYSQL_FOREIGN_KEY_CHECKS_OFF, MYSQL_FOREIGN_KEY_CHECKS_ON, MYSQL_FOREIGN_KEY_CHECKS_SELECT, MigrationGenerateCommandContext, MigrationGenerateResult, MongoDBDialect, MsSQLDialect, MySQLDialect, OptionsError, OracleDialect, PathResolver, PathResolverMode, PathResolverOptions, PostgresDialect, SQLiteDialect, SchemaAlterationError, type SchemaChangeColumnTypeInput, type SchemaColumnType, SchemaDrift, SchemaDriftError, SchemaDriftOptions, SchemaDriftStatement, type SchemaForeignKeyMeta, type SchemaRenameForeignKeyInput, type SchemaRenameIndexInput, type SchemaStrictInput, Seeder, SeederConfig, SeederConstructor, SeederEntity, SeederExecutor, SeederExecutorOptions, SeederFactory, SeederFactoryContext, SeederFactoryItem, SeederFactoryManager, SeederFactoryManagerContext, SeederOptions, SeederPrepareElement, StripEnums, TSConfig, TypeormExtensionError, adjustFilePath, adjustFilePaths, assertSchemaMatchesMetadata, buildCockroachDBCreateDatabaseQuery, buildCockroachDBDropDatabaseQuery, buildConnectionParams, buildDataSourceOptions, buildDatabaseCreateContext, buildDatabaseDropContext, buildMongoDBConnectionUri, buildMongoDBDropDatabaseCommand, buildMsSQLCreateDatabaseQuery, buildMsSQLDropDatabaseQuery, buildMySQLCreateDatabaseQuery, buildMySQLDropDatabaseQuery, buildOracleConnectString, buildOracleCreateDatabaseQuery, buildPostgresCreateDatabaseQuery, buildPostgresCreateSchemaQuery, buildPostgresDatabaseExistsQuery, buildPostgresDropDatabaseQuery, buildSeederFileName, buildSeederFileTemplate, canReplaceWindowsSeparator, changeColumnType, checkDatabase, createCockroachDBDatabase, createDatabase, createMongoDBDatabase, createMsSQLDatabase, createMySQLDatabase, createOracleDatabase, createPathResolver, createPostgresDatabase, createSQLiteDatabase, deriveMySQLCharacterSet, detectCodeTransformation, dropCockroachDBDatabase, dropDatabase, dropMongoDBDatabase, dropMsSQLDatabase, dropMySQLDatabase, dropOracleDatabase, dropPostgresDatabase, dropSQLiteDatabase, existsQuery, extendObject, findDataSource, generateMigration, getEntityMetadata, getEntityName, getEntityPropertyNames, getSchemaDrift, hasDataSource, hasDataSourceOptions, hasEnvDataSourceOptions, hasOwnProperty, hasResultRows, hasStringProperty, hasTrailingSlash, isCodeTransformation, isDirectory, isEntityUnique, isObject, isPromise, mergeDataSourceOptions, mergeDataSourceOptionsWithEnv, parseFilePath, pickRecord, prepareSeederFactories, prepareSeederSeeds, readDataSourceOptionsFromEnv, readTSConfig, renameForeignKey, renameIndex, replaceWindowSeparator, resetEnv, resetSeederFactoryManager, resolveFilePath, resolveFilePaths, resolveFilePatterns, resolveSQLiteDatabaseDirectory, resolveSQLiteDatabasePath, resolveSeederConfig, runSeeder, runSeeders, safeReplaceWindowsSeparator, setDataSource, setDataSourceOptions, setSeederFactory, synchronizeDatabaseSchema, transformFilePath, unsetDataSource, useDataSource, useDataSourceOptions, useEnv, useSeederFactory, useSeederFactoryManager, validateEntityJoinColumns, withForeignKeyChecksDisabled, withoutTrailingSlash };
|
|
1456
|
+
//# sourceMappingURL=index.d.mts.map
|