typeorm 0.2.41-dev.29cb891 → 0.2.41-dev.7b8a1e3
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/browser/cache/DbQueryResultCache.js +12 -3
- package/browser/cache/DbQueryResultCache.js.map +1 -1
- package/browser/driver/mongodb/MongoQueryRunner.d.ts +2 -0
- package/browser/driver/mongodb/MongoQueryRunner.js +3 -0
- package/browser/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/browser/index.d.ts +8 -0
- package/browser/index.js +8 -0
- package/browser/index.js.map +1 -1
- package/browser/persistence/SubjectExecutor.js +2 -2
- package/browser/persistence/SubjectExecutor.js.map +1 -1
- package/browser/query-builder/ReturningResultsEntityUpdator.d.ts +4 -0
- package/browser/query-builder/ReturningResultsEntityUpdator.js +11 -2
- package/browser/query-builder/ReturningResultsEntityUpdator.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.js +4 -4
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-builder/SoftDeleteQueryBuilder.js +1 -1
- package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.d.ts +1 -0
- package/browser/query-runner/BaseQueryRunner.js +3 -0
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/query-runner/QueryRunner.d.ts +5 -0
- package/browser/query-runner/QueryRunner.js.map +1 -1
- package/cache/DbQueryResultCache.js +12 -3
- package/cache/DbQueryResultCache.js.map +1 -1
- package/driver/mongodb/MongoQueryRunner.d.ts +2 -0
- package/driver/mongodb/MongoQueryRunner.js +3 -0
- package/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/index.d.ts +8 -0
- package/index.js +8 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/persistence/SubjectExecutor.js +2 -2
- package/persistence/SubjectExecutor.js.map +1 -1
- package/query-builder/ReturningResultsEntityUpdator.d.ts +4 -0
- package/query-builder/ReturningResultsEntityUpdator.js +11 -2
- package/query-builder/ReturningResultsEntityUpdator.js.map +1 -1
- package/query-builder/SelectQueryBuilder.js +4 -4
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-builder/SoftDeleteQueryBuilder.js +1 -1
- package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/query-runner/BaseQueryRunner.d.ts +1 -0
- package/query-runner/BaseQueryRunner.js +3 -0
- package/query-runner/BaseQueryRunner.js.map +1 -1
- package/query-runner/QueryRunner.d.ts +5 -0
- package/query-runner/QueryRunner.js.map +1 -1
|
@@ -151,11 +151,14 @@ var DbQueryResultCache = /** @class */ (function () {
|
|
|
151
151
|
*/
|
|
152
152
|
DbQueryResultCache.prototype.storeInCache = function (options, savedCache, queryRunner) {
|
|
153
153
|
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
-
var insertedValues, qb, qb;
|
|
154
|
+
var shouldCreateQueryRunner, insertedValues, qb, qb;
|
|
155
155
|
return __generator(this, function (_a) {
|
|
156
156
|
switch (_a.label) {
|
|
157
157
|
case 0:
|
|
158
|
-
|
|
158
|
+
shouldCreateQueryRunner = queryRunner === undefined || (queryRunner === null || queryRunner === void 0 ? void 0 : queryRunner.getReplicationMode()) === "slave";
|
|
159
|
+
if (queryRunner === undefined || shouldCreateQueryRunner) {
|
|
160
|
+
queryRunner = this.connection.createQueryRunner("master");
|
|
161
|
+
}
|
|
159
162
|
insertedValues = options;
|
|
160
163
|
if (this.connection.driver instanceof SqlServerDriver) { // todo: bad abstraction, re-implement this part, probably better if we create an entity metadata for cache table
|
|
161
164
|
insertedValues = {
|
|
@@ -202,7 +205,13 @@ var DbQueryResultCache = /** @class */ (function () {
|
|
|
202
205
|
case 5:
|
|
203
206
|
_a.sent();
|
|
204
207
|
_a.label = 6;
|
|
205
|
-
case 6:
|
|
208
|
+
case 6:
|
|
209
|
+
if (!shouldCreateQueryRunner) return [3 /*break*/, 8];
|
|
210
|
+
return [4 /*yield*/, queryRunner.release()];
|
|
211
|
+
case 7:
|
|
212
|
+
_a.sent();
|
|
213
|
+
_a.label = 8;
|
|
214
|
+
case 8: return [2 /*return*/];
|
|
206
215
|
}
|
|
207
216
|
});
|
|
208
217
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/cache/DbQueryResultCache.ts"],"names":[],"mappings":";AAEA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAC,KAAK,EAAC,MAAM,+BAA+B,CAAC;AAIpD;;GAEG;AACH;IAYI,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,4BAAsB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAEhC,IAAA,MAAM,GAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAe,OAA5C,CAA6C;QAC3D,IAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjD,IAAM,YAAY,GAAG,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5G,IAAM,cAAc,GAAG,YAAY,CAAC,SAAS,IAAI,oBAAoB,CAAC;QAEtE,IAAI,CAAC,wBAAwB,GAAG,QAAQ,CAAC;QACzC,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC;QACrC,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzG,CAAC;IAED,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACG,oCAAO,GAA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H,SAMG,CAAC;;;;;KACP;IAED,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAE5E;;OAEG;IACO,2CAAc,GAAxB,UAAyB,WAAkC;QACvD,IAAI,WAAW;YACX,OAAO,WAAW,CAAC;QAEvB,OAAO,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;IAC/C,CAAC;IAEL,yBAAC;AAAD,CApOA,AAoOC,IAAA","file":"DbQueryResultCache.js","sourcesContent":["import {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {Connection} from \"../connection/Connection\";\nimport {OracleDriver} from \"../driver/oracle/OracleDriver\";\nimport {MssqlParameter} from \"../driver/sqlserver/MssqlParameter\";\nimport {SqlServerDriver} from \"../driver/sqlserver/SqlServerDriver\";\nimport {QueryRunner} from \"../query-runner/QueryRunner\";\nimport {Table} from \"../schema-builder/table/Table\";\nimport {QueryResultCache} from \"./QueryResultCache\";\nimport {QueryResultCacheOptions} from \"./QueryResultCacheOptions\";\n\n/**\n * Caches query result into current database, into separate table called \"query-result-cache\".\n */\nexport class DbQueryResultCache implements QueryResultCache {\n\n // -------------------------------------------------------------------------\n // Private properties\n // -------------------------------------------------------------------------\n\n private queryResultCacheTable: string;\n\n private queryResultCacheDatabase?: string;\n\n private queryResultCacheSchema?: string;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(protected connection: Connection) {\n\n const { schema } = (this.connection.driver.options as any);\n const database = this.connection.driver.database;\n const cacheOptions = typeof this.connection.options.cache === \"object\" ? this.connection.options.cache : {};\n const cacheTableName = cacheOptions.tableName || \"query-result-cache\";\n\n this.queryResultCacheDatabase = database;\n this.queryResultCacheSchema = schema;\n this.queryResultCacheTable = this.connection.driver.buildTableName(cacheTableName, schema, database);\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates a connection with given cache provider.\n */\n async connect(): Promise<void> {\n }\n\n /**\n * Disconnects with given cache provider.\n */\n async disconnect(): Promise<void> {\n }\n\n /**\n * Creates table for storing cache if it does not exist yet.\n */\n async synchronize(queryRunner?: QueryRunner): Promise<void> {\n queryRunner = this.getQueryRunner(queryRunner);\n const driver = this.connection.driver;\n const tableExist = await queryRunner.hasTable(this.queryResultCacheTable); // todo: table name should be configurable\n if (tableExist)\n return;\n\n await queryRunner.createTable(new Table(\n {\n database: this.queryResultCacheDatabase,\n schema: this.queryResultCacheSchema,\n name: this.queryResultCacheTable,\n columns: [\n {\n name: \"id\",\n isPrimary: true,\n isNullable: false,\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheId}),\n generationStrategy: \"increment\",\n isGenerated: true\n },\n {\n name: \"identifier\",\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheIdentifier}),\n isNullable: true\n },\n {\n name: \"time\",\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheTime}),\n isPrimary: false,\n isNullable: false\n },\n {\n name: \"duration\",\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheDuration}),\n isPrimary: false,\n isNullable: false\n },\n {\n name: \"query\",\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheQuery}),\n isPrimary: false,\n isNullable: false\n },\n {\n name: \"result\",\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheResult}),\n isNullable: false\n },\n ]\n },\n ));\n }\n\n /**\n * Caches given query result.\n * Returns cache result if found.\n * Returns undefined if result is not cached.\n */\n getFromCache(options: QueryResultCacheOptions, queryRunner?: QueryRunner): Promise<QueryResultCacheOptions|undefined> {\n queryRunner = this.getQueryRunner(queryRunner);\n const qb = this.connection\n .createQueryBuilder(queryRunner)\n .select()\n .from(this.queryResultCacheTable, \"cache\");\n\n if (options.identifier) {\n return qb\n .where(`${qb.escape(\"cache\")}.${qb.escape(\"identifier\")} = :identifier`)\n .setParameters({ identifier: this.connection.driver instanceof SqlServerDriver ? new MssqlParameter(options.identifier, \"nvarchar\") : options.identifier })\n .getRawOne();\n\n } else if (options.query) {\n if (this.connection.driver instanceof OracleDriver) {\n return qb\n .where(`dbms_lob.compare(${qb.escape(\"cache\")}.${qb.escape(\"query\")}, :query) = 0`, { query: options.query })\n .getRawOne();\n }\n\n return qb\n .where(`${qb.escape(\"cache\")}.${qb.escape(\"query\")} = :query`)\n .setParameters({ query: this.connection.driver instanceof SqlServerDriver ? new MssqlParameter(options.query, \"nvarchar\") : options.query })\n .getRawOne();\n }\n\n return Promise.resolve(undefined);\n }\n\n /**\n * Checks if cache is expired or not.\n */\n isExpired(savedCache: QueryResultCacheOptions): boolean {\n const duration = typeof savedCache.duration === \"string\" ? parseInt(savedCache.duration) : savedCache.duration;\n return ((typeof savedCache.time === \"string\" ? parseInt(savedCache.time as any) : savedCache.time)! + duration) < new Date().getTime();\n }\n\n /**\n * Stores given query result in the cache.\n */\n async storeInCache(options: QueryResultCacheOptions, savedCache: QueryResultCacheOptions|undefined, queryRunner?: QueryRunner): Promise<void> {\n queryRunner = this.getQueryRunner(queryRunner);\n\n let insertedValues: ObjectLiteral = options;\n if (this.connection.driver instanceof SqlServerDriver) { // todo: bad abstraction, re-implement this part, probably better if we create an entity metadata for cache table\n insertedValues = {\n identifier: new MssqlParameter(options.identifier, \"nvarchar\"),\n time: new MssqlParameter(options.time, \"bigint\"),\n duration: new MssqlParameter(options.duration, \"int\"),\n query: new MssqlParameter(options.query, \"nvarchar\"),\n result: new MssqlParameter(options.result, \"nvarchar\"),\n };\n }\n\n if (savedCache && savedCache.identifier) { // if exist then update\n const qb = queryRunner.manager\n .createQueryBuilder()\n .update(this.queryResultCacheTable)\n .set(insertedValues);\n\n qb.where(`${qb.escape(\"identifier\")} = :condition`, { condition: insertedValues.identifier });\n await qb.execute();\n\n } else if (savedCache && savedCache.query) { // if exist then update\n const qb = queryRunner.manager\n .createQueryBuilder()\n .update(this.queryResultCacheTable)\n .set(insertedValues);\n\n if (this.connection.driver instanceof OracleDriver) {\n qb.where(`dbms_lob.compare(\"query\", :condition) = 0`, { condition: insertedValues.query });\n\n } else {\n qb.where(`${qb.escape(\"query\")} = :condition`, { condition: insertedValues.query });\n }\n\n await qb.execute();\n\n } else { // otherwise insert\n await queryRunner.manager\n .createQueryBuilder()\n .insert()\n .into(this.queryResultCacheTable)\n .values(insertedValues)\n .execute();\n }\n }\n\n /**\n * Clears everything stored in the cache.\n */\n async clear(queryRunner: QueryRunner): Promise<void> {\n return this.getQueryRunner(queryRunner).clearTable(this.queryResultCacheTable);\n }\n\n /**\n * Removes all cached results by given identifiers from cache.\n */\n async remove(identifiers: string[], queryRunner?: QueryRunner): Promise<void> {\n await Promise.all(identifiers.map(identifier => {\n const qb = this.getQueryRunner(queryRunner).manager.createQueryBuilder();\n return qb.delete()\n .from(this.queryResultCacheTable)\n .where(`${qb.escape(\"identifier\")} = :identifier`, {identifier})\n .execute();\n }));\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Gets a query runner to work with.\n */\n protected getQueryRunner(queryRunner: QueryRunner|undefined): QueryRunner {\n if (queryRunner)\n return queryRunner;\n\n return this.connection.createQueryRunner();\n }\n\n}\n"],"sourceRoot":".."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/cache/DbQueryResultCache.ts"],"names":[],"mappings":";AAEA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAC,KAAK,EAAC,MAAM,+BAA+B,CAAC;AAIpD;;GAEG;AACH;IAYI,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,4BAAsB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAEhC,IAAA,MAAM,GAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAe,OAA5C,CAA6C;QAC3D,IAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC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BAAqB,CAAC;6BAChC,MAAM,CAAC,cAAc,CAAC;6BACtB,OAAO,EAAE,EAAA;;wBALd,SAKc,CAAC;;;6BAGf,uBAAuB,EAAvB,wBAAuB;wBACvB,qBAAM,WAAW,CAAC,OAAO,EAAE,EAAA;;wBAA3B,SAA2B,CAAC;;;;;;KAEnC;IAED;;OAEG;IACG,kCAAK,GAAX,UAAY,WAAwB;;;gBAChC,sBAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAC;;;KAClF;IAED;;OAEG;IACG,mCAAM,GAAZ,UAAa,WAAqB,EAAE,WAAyB;;;;;4BACzD,qBAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,UAAA,UAAU;4BACxC,IAAM,EAAE,GAAG,KAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;4BACzE,OAAO,EAAE,CAAC,MAAM,EAAE;iCACb,IAAI,CAAC,KAAI,CAAC,qBAAqB,CAAC;iCAChC,KAAK,CAAI,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,mBAAgB,EAAE,EAAC,UAAU,YAAA,EAAC,CAAC;iCAC/D,OAAO,EAAE,CAAC;wBACnB,CAAC,CAAC,CAAC,EAAA;;wBANH,SAMG,CAAC;;;;;KACP;IAED,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAE5E;;OAEG;IACO,2CAAc,GAAxB,UAAyB,WAAkC;QACvD,IAAI,WAAW;YACX,OAAO,WAAW,CAAC;QAEvB,OAAO,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;IAC/C,CAAC;IAEL,yBAAC;AAAD,CA5OA,AA4OC,IAAA","file":"DbQueryResultCache.js","sourcesContent":["import {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {Connection} from \"../connection/Connection\";\nimport {OracleDriver} from \"../driver/oracle/OracleDriver\";\nimport {MssqlParameter} from \"../driver/sqlserver/MssqlParameter\";\nimport {SqlServerDriver} from \"../driver/sqlserver/SqlServerDriver\";\nimport {QueryRunner} from \"../query-runner/QueryRunner\";\nimport {Table} from \"../schema-builder/table/Table\";\nimport {QueryResultCache} from \"./QueryResultCache\";\nimport {QueryResultCacheOptions} from \"./QueryResultCacheOptions\";\n\n/**\n * Caches query result into current database, into separate table called \"query-result-cache\".\n */\nexport class DbQueryResultCache implements QueryResultCache {\n\n // -------------------------------------------------------------------------\n // Private properties\n // -------------------------------------------------------------------------\n\n private queryResultCacheTable: string;\n\n private queryResultCacheDatabase?: string;\n\n private queryResultCacheSchema?: string;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(protected connection: Connection) {\n\n const { schema } = (this.connection.driver.options as any);\n const database = this.connection.driver.database;\n const cacheOptions = typeof this.connection.options.cache === \"object\" ? this.connection.options.cache : {};\n const cacheTableName = cacheOptions.tableName || \"query-result-cache\";\n\n this.queryResultCacheDatabase = database;\n this.queryResultCacheSchema = schema;\n this.queryResultCacheTable = this.connection.driver.buildTableName(cacheTableName, schema, database);\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates a connection with given cache provider.\n */\n async connect(): Promise<void> {\n }\n\n /**\n * Disconnects with given cache provider.\n */\n async disconnect(): Promise<void> {\n }\n\n /**\n * Creates table for storing cache if it does not exist yet.\n */\n async synchronize(queryRunner?: QueryRunner): Promise<void> {\n queryRunner = this.getQueryRunner(queryRunner);\n const driver = this.connection.driver;\n const tableExist = await queryRunner.hasTable(this.queryResultCacheTable); // todo: table name should be configurable\n if (tableExist)\n return;\n\n await queryRunner.createTable(new Table(\n {\n database: this.queryResultCacheDatabase,\n schema: this.queryResultCacheSchema,\n name: this.queryResultCacheTable,\n columns: [\n {\n name: \"id\",\n isPrimary: true,\n isNullable: false,\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheId}),\n generationStrategy: \"increment\",\n isGenerated: true\n },\n {\n name: \"identifier\",\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheIdentifier}),\n isNullable: true\n },\n {\n name: \"time\",\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheTime}),\n isPrimary: false,\n isNullable: false\n },\n {\n name: \"duration\",\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheDuration}),\n isPrimary: false,\n isNullable: false\n },\n {\n name: \"query\",\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheQuery}),\n isPrimary: false,\n isNullable: false\n },\n {\n name: \"result\",\n type: driver.normalizeType({type: driver.mappedDataTypes.cacheResult}),\n isNullable: false\n },\n ]\n },\n ));\n }\n\n /**\n * Caches given query result.\n * Returns cache result if found.\n * Returns undefined if result is not cached.\n */\n getFromCache(options: QueryResultCacheOptions, queryRunner?: QueryRunner): Promise<QueryResultCacheOptions|undefined> {\n queryRunner = this.getQueryRunner(queryRunner);\n const qb = this.connection\n .createQueryBuilder(queryRunner)\n .select()\n .from(this.queryResultCacheTable, \"cache\");\n\n if (options.identifier) {\n return qb\n .where(`${qb.escape(\"cache\")}.${qb.escape(\"identifier\")} = :identifier`)\n .setParameters({ identifier: this.connection.driver instanceof SqlServerDriver ? new MssqlParameter(options.identifier, \"nvarchar\") : options.identifier })\n .getRawOne();\n\n } else if (options.query) {\n if (this.connection.driver instanceof OracleDriver) {\n return qb\n .where(`dbms_lob.compare(${qb.escape(\"cache\")}.${qb.escape(\"query\")}, :query) = 0`, { query: options.query })\n .getRawOne();\n }\n\n return qb\n .where(`${qb.escape(\"cache\")}.${qb.escape(\"query\")} = :query`)\n .setParameters({ query: this.connection.driver instanceof SqlServerDriver ? new MssqlParameter(options.query, \"nvarchar\") : options.query })\n .getRawOne();\n }\n\n return Promise.resolve(undefined);\n }\n\n /**\n * Checks if cache is expired or not.\n */\n isExpired(savedCache: QueryResultCacheOptions): boolean {\n const duration = typeof savedCache.duration === \"string\" ? parseInt(savedCache.duration) : savedCache.duration;\n return ((typeof savedCache.time === \"string\" ? parseInt(savedCache.time as any) : savedCache.time)! + duration) < new Date().getTime();\n }\n\n /**\n * Stores given query result in the cache.\n */\n async storeInCache(options: QueryResultCacheOptions, savedCache: QueryResultCacheOptions|undefined, queryRunner?: QueryRunner): Promise<void> {\n const shouldCreateQueryRunner = queryRunner === undefined || queryRunner?.getReplicationMode() === \"slave\";\n\n if (queryRunner === undefined || shouldCreateQueryRunner) {\n queryRunner = this.connection.createQueryRunner(\"master\");\n }\n\n let insertedValues: ObjectLiteral = options;\n if (this.connection.driver instanceof SqlServerDriver) { // todo: bad abstraction, re-implement this part, probably better if we create an entity metadata for cache table\n insertedValues = {\n identifier: new MssqlParameter(options.identifier, \"nvarchar\"),\n time: new MssqlParameter(options.time, \"bigint\"),\n duration: new MssqlParameter(options.duration, \"int\"),\n query: new MssqlParameter(options.query, \"nvarchar\"),\n result: new MssqlParameter(options.result, \"nvarchar\"),\n };\n }\n\n if (savedCache && savedCache.identifier) { // if exist then update\n const qb = queryRunner.manager\n .createQueryBuilder()\n .update(this.queryResultCacheTable)\n .set(insertedValues);\n\n qb.where(`${qb.escape(\"identifier\")} = :condition`, { condition: insertedValues.identifier });\n await qb.execute();\n\n } else if (savedCache && savedCache.query) { // if exist then update\n const qb = queryRunner.manager\n .createQueryBuilder()\n .update(this.queryResultCacheTable)\n .set(insertedValues);\n\n if (this.connection.driver instanceof OracleDriver) {\n qb.where(`dbms_lob.compare(\"query\", :condition) = 0`, { condition: insertedValues.query });\n\n } else {\n qb.where(`${qb.escape(\"query\")} = :condition`, { condition: insertedValues.query });\n }\n\n await qb.execute();\n\n } else { // otherwise insert\n await queryRunner.manager\n .createQueryBuilder()\n .insert()\n .into(this.queryResultCacheTable)\n .values(insertedValues)\n .execute();\n }\n\n if (shouldCreateQueryRunner) {\n await queryRunner.release();\n }\n }\n\n /**\n * Clears everything stored in the cache.\n */\n async clear(queryRunner: QueryRunner): Promise<void> {\n return this.getQueryRunner(queryRunner).clearTable(this.queryResultCacheTable);\n }\n\n /**\n * Removes all cached results by given identifiers from cache.\n */\n async remove(identifiers: string[], queryRunner?: QueryRunner): Promise<void> {\n await Promise.all(identifiers.map(identifier => {\n const qb = this.getQueryRunner(queryRunner).manager.createQueryBuilder();\n return qb.delete()\n .from(this.queryResultCacheTable)\n .where(`${qb.escape(\"identifier\")} = :identifier`, {identifier})\n .execute();\n }));\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Gets a query runner to work with.\n */\n protected getQueryRunner(queryRunner: QueryRunner|undefined): QueryRunner {\n if (queryRunner)\n return queryRunner;\n\n return this.connection.createQueryRunner();\n }\n\n}\n"],"sourceRoot":".."}
|
|
@@ -15,6 +15,7 @@ import { TableUnique } from "../../schema-builder/table/TableUnique";
|
|
|
15
15
|
import { Broadcaster } from "../../subscriber/Broadcaster";
|
|
16
16
|
import { TableCheck } from "../../schema-builder/table/TableCheck";
|
|
17
17
|
import { TableExclusion } from "../../schema-builder/table/TableExclusion";
|
|
18
|
+
import { ReplicationMode } from "../types/ReplicationMode";
|
|
18
19
|
/**
|
|
19
20
|
* Runs queries on a single MongoDB connection.
|
|
20
21
|
*/
|
|
@@ -316,6 +317,7 @@ export declare class MongoQueryRunner implements QueryRunner {
|
|
|
316
317
|
* Loads all views (with given names) from the database and creates a Table from them.
|
|
317
318
|
*/
|
|
318
319
|
getViews(collectionNames: string[]): Promise<View[]>;
|
|
320
|
+
getReplicationMode(): ReplicationMode;
|
|
319
321
|
/**
|
|
320
322
|
* Checks if database with the given name exist.
|
|
321
323
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/driver/mongodb/MongoQueryRunner.ts"],"names":[],"mappings":";AA6CA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH;IAuDI,4EAA4E;IAC5E,cAAc;IACd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AAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;IACjF,CAAC;IAED;;OAEG;IACH,yCAAc,GAAd;QACI,MAAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;IACjF,CAAC;IAED;;OAEG;IACH,uCAAY,GAAZ;QACI,MAAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;IACjF,CAAC;IAED;;OAEG;IACG,6CAAkB,GAAxB;;;gBACI,MAAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;;;KAChF;IAED;;OAEG;IACG,+CAAoB,GAA1B;;;gBACI,MAAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;;;KAChF;IAED,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAE5E;;OAEG;IACO,wCAAa,GAAvB,UAAwB,cAAsB;QAC1C,OAAO,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAS,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IACnG,CAAC;IAEL,uBAAC;AAAD,CAt0BA,AAs0BC,IAAA","file":"MongoQueryRunner.js","sourcesContent":["import {QueryRunner} from \"../../query-runner/QueryRunner\";\nimport {ObjectLiteral} from \"../../common/ObjectLiteral\";\nimport {TableColumn} from \"../../schema-builder/table/TableColumn\";\nimport {Table} from \"../../schema-builder/table/Table\";\nimport {TableForeignKey} from \"../../schema-builder/table/TableForeignKey\";\nimport {TableIndex} from \"../../schema-builder/table/TableIndex\";\nimport {View} from \"../../schema-builder/view/View\";\nimport {\n AggregationCursor,\n BulkWriteOpResultObject,\n ChangeStream,\n ChangeStreamOptions,\n Code,\n Collection,\n CollectionAggregationOptions,\n CollectionBulkWriteOptions,\n CollectionInsertManyOptions,\n CollectionInsertOneOptions,\n CollectionOptions,\n CollStats,\n CommandCursor,\n Cursor,\n DeleteWriteOpResultObject,\n FindAndModifyWriteOpResultObject,\n FindOneAndReplaceOption,\n GeoHaystackSearchOptions,\n GeoNearOptions,\n InsertOneWriteOpResult,\n InsertWriteOpResult,\n MapReduceOptions,\n MongoClient,\n MongoCountPreferences,\n MongodbIndexOptions,\n OrderedBulkOperation,\n ParallelCollectionScanOptions,\n ReadPreference,\n ReplaceOneOptions,\n UnorderedBulkOperation,\n UpdateWriteOpResult\n} from \"./typings\";\nimport {Connection} from \"../../connection/Connection\";\nimport {ReadStream} from \"../../platform/PlatformTools\";\nimport {MongoEntityManager} from \"../../entity-manager/MongoEntityManager\";\nimport {SqlInMemory} from \"../SqlInMemory\";\nimport {TableUnique} from \"../../schema-builder/table/TableUnique\";\nimport {Broadcaster} from \"../../subscriber/Broadcaster\";\nimport {TableCheck} from \"../../schema-builder/table/TableCheck\";\nimport {TableExclusion} from \"../../schema-builder/table/TableExclusion\";\nimport { TypeORMError } from \"../../error\";\n\n/**\n * Runs queries on a single MongoDB connection.\n */\nexport class MongoQueryRunner implements QueryRunner {\n\n // -------------------------------------------------------------------------\n // Public Implemented Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection used by this query runner.\n */\n connection: Connection;\n\n /**\n * Broadcaster used on this query runner to broadcast entity events.\n */\n broadcaster: Broadcaster;\n\n /**\n * Entity manager working only with current query runner.\n */\n manager: MongoEntityManager;\n\n /**\n * Indicates if connection for this query runner is released.\n * Once its released, query runner cannot run queries anymore.\n * Always false for mongodb since mongodb has a single query executor instance.\n */\n isReleased = false;\n\n /**\n * Indicates if transaction is active in this query executor.\n * Always false for mongodb since mongodb does not support transactions.\n */\n isTransactionActive = false;\n\n /**\n * Stores temporarily user data.\n * Useful for sharing data with subscribers.\n */\n data = {};\n\n /**\n * All synchronized tables in the database.\n */\n loadedTables: Table[];\n\n /**\n * All synchronized views in the database.\n */\n loadedViews: View[];\n\n /**\n * Real database connection from a connection pool used to perform queries.\n */\n databaseConnection: MongoClient;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(connection: Connection, databaseConnection: MongoClient) {\n this.connection = connection;\n this.databaseConnection = databaseConnection;\n this.broadcaster = new Broadcaster(this);\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates a cursor for a query that can be used to iterate over results from MongoDB.\n */\n cursor(collectionName: string, query?: ObjectLiteral): Cursor<any> {\n return this.getCollection(collectionName).find(query || {});\n }\n\n /**\n * Execute an aggregation framework pipeline against the collection.\n */\n aggregate(collectionName: string, pipeline: ObjectLiteral[], options?: CollectionAggregationOptions): AggregationCursor<any> {\n return this.getCollection(collectionName).aggregate(pipeline, options);\n }\n\n /**\n * Perform a bulkWrite operation without a fluent API.\n */\n async bulkWrite(collectionName: string, operations: ObjectLiteral[], options?: CollectionBulkWriteOptions): Promise<BulkWriteOpResultObject> {\n return await this.getCollection(collectionName).bulkWrite(operations, options);\n }\n\n /**\n * Count number of matching documents in the db to a query.\n */\n async count(collectionName: string, query?: ObjectLiteral, options?: MongoCountPreferences): Promise<any> {\n return await this.getCollection(collectionName).countDocuments(query || {}, options);\n }\n\n /**\n * Creates an index on the db and collection.\n */\n async createCollectionIndex(collectionName: string, fieldOrSpec: string | any, options?: MongodbIndexOptions): Promise<string> {\n return await this.getCollection(collectionName).createIndex(fieldOrSpec, options);\n }\n\n /**\n * Creates multiple indexes in the collection, this method is only supported for MongoDB 2.6 or higher.\n * Earlier version of MongoDB will throw a command not supported error. Index specifications are defined at http://docs.mongodb.org/manual/reference/command/createIndexes/.\n */\n async createCollectionIndexes(collectionName: string, indexSpecs: ObjectLiteral[]): Promise<void> {\n return await this.getCollection(collectionName).createIndexes(indexSpecs);\n }\n\n /**\n * Delete multiple documents on MongoDB.\n */\n async deleteMany(collectionName: string, query: ObjectLiteral, options?: CollectionOptions): Promise<DeleteWriteOpResultObject> {\n return await this.getCollection(collectionName).deleteMany(query, options);\n }\n\n /**\n * Delete a document on MongoDB.\n */\n async deleteOne(collectionName: string, query: ObjectLiteral, options?: CollectionOptions): Promise<DeleteWriteOpResultObject> {\n return await this.getCollection(collectionName).deleteOne(query, options);\n }\n\n /**\n * The distinct command returns returns a list of distinct values for the given key across a collection.\n */\n async distinct(collectionName: string, key: string, query: ObjectLiteral, options?: { readPreference?: ReadPreference | string }): Promise<any> {\n return await this.getCollection(collectionName).distinct(key, query, options);\n }\n\n /**\n * Drops an index from this collection.\n */\n async dropCollectionIndex(collectionName: string, indexName: string, options?: CollectionOptions): Promise<any> {\n return await this.getCollection(collectionName).dropIndex(indexName, options);\n }\n\n /**\n * Drops all indexes from the collection.\n */\n async dropCollectionIndexes(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).dropIndexes();\n }\n\n /**\n * Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.\n */\n async findOneAndDelete(collectionName: string, query: ObjectLiteral, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise<FindAndModifyWriteOpResultObject> {\n return await this.getCollection(collectionName).findOneAndDelete(query, options);\n }\n\n /**\n * Find a document and replace it in one atomic operation, requires a write lock for the duration of the operation.\n */\n async findOneAndReplace(collectionName: string, query: ObjectLiteral, replacement: Object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject> {\n return await this.getCollection(collectionName).findOneAndReplace(query, replacement, options);\n }\n\n /**\n * Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.\n */\n async findOneAndUpdate(collectionName: string, query: ObjectLiteral, update: Object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject> {\n return await this.getCollection(collectionName).findOneAndUpdate(query, update, options);\n }\n\n /**\n * Execute a geo search using a geo haystack index on a collection.\n */\n async geoHaystackSearch(collectionName: string, x: number, y: number, options?: GeoHaystackSearchOptions): Promise<any> {\n return await this.getCollection(collectionName).geoHaystackSearch(x, y, options);\n }\n\n /**\n * Execute the geoNear command to search for items in the collection.\n */\n async geoNear(collectionName: string, x: number, y: number, options?: GeoNearOptions): Promise<any> {\n return await this.getCollection(collectionName).geoNear(x, y, options);\n }\n\n /**\n * Run a group command across a collection.\n */\n async group(collectionName: string, keys: Object | Array<any> | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, options?: { readPreference?: ReadPreference | string }): Promise<any> {\n return await this.getCollection(collectionName).group(keys, condition, initial, reduce, finalize, command, options);\n }\n\n /**\n * Retrieve all the indexes on the collection.\n */\n async collectionIndexes(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).indexes();\n }\n\n /**\n * Retrieve all the indexes on the collection.\n */\n async collectionIndexExists(collectionName: string, indexes: string | string[]): Promise<boolean> {\n return await this.getCollection(collectionName).indexExists(indexes);\n }\n\n /**\n * Retrieves this collections index info.\n */\n async collectionIndexInformation(collectionName: string, options?: { full: boolean }): Promise<any> {\n return await this.getCollection(collectionName).indexInformation(options);\n }\n\n /**\n * Initiate an In order bulk write operation, operations will be serially executed in the order they are added, creating a new operation for each switch in types.\n */\n initializeOrderedBulkOp(collectionName: string, options?: CollectionOptions): OrderedBulkOperation {\n return this.getCollection(collectionName).initializeOrderedBulkOp(options);\n }\n\n /**\n * Initiate a Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.\n */\n initializeUnorderedBulkOp(collectionName: string, options?: CollectionOptions): UnorderedBulkOperation {\n return this.getCollection(collectionName).initializeUnorderedBulkOp(options);\n }\n\n /**\n * Inserts an array of documents into MongoDB.\n */\n async insertMany(collectionName: string, docs: ObjectLiteral[], options?: CollectionInsertManyOptions): Promise<InsertWriteOpResult> {\n return await this.getCollection(collectionName).insertMany(docs, options);\n }\n\n /**\n * Inserts a single document into MongoDB.\n */\n async insertOne(collectionName: string, doc: ObjectLiteral, options?: CollectionInsertOneOptions): Promise<InsertOneWriteOpResult> {\n return await this.getCollection(collectionName).insertOne(doc, options);\n }\n\n /**\n * Returns if the collection is a capped collection.\n */\n async isCapped(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).isCapped();\n }\n\n /**\n * Get the list of all indexes information for the collection.\n */\n listCollectionIndexes(collectionName: string, options?: { batchSize?: number, readPreference?: ReadPreference | string }): CommandCursor {\n return this.getCollection(collectionName).listIndexes(options);\n }\n\n /**\n * Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.\n */\n async mapReduce(collectionName: string, map: Function | string, reduce: Function | string, options?: MapReduceOptions): Promise<any> {\n return await this.getCollection(collectionName).mapReduce(map, reduce, options);\n }\n\n /**\n * Return N number of parallel cursors for a collection allowing parallel reading of entire collection.\n * There are no ordering guarantees for returned results.\n */\n async parallelCollectionScan(collectionName: string, options?: ParallelCollectionScanOptions): Promise<Cursor<any>[]> {\n return await this.getCollection(collectionName).parallelCollectionScan(options);\n }\n\n /**\n * Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.\n */\n async reIndex(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).reIndex();\n }\n\n /**\n * Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.\n */\n async rename(collectionName: string, newName: string, options?: { dropTarget?: boolean }): Promise<Collection<any>> {\n return await this.getCollection(collectionName).rename(newName, options);\n }\n\n /**\n * Replace a document on MongoDB.\n */\n async replaceOne(collectionName: string, query: ObjectLiteral, doc: ObjectLiteral, options?: ReplaceOneOptions): Promise<UpdateWriteOpResult> {\n return await this.getCollection(collectionName).replaceOne(query, doc, options);\n }\n\n /**\n * Get all the collection statistics.\n */\n async stats(collectionName: string, options?: { scale: number }): Promise<CollStats> {\n return await this.getCollection(collectionName).stats(options);\n }\n\n /**\n * Watching new changes as stream.\n */\n watch(collectionName: string, pipeline?: Object[], options?: ChangeStreamOptions): ChangeStream {\n return this.getCollection(collectionName).watch(pipeline, options);\n }\n\n /**\n * Update multiple documents on MongoDB.\n */\n async updateMany(collectionName: string, query: ObjectLiteral, update: ObjectLiteral, options?: { upsert?: boolean, w?: any, wtimeout?: number, j?: boolean }): Promise<UpdateWriteOpResult> {\n return await this.getCollection(collectionName).updateMany(query, update, options);\n }\n\n /**\n * Update a single document on MongoDB.\n */\n async updateOne(collectionName: string, query: ObjectLiteral, update: ObjectLiteral, options?: ReplaceOneOptions): Promise<UpdateWriteOpResult> {\n return await this.getCollection(collectionName).updateOne(query, update, options);\n }\n\n // -------------------------------------------------------------------------\n // Public Implemented Methods (from QueryRunner)\n // -------------------------------------------------------------------------\n\n /**\n * Removes all collections from the currently connected database.\n * Be careful with using this method and avoid using it in production or migrations\n * (because it can clear all your database).\n */\n async clearDatabase(): Promise<void> {\n await this.databaseConnection.db(this.connection.driver.database!).dropDatabase();\n }\n\n /**\n * For MongoDB database we don't create connection, because its single connection already created by a driver.\n */\n async connect(): Promise<any> {\n }\n\n /**\n * For MongoDB database we don't release connection, because its single connection.\n */\n async release(): Promise<void> {\n // releasing connection are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Starts transaction.\n */\n async startTransaction(): Promise<void> {\n // transactions are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Commits transaction.\n */\n async commitTransaction(): Promise<void> {\n // transactions are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Rollbacks transaction.\n */\n async rollbackTransaction(): Promise<void> {\n // transactions are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Executes a given SQL query.\n */\n query(query: string, parameters?: any[]): Promise<any> {\n throw new TypeORMError(`Executing SQL query is not supported by MongoDB driver.`);\n }\n\n /**\n * Returns raw data stream.\n */\n stream(query: string, parameters?: any[], onEnd?: Function, onError?: Function): Promise<ReadStream> {\n throw new TypeORMError(`Stream is not supported by MongoDB driver. Use watch instead.`);\n }\n\n /**\n * Insert a new row with given values into the given table.\n * Returns value of inserted object id.\n\n async insert(collectionName: string, keyValues: ObjectLiteral): Promise<any> { // todo: fix any\n const results = await this.databaseConnection\n .collection(collectionName)\n .insertOne(keyValues);\n const generatedMap = this.connection.getMetadata(collectionName).objectIdColumn!.createValueMap(results.insertedId);\n return {\n result: results,\n generatedMap: generatedMap\n };\n }*/\n\n /**\n * Updates rows that match given conditions in the given table.\n\n async update(collectionName: string, valuesMap: ObjectLiteral, conditions: ObjectLiteral): Promise<any> { // todo: fix any\n await this.databaseConnection\n .collection(collectionName)\n .updateOne(conditions, valuesMap);\n }*/\n\n /**\n * Deletes from the given table by a given conditions.\n\n async delete(collectionName: string, conditions: ObjectLiteral|ObjectLiteral[]|string, maybeParameters?: any[]): Promise<any> { // todo: fix any\n if (typeof conditions === \"string\")\n throw new TypeORMError(`String condition is not supported by MongoDB driver.`);\n\n await this.databaseConnection\n .collection(collectionName)\n .deleteOne(conditions);\n }*/\n\n /**\n * Returns all available database names including system databases.\n */\n async getDatabases(): Promise<string[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Returns all available schema names including system schemas.\n * If database parameter specified, returns schemas of that database.\n */\n async getSchemas(database?: string): Promise<string[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads given table's data from the database.\n */\n async getTable(collectionName: string): Promise<Table | undefined> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads all tables (with given names) from the database and creates a Table from them.\n */\n async getTables(collectionNames: string[]): Promise<Table[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads given views's data from the database.\n */\n async getView(collectionName: string): Promise<View | undefined> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads all views (with given names) from the database and creates a Table from them.\n */\n async getViews(collectionNames: string[]): Promise<View[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if database with the given name exist.\n */\n async hasDatabase(database: string): Promise<boolean> {\n throw new TypeORMError(`Check database queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads currently using database\n */\n async getCurrentDatabase(): Promise<undefined> {\n throw new TypeORMError(`Check database queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if schema with the given name exist.\n */\n async hasSchema(schema: string): Promise<boolean> {\n throw new TypeORMError(`Check schema queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads currently using database schema\n */\n async getCurrentSchema(): Promise<undefined> {\n throw new TypeORMError(`Check schema queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if table with the given name exist in the database.\n */\n async hasTable(collectionName: string): Promise<boolean> {\n throw new TypeORMError(`Check schema queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if column with the given name exist in the given table.\n */\n async hasColumn(tableOrName: Table | string, columnName: string): Promise<boolean> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a database if it's not created.\n */\n async createDatabase(database: string): Promise<void> {\n throw new TypeORMError(`Database create queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops database.\n */\n async dropDatabase(database: string, ifExist?: boolean): Promise<void> {\n throw new TypeORMError(`Database drop queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new table schema.\n */\n async createSchema(schemaPath: string, ifNotExist?: boolean): Promise<void> {\n throw new TypeORMError(`Schema create queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops table schema.\n */\n async dropSchema(schemaPath: string, ifExist?: boolean): Promise<void> {\n throw new TypeORMError(`Schema drop queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new table from the given table and columns inside it.\n */\n async createTable(table: Table): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops the table.\n */\n async dropTable(tableName: Table | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new view.\n */\n async createView(view: View): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops the view.\n */\n async dropView(target: View|string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Renames the given table.\n */\n async renameTable(oldTableOrName: Table | string, newTableOrName: Table | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new column from the column in the table.\n */\n async addColumn(tableOrName: Table | string, column: TableColumn): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new columns from the column in the table.\n */\n async addColumns(tableOrName: Table | string, columns: TableColumn[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Renames column in the given table.\n */\n async renameColumn(tableOrName: Table | string, oldTableColumnOrName: TableColumn | string, newTableColumnOrName: TableColumn | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Changes a column in the table.\n */\n async changeColumn(tableOrName: Table | string, oldTableColumnOrName: TableColumn | string, newColumn: TableColumn): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Changes a column in the table.\n */\n async changeColumns(tableOrName: Table | string, changedColumns: { newColumn: TableColumn, oldColumn: TableColumn }[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops column in the table.\n */\n async dropColumn(tableOrName: Table | string, columnOrName: TableColumn | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops the columns in the table.\n */\n async dropColumns(tableOrName: Table | string, columns: TableColumn[] | string[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new primary key.\n */\n async createPrimaryKey(tableOrName: Table | string, columnNames: string[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Updates composite primary keys.\n */\n async updatePrimaryKeys(tableOrName: Table | string, columns: TableColumn[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops a primary key.\n */\n async dropPrimaryKey(tableOrName: Table | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new unique constraint.\n */\n async createUniqueConstraint(tableOrName: Table | string, uniqueConstraint: TableUnique): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new unique constraints.\n */\n async createUniqueConstraints(tableOrName: Table | string, uniqueConstraints: TableUnique[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an unique constraint.\n */\n async dropUniqueConstraint(tableOrName: Table | string, uniqueOrName: TableUnique | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an unique constraints.\n */\n async dropUniqueConstraints(tableOrName: Table | string, uniqueConstraints: TableUnique[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new check constraint.\n */\n async createCheckConstraint(tableOrName: Table | string, checkConstraint: TableCheck): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new check constraints.\n */\n async createCheckConstraints(tableOrName: Table | string, checkConstraints: TableCheck[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops check constraint.\n */\n async dropCheckConstraint(tableOrName: Table | string, checkOrName: TableCheck | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops check constraints.\n */\n async dropCheckConstraints(tableOrName: Table | string, checkConstraints: TableCheck[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new exclusion constraint.\n */\n async createExclusionConstraint(tableOrName: Table | string, exclusionConstraint: TableExclusion): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new exclusion constraints.\n */\n async createExclusionConstraints(tableOrName: Table | string, exclusionConstraints: TableExclusion[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops exclusion constraint.\n */\n async dropExclusionConstraint(tableOrName: Table | string, exclusionOrName: TableExclusion | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops exclusion constraints.\n */\n async dropExclusionConstraints(tableOrName: Table | string, exclusionConstraints: TableExclusion[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new foreign key.\n */\n async createForeignKey(tableOrName: Table | string, foreignKey: TableForeignKey): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new foreign keys.\n */\n async createForeignKeys(tableOrName: Table | string, foreignKeys: TableForeignKey[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops a foreign key from the table.\n */\n async dropForeignKey(tableOrName: Table | string, foreignKey: TableForeignKey): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops a foreign keys from the table.\n */\n async dropForeignKeys(tableOrName: Table | string, foreignKeys: TableForeignKey[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new index.\n */\n async createIndex(tableOrName: Table | string, index: TableIndex): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new indices\n */\n async createIndices(tableOrName: Table | string, indices: TableIndex[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an index from the table.\n */\n async dropIndex(collectionName: string, indexName: string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an indices from the table.\n */\n async dropIndices(tableOrName: Table | string, indices: TableIndex[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops collection.\n */\n async clearTable(collectionName: string): Promise<void> {\n await this.databaseConnection\n .db(this.connection.driver.database!)\n .dropCollection(collectionName);\n }\n\n /**\n * Enables special query runner mode in which sql queries won't be executed,\n * instead they will be memorized into a special variable inside query runner.\n * You can get memorized sql using getMemorySql() method.\n */\n enableSqlMemory(): void {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Disables special query runner mode in which sql queries won't be executed\n * started by calling enableSqlMemory() method.\n *\n * Previously memorized sql will be flushed.\n */\n disableSqlMemory(): void {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Flushes all memorized sqls.\n */\n clearSqlMemory(): void {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Gets sql stored in the memory. Parameters in the sql are already replaced.\n */\n getMemorySql(): SqlInMemory {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Executes up sql queries.\n */\n async executeMemoryUpSql(): Promise<void> {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Executes down sql queries.\n */\n async executeMemoryDownSql(): Promise<void> {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Gets collection from the database with a given name.\n */\n protected getCollection(collectionName: string): Collection<any> {\n return this.databaseConnection.db(this.connection.driver.database!).collection(collectionName);\n }\n\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/driver/mongodb/MongoQueryRunner.ts"],"names":[],"mappings":";AA6CA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAGzD,OAAO,EAAC,YAAY,EAAC,MAAM,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ACH,0CAAe,GAAf;QACI,MAAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;IACjF,CAAC;IAED;;;;;OAKG;IACH,2CAAgB,GAAhB;QACI,MAAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;IACjF,CAAC;IAED;;OAEG;IACH,yCAAc,GAAd;QACI,MAAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;IACjF,CAAC;IAED;;OAEG;IACH,uCAAY,GAAZ;QACI,MAAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;IACjF,CAAC;IAED;;OAEG;IACG,6CAAkB,GAAxB;;;gBACI,MAAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;;;KAChF;IAED;;OAEG;IACG,+CAAoB,GAA1B;;;gBACI,MAAM,IAAI,YAAY,CAAC,oDAAoD,CAAC,CAAC;;;KAChF;IAED,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAE5E;;OAEG;IACO,wCAAa,GAAvB,UAAwB,cAAsB;QAC1C,OAAO,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAS,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IACnG,CAAC;IAEL,uBAAC;AAAD,CA10BA,AA00BC,IAAA","file":"MongoQueryRunner.js","sourcesContent":["import {QueryRunner} from \"../../query-runner/QueryRunner\";\nimport {ObjectLiteral} from \"../../common/ObjectLiteral\";\nimport {TableColumn} from \"../../schema-builder/table/TableColumn\";\nimport {Table} from \"../../schema-builder/table/Table\";\nimport {TableForeignKey} from \"../../schema-builder/table/TableForeignKey\";\nimport {TableIndex} from \"../../schema-builder/table/TableIndex\";\nimport {View} from \"../../schema-builder/view/View\";\nimport {\n AggregationCursor,\n BulkWriteOpResultObject,\n ChangeStream,\n ChangeStreamOptions,\n Code,\n Collection,\n CollectionAggregationOptions,\n CollectionBulkWriteOptions,\n CollectionInsertManyOptions,\n CollectionInsertOneOptions,\n CollectionOptions,\n CollStats,\n CommandCursor,\n Cursor,\n DeleteWriteOpResultObject,\n FindAndModifyWriteOpResultObject,\n FindOneAndReplaceOption,\n GeoHaystackSearchOptions,\n GeoNearOptions,\n InsertOneWriteOpResult,\n InsertWriteOpResult,\n MapReduceOptions,\n MongoClient,\n MongoCountPreferences,\n MongodbIndexOptions,\n OrderedBulkOperation,\n ParallelCollectionScanOptions,\n ReadPreference,\n ReplaceOneOptions,\n UnorderedBulkOperation,\n UpdateWriteOpResult\n} from \"./typings\";\nimport {Connection} from \"../../connection/Connection\";\nimport {ReadStream} from \"../../platform/PlatformTools\";\nimport {MongoEntityManager} from \"../../entity-manager/MongoEntityManager\";\nimport {SqlInMemory} from \"../SqlInMemory\";\nimport {TableUnique} from \"../../schema-builder/table/TableUnique\";\nimport {Broadcaster} from \"../../subscriber/Broadcaster\";\nimport {TableCheck} from \"../../schema-builder/table/TableCheck\";\nimport {TableExclusion} from \"../../schema-builder/table/TableExclusion\";\nimport {TypeORMError} from \"../../error\";\nimport {ReplicationMode} from \"../types/ReplicationMode\";\n \n/**\n * Runs queries on a single MongoDB connection.\n */\nexport class MongoQueryRunner implements QueryRunner {\n\n // -------------------------------------------------------------------------\n // Public Implemented Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection used by this query runner.\n */\n connection: Connection;\n\n /**\n * Broadcaster used on this query runner to broadcast entity events.\n */\n broadcaster: Broadcaster;\n\n /**\n * Entity manager working only with current query runner.\n */\n manager: MongoEntityManager;\n\n /**\n * Indicates if connection for this query runner is released.\n * Once its released, query runner cannot run queries anymore.\n * Always false for mongodb since mongodb has a single query executor instance.\n */\n isReleased = false;\n\n /**\n * Indicates if transaction is active in this query executor.\n * Always false for mongodb since mongodb does not support transactions.\n */\n isTransactionActive = false;\n\n /**\n * Stores temporarily user data.\n * Useful for sharing data with subscribers.\n */\n data = {};\n\n /**\n * All synchronized tables in the database.\n */\n loadedTables: Table[];\n\n /**\n * All synchronized views in the database.\n */\n loadedViews: View[];\n\n /**\n * Real database connection from a connection pool used to perform queries.\n */\n databaseConnection: MongoClient;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(connection: Connection, databaseConnection: MongoClient) {\n this.connection = connection;\n this.databaseConnection = databaseConnection;\n this.broadcaster = new Broadcaster(this);\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates a cursor for a query that can be used to iterate over results from MongoDB.\n */\n cursor(collectionName: string, query?: ObjectLiteral): Cursor<any> {\n return this.getCollection(collectionName).find(query || {});\n }\n\n /**\n * Execute an aggregation framework pipeline against the collection.\n */\n aggregate(collectionName: string, pipeline: ObjectLiteral[], options?: CollectionAggregationOptions): AggregationCursor<any> {\n return this.getCollection(collectionName).aggregate(pipeline, options);\n }\n\n /**\n * Perform a bulkWrite operation without a fluent API.\n */\n async bulkWrite(collectionName: string, operations: ObjectLiteral[], options?: CollectionBulkWriteOptions): Promise<BulkWriteOpResultObject> {\n return await this.getCollection(collectionName).bulkWrite(operations, options);\n }\n\n /**\n * Count number of matching documents in the db to a query.\n */\n async count(collectionName: string, query?: ObjectLiteral, options?: MongoCountPreferences): Promise<any> {\n return await this.getCollection(collectionName).countDocuments(query || {}, options);\n }\n\n /**\n * Creates an index on the db and collection.\n */\n async createCollectionIndex(collectionName: string, fieldOrSpec: string | any, options?: MongodbIndexOptions): Promise<string> {\n return await this.getCollection(collectionName).createIndex(fieldOrSpec, options);\n }\n\n /**\n * Creates multiple indexes in the collection, this method is only supported for MongoDB 2.6 or higher.\n * Earlier version of MongoDB will throw a command not supported error. Index specifications are defined at http://docs.mongodb.org/manual/reference/command/createIndexes/.\n */\n async createCollectionIndexes(collectionName: string, indexSpecs: ObjectLiteral[]): Promise<void> {\n return await this.getCollection(collectionName).createIndexes(indexSpecs);\n }\n\n /**\n * Delete multiple documents on MongoDB.\n */\n async deleteMany(collectionName: string, query: ObjectLiteral, options?: CollectionOptions): Promise<DeleteWriteOpResultObject> {\n return await this.getCollection(collectionName).deleteMany(query, options);\n }\n\n /**\n * Delete a document on MongoDB.\n */\n async deleteOne(collectionName: string, query: ObjectLiteral, options?: CollectionOptions): Promise<DeleteWriteOpResultObject> {\n return await this.getCollection(collectionName).deleteOne(query, options);\n }\n\n /**\n * The distinct command returns returns a list of distinct values for the given key across a collection.\n */\n async distinct(collectionName: string, key: string, query: ObjectLiteral, options?: { readPreference?: ReadPreference | string }): Promise<any> {\n return await this.getCollection(collectionName).distinct(key, query, options);\n }\n\n /**\n * Drops an index from this collection.\n */\n async dropCollectionIndex(collectionName: string, indexName: string, options?: CollectionOptions): Promise<any> {\n return await this.getCollection(collectionName).dropIndex(indexName, options);\n }\n\n /**\n * Drops all indexes from the collection.\n */\n async dropCollectionIndexes(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).dropIndexes();\n }\n\n /**\n * Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.\n */\n async findOneAndDelete(collectionName: string, query: ObjectLiteral, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise<FindAndModifyWriteOpResultObject> {\n return await this.getCollection(collectionName).findOneAndDelete(query, options);\n }\n\n /**\n * Find a document and replace it in one atomic operation, requires a write lock for the duration of the operation.\n */\n async findOneAndReplace(collectionName: string, query: ObjectLiteral, replacement: Object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject> {\n return await this.getCollection(collectionName).findOneAndReplace(query, replacement, options);\n }\n\n /**\n * Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.\n */\n async findOneAndUpdate(collectionName: string, query: ObjectLiteral, update: Object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject> {\n return await this.getCollection(collectionName).findOneAndUpdate(query, update, options);\n }\n\n /**\n * Execute a geo search using a geo haystack index on a collection.\n */\n async geoHaystackSearch(collectionName: string, x: number, y: number, options?: GeoHaystackSearchOptions): Promise<any> {\n return await this.getCollection(collectionName).geoHaystackSearch(x, y, options);\n }\n\n /**\n * Execute the geoNear command to search for items in the collection.\n */\n async geoNear(collectionName: string, x: number, y: number, options?: GeoNearOptions): Promise<any> {\n return await this.getCollection(collectionName).geoNear(x, y, options);\n }\n\n /**\n * Run a group command across a collection.\n */\n async group(collectionName: string, keys: Object | Array<any> | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, options?: { readPreference?: ReadPreference | string }): Promise<any> {\n return await this.getCollection(collectionName).group(keys, condition, initial, reduce, finalize, command, options);\n }\n\n /**\n * Retrieve all the indexes on the collection.\n */\n async collectionIndexes(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).indexes();\n }\n\n /**\n * Retrieve all the indexes on the collection.\n */\n async collectionIndexExists(collectionName: string, indexes: string | string[]): Promise<boolean> {\n return await this.getCollection(collectionName).indexExists(indexes);\n }\n\n /**\n * Retrieves this collections index info.\n */\n async collectionIndexInformation(collectionName: string, options?: { full: boolean }): Promise<any> {\n return await this.getCollection(collectionName).indexInformation(options);\n }\n\n /**\n * Initiate an In order bulk write operation, operations will be serially executed in the order they are added, creating a new operation for each switch in types.\n */\n initializeOrderedBulkOp(collectionName: string, options?: CollectionOptions): OrderedBulkOperation {\n return this.getCollection(collectionName).initializeOrderedBulkOp(options);\n }\n\n /**\n * Initiate a Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.\n */\n initializeUnorderedBulkOp(collectionName: string, options?: CollectionOptions): UnorderedBulkOperation {\n return this.getCollection(collectionName).initializeUnorderedBulkOp(options);\n }\n\n /**\n * Inserts an array of documents into MongoDB.\n */\n async insertMany(collectionName: string, docs: ObjectLiteral[], options?: CollectionInsertManyOptions): Promise<InsertWriteOpResult> {\n return await this.getCollection(collectionName).insertMany(docs, options);\n }\n\n /**\n * Inserts a single document into MongoDB.\n */\n async insertOne(collectionName: string, doc: ObjectLiteral, options?: CollectionInsertOneOptions): Promise<InsertOneWriteOpResult> {\n return await this.getCollection(collectionName).insertOne(doc, options);\n }\n\n /**\n * Returns if the collection is a capped collection.\n */\n async isCapped(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).isCapped();\n }\n\n /**\n * Get the list of all indexes information for the collection.\n */\n listCollectionIndexes(collectionName: string, options?: { batchSize?: number, readPreference?: ReadPreference | string }): CommandCursor {\n return this.getCollection(collectionName).listIndexes(options);\n }\n\n /**\n * Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.\n */\n async mapReduce(collectionName: string, map: Function | string, reduce: Function | string, options?: MapReduceOptions): Promise<any> {\n return await this.getCollection(collectionName).mapReduce(map, reduce, options);\n }\n\n /**\n * Return N number of parallel cursors for a collection allowing parallel reading of entire collection.\n * There are no ordering guarantees for returned results.\n */\n async parallelCollectionScan(collectionName: string, options?: ParallelCollectionScanOptions): Promise<Cursor<any>[]> {\n return await this.getCollection(collectionName).parallelCollectionScan(options);\n }\n\n /**\n * Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.\n */\n async reIndex(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).reIndex();\n }\n\n /**\n * Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.\n */\n async rename(collectionName: string, newName: string, options?: { dropTarget?: boolean }): Promise<Collection<any>> {\n return await this.getCollection(collectionName).rename(newName, options);\n }\n\n /**\n * Replace a document on MongoDB.\n */\n async replaceOne(collectionName: string, query: ObjectLiteral, doc: ObjectLiteral, options?: ReplaceOneOptions): Promise<UpdateWriteOpResult> {\n return await this.getCollection(collectionName).replaceOne(query, doc, options);\n }\n\n /**\n * Get all the collection statistics.\n */\n async stats(collectionName: string, options?: { scale: number }): Promise<CollStats> {\n return await this.getCollection(collectionName).stats(options);\n }\n\n /**\n * Watching new changes as stream.\n */\n watch(collectionName: string, pipeline?: Object[], options?: ChangeStreamOptions): ChangeStream {\n return this.getCollection(collectionName).watch(pipeline, options);\n }\n\n /**\n * Update multiple documents on MongoDB.\n */\n async updateMany(collectionName: string, query: ObjectLiteral, update: ObjectLiteral, options?: { upsert?: boolean, w?: any, wtimeout?: number, j?: boolean }): Promise<UpdateWriteOpResult> {\n return await this.getCollection(collectionName).updateMany(query, update, options);\n }\n\n /**\n * Update a single document on MongoDB.\n */\n async updateOne(collectionName: string, query: ObjectLiteral, update: ObjectLiteral, options?: ReplaceOneOptions): Promise<UpdateWriteOpResult> {\n return await this.getCollection(collectionName).updateOne(query, update, options);\n }\n\n // -------------------------------------------------------------------------\n // Public Implemented Methods (from QueryRunner)\n // -------------------------------------------------------------------------\n\n /**\n * Removes all collections from the currently connected database.\n * Be careful with using this method and avoid using it in production or migrations\n * (because it can clear all your database).\n */\n async clearDatabase(): Promise<void> {\n await this.databaseConnection.db(this.connection.driver.database!).dropDatabase();\n }\n\n /**\n * For MongoDB database we don't create connection, because its single connection already created by a driver.\n */\n async connect(): Promise<any> {\n }\n\n /**\n * For MongoDB database we don't release connection, because its single connection.\n */\n async release(): Promise<void> {\n // releasing connection are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Starts transaction.\n */\n async startTransaction(): Promise<void> {\n // transactions are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Commits transaction.\n */\n async commitTransaction(): Promise<void> {\n // transactions are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Rollbacks transaction.\n */\n async rollbackTransaction(): Promise<void> {\n // transactions are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Executes a given SQL query.\n */\n query(query: string, parameters?: any[]): Promise<any> {\n throw new TypeORMError(`Executing SQL query is not supported by MongoDB driver.`);\n }\n\n /**\n * Returns raw data stream.\n */\n stream(query: string, parameters?: any[], onEnd?: Function, onError?: Function): Promise<ReadStream> {\n throw new TypeORMError(`Stream is not supported by MongoDB driver. Use watch instead.`);\n }\n\n /**\n * Insert a new row with given values into the given table.\n * Returns value of inserted object id.\n\n async insert(collectionName: string, keyValues: ObjectLiteral): Promise<any> { // todo: fix any\n const results = await this.databaseConnection\n .collection(collectionName)\n .insertOne(keyValues);\n const generatedMap = this.connection.getMetadata(collectionName).objectIdColumn!.createValueMap(results.insertedId);\n return {\n result: results,\n generatedMap: generatedMap\n };\n }*/\n\n /**\n * Updates rows that match given conditions in the given table.\n\n async update(collectionName: string, valuesMap: ObjectLiteral, conditions: ObjectLiteral): Promise<any> { // todo: fix any\n await this.databaseConnection\n .collection(collectionName)\n .updateOne(conditions, valuesMap);\n }*/\n\n /**\n * Deletes from the given table by a given conditions.\n\n async delete(collectionName: string, conditions: ObjectLiteral|ObjectLiteral[]|string, maybeParameters?: any[]): Promise<any> { // todo: fix any\n if (typeof conditions === \"string\")\n throw new TypeORMError(`String condition is not supported by MongoDB driver.`);\n\n await this.databaseConnection\n .collection(collectionName)\n .deleteOne(conditions);\n }*/\n\n /**\n * Returns all available database names including system databases.\n */\n async getDatabases(): Promise<string[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Returns all available schema names including system schemas.\n * If database parameter specified, returns schemas of that database.\n */\n async getSchemas(database?: string): Promise<string[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads given table's data from the database.\n */\n async getTable(collectionName: string): Promise<Table | undefined> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads all tables (with given names) from the database and creates a Table from them.\n */\n async getTables(collectionNames: string[]): Promise<Table[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads given views's data from the database.\n */\n async getView(collectionName: string): Promise<View | undefined> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads all views (with given names) from the database and creates a Table from them.\n */\n async getViews(collectionNames: string[]): Promise<View[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n getReplicationMode(): ReplicationMode {\n return 'master';\n }\n\n /**\n * Checks if database with the given name exist.\n */\n async hasDatabase(database: string): Promise<boolean> {\n throw new TypeORMError(`Check database queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads currently using database\n */\n async getCurrentDatabase(): Promise<undefined> {\n throw new TypeORMError(`Check database queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if schema with the given name exist.\n */\n async hasSchema(schema: string): Promise<boolean> {\n throw new TypeORMError(`Check schema queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads currently using database schema\n */\n async getCurrentSchema(): Promise<undefined> {\n throw new TypeORMError(`Check schema queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if table with the given name exist in the database.\n */\n async hasTable(collectionName: string): Promise<boolean> {\n throw new TypeORMError(`Check schema queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if column with the given name exist in the given table.\n */\n async hasColumn(tableOrName: Table | string, columnName: string): Promise<boolean> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a database if it's not created.\n */\n async createDatabase(database: string): Promise<void> {\n throw new TypeORMError(`Database create queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops database.\n */\n async dropDatabase(database: string, ifExist?: boolean): Promise<void> {\n throw new TypeORMError(`Database drop queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new table schema.\n */\n async createSchema(schemaPath: string, ifNotExist?: boolean): Promise<void> {\n throw new TypeORMError(`Schema create queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops table schema.\n */\n async dropSchema(schemaPath: string, ifExist?: boolean): Promise<void> {\n throw new TypeORMError(`Schema drop queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new table from the given table and columns inside it.\n */\n async createTable(table: Table): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops the table.\n */\n async dropTable(tableName: Table | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new view.\n */\n async createView(view: View): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops the view.\n */\n async dropView(target: View|string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Renames the given table.\n */\n async renameTable(oldTableOrName: Table | string, newTableOrName: Table | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new column from the column in the table.\n */\n async addColumn(tableOrName: Table | string, column: TableColumn): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new columns from the column in the table.\n */\n async addColumns(tableOrName: Table | string, columns: TableColumn[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Renames column in the given table.\n */\n async renameColumn(tableOrName: Table | string, oldTableColumnOrName: TableColumn | string, newTableColumnOrName: TableColumn | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Changes a column in the table.\n */\n async changeColumn(tableOrName: Table | string, oldTableColumnOrName: TableColumn | string, newColumn: TableColumn): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Changes a column in the table.\n */\n async changeColumns(tableOrName: Table | string, changedColumns: { newColumn: TableColumn, oldColumn: TableColumn }[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops column in the table.\n */\n async dropColumn(tableOrName: Table | string, columnOrName: TableColumn | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops the columns in the table.\n */\n async dropColumns(tableOrName: Table | string, columns: TableColumn[] | string[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new primary key.\n */\n async createPrimaryKey(tableOrName: Table | string, columnNames: string[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Updates composite primary keys.\n */\n async updatePrimaryKeys(tableOrName: Table | string, columns: TableColumn[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops a primary key.\n */\n async dropPrimaryKey(tableOrName: Table | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new unique constraint.\n */\n async createUniqueConstraint(tableOrName: Table | string, uniqueConstraint: TableUnique): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new unique constraints.\n */\n async createUniqueConstraints(tableOrName: Table | string, uniqueConstraints: TableUnique[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an unique constraint.\n */\n async dropUniqueConstraint(tableOrName: Table | string, uniqueOrName: TableUnique | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an unique constraints.\n */\n async dropUniqueConstraints(tableOrName: Table | string, uniqueConstraints: TableUnique[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new check constraint.\n */\n async createCheckConstraint(tableOrName: Table | string, checkConstraint: TableCheck): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new check constraints.\n */\n async createCheckConstraints(tableOrName: Table | string, checkConstraints: TableCheck[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops check constraint.\n */\n async dropCheckConstraint(tableOrName: Table | string, checkOrName: TableCheck | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops check constraints.\n */\n async dropCheckConstraints(tableOrName: Table | string, checkConstraints: TableCheck[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new exclusion constraint.\n */\n async createExclusionConstraint(tableOrName: Table | string, exclusionConstraint: TableExclusion): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new exclusion constraints.\n */\n async createExclusionConstraints(tableOrName: Table | string, exclusionConstraints: TableExclusion[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops exclusion constraint.\n */\n async dropExclusionConstraint(tableOrName: Table | string, exclusionOrName: TableExclusion | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops exclusion constraints.\n */\n async dropExclusionConstraints(tableOrName: Table | string, exclusionConstraints: TableExclusion[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new foreign key.\n */\n async createForeignKey(tableOrName: Table | string, foreignKey: TableForeignKey): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new foreign keys.\n */\n async createForeignKeys(tableOrName: Table | string, foreignKeys: TableForeignKey[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops a foreign key from the table.\n */\n async dropForeignKey(tableOrName: Table | string, foreignKey: TableForeignKey): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops a foreign keys from the table.\n */\n async dropForeignKeys(tableOrName: Table | string, foreignKeys: TableForeignKey[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new index.\n */\n async createIndex(tableOrName: Table | string, index: TableIndex): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new indices\n */\n async createIndices(tableOrName: Table | string, indices: TableIndex[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an index from the table.\n */\n async dropIndex(collectionName: string, indexName: string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an indices from the table.\n */\n async dropIndices(tableOrName: Table | string, indices: TableIndex[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops collection.\n */\n async clearTable(collectionName: string): Promise<void> {\n await this.databaseConnection\n .db(this.connection.driver.database!)\n .dropCollection(collectionName);\n }\n\n /**\n * Enables special query runner mode in which sql queries won't be executed,\n * instead they will be memorized into a special variable inside query runner.\n * You can get memorized sql using getMemorySql() method.\n */\n enableSqlMemory(): void {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Disables special query runner mode in which sql queries won't be executed\n * started by calling enableSqlMemory() method.\n *\n * Previously memorized sql will be flushed.\n */\n disableSqlMemory(): void {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Flushes all memorized sqls.\n */\n clearSqlMemory(): void {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Gets sql stored in the memory. Parameters in the sql are already replaced.\n */\n getMemorySql(): SqlInMemory {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Executes up sql queries.\n */\n async executeMemoryUpSql(): Promise<void> {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Executes down sql queries.\n */\n async executeMemoryDownSql(): Promise<void> {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Gets collection from the database with a given name.\n */\n protected getCollection(collectionName: string): Collection<any> {\n return this.databaseConnection.db(this.connection.driver.database!).collection(collectionName);\n }\n\n}\n"],"sourceRoot":"../.."}
|
package/browser/index.d.ts
CHANGED
|
@@ -99,6 +99,14 @@ export * from "./schema-builder/table/TableForeignKey";
|
|
|
99
99
|
export * from "./schema-builder/table/TableIndex";
|
|
100
100
|
export * from "./schema-builder/table/TableUnique";
|
|
101
101
|
export * from "./schema-builder/table/Table";
|
|
102
|
+
export * from "./schema-builder/options/TableCheckOptions";
|
|
103
|
+
export * from "./schema-builder/options/TableColumnOptions";
|
|
104
|
+
export * from "./schema-builder/options/TableExclusionOptions";
|
|
105
|
+
export * from "./schema-builder/options/TableForeignKeyOptions";
|
|
106
|
+
export * from "./schema-builder/options/TableIndexOptions";
|
|
107
|
+
export * from "./schema-builder/options/TableOptions";
|
|
108
|
+
export * from "./schema-builder/options/TableUniqueOptions";
|
|
109
|
+
export * from "./schema-builder/options/ViewOptions";
|
|
102
110
|
export * from "./driver/mongodb/typings";
|
|
103
111
|
export * from "./driver/types/DatabaseType";
|
|
104
112
|
export * from "./driver/types/ReplicationMode";
|
package/browser/index.js
CHANGED
|
@@ -102,6 +102,14 @@ export * from "./schema-builder/table/TableForeignKey";
|
|
|
102
102
|
export * from "./schema-builder/table/TableIndex";
|
|
103
103
|
export * from "./schema-builder/table/TableUnique";
|
|
104
104
|
export * from "./schema-builder/table/Table";
|
|
105
|
+
export * from "./schema-builder/options/TableCheckOptions";
|
|
106
|
+
export * from "./schema-builder/options/TableColumnOptions";
|
|
107
|
+
export * from "./schema-builder/options/TableExclusionOptions";
|
|
108
|
+
export * from "./schema-builder/options/TableForeignKeyOptions";
|
|
109
|
+
export * from "./schema-builder/options/TableIndexOptions";
|
|
110
|
+
export * from "./schema-builder/options/TableOptions";
|
|
111
|
+
export * from "./schema-builder/options/TableUniqueOptions";
|
|
112
|
+
export * from "./schema-builder/options/ViewOptions";
|
|
105
113
|
export * from "./driver/mongodb/typings";
|
|
106
114
|
export * from "./driver/types/DatabaseType";
|
|
107
115
|
export * from "./driver/types/ReplicationMode";
|
package/browser/index.js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AO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AAY9E,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC","file":"index.js","sourcesContent":["/*!\n */\nimport \"reflect-metadata\";\n\n// -------------------------------------------------------------------------\n// Commonly Used exports\n// -------------------------------------------------------------------------\n\nexport * from \"./globals\";\nexport * from \"./container\";\nexport * from \"./common/EntityTarget\";\nexport * from \"./common/ObjectType\";\nexport * from \"./common/ObjectLiteral\";\nexport * from \"./common/DeepPartial\";\nexport * from \"./error\";\nexport * from \"./decorator/columns/Column\";\nexport * from \"./decorator/columns/CreateDateColumn\";\nexport * from \"./decorator/columns/DeleteDateColumn\";\nexport * from \"./decorator/columns/PrimaryGeneratedColumn\";\nexport * from \"./decorator/columns/PrimaryColumn\";\nexport * from \"./decorator/columns/UpdateDateColumn\";\nexport * from \"./decorator/columns/VersionColumn\";\nexport * from \"./decorator/columns/ViewColumn\";\nexport * from \"./decorator/columns/ObjectIdColumn\";\nexport * from \"./decorator/listeners/AfterInsert\";\nexport * from \"./decorator/listeners/AfterLoad\";\nexport * from \"./decorator/listeners/AfterRemove\";\nexport * from \"./decorator/listeners/AfterUpdate\";\nexport * from \"./decorator/listeners/BeforeInsert\";\nexport * from \"./decorator/listeners/BeforeRemove\";\nexport * from \"./decorator/listeners/BeforeUpdate\";\nexport * from \"./decorator/listeners/EventSubscriber\";\nexport * from \"./decorator/options/ColumnOptions\";\nexport * from \"./decorator/options/IndexOptions\";\nexport * from \"./decorator/options/JoinColumnOptions\";\nexport * from \"./decorator/options/JoinTableOptions\";\nexport * from \"./decorator/options/RelationOptions\";\nexport * from \"./decorator/options/EntityOptions\";\nexport * from \"./decorator/options/ValueTransformer\";\nexport * from \"./decorator/relations/JoinColumn\";\nexport * from \"./decorator/relations/JoinTable\";\nexport * from \"./decorator/relations/ManyToMany\";\nexport * from \"./decorator/relations/ManyToOne\";\nexport * from \"./decorator/relations/OneToMany\";\nexport * from \"./decorator/relations/OneToOne\";\nexport * from \"./decorator/relations/RelationCount\";\nexport * from \"./decorator/relations/RelationId\";\nexport * from \"./decorator/entity/Entity\";\nexport * from \"./decorator/entity/ChildEntity\";\nexport * from \"./decorator/entity/TableInheritance\";\nexport * from \"./decorator/entity-view/ViewEntity\";\nexport * from \"./decorator/transaction/Transaction\";\nexport * from \"./decorator/transaction/TransactionManager\";\nexport * from \"./decorator/transaction/TransactionRepository\";\nexport * from \"./decorator/tree/TreeLevelColumn\";\nexport * from \"./decorator/tree/TreeParent\";\nexport * from \"./decorator/tree/TreeChildren\";\nexport * from \"./decorator/tree/Tree\";\nexport * from \"./decorator/Index\";\nexport * from \"./decorator/Unique\";\nexport * from \"./decorator/Check\";\nexport * from \"./decorator/Exclusion\";\nexport * from \"./decorator/Generated\";\nexport * from \"./decorator/EntityRepository\";\nexport * from \"./find-options/operator/Any\";\nexport * from \"./find-options/operator/Between\";\nexport * from \"./find-options/operator/Equal\";\nexport * from \"./find-options/operator/In\";\nexport * from \"./find-options/operator/IsNull\";\nexport * from \"./find-options/operator/LessThan\";\nexport * from \"./find-options/operator/LessThanOrEqual\";\nexport * from \"./find-options/operator/ILike\";\nexport * from \"./find-options/operator/Like\";\nexport * from \"./find-options/operator/MoreThan\";\nexport * from \"./find-options/operator/MoreThanOrEqual\";\nexport * from \"./find-options/operator/Not\";\nexport * from \"./find-options/operator/Raw\";\nexport * from \"./find-options/FindConditions\";\nexport * from \"./find-options/FindManyOptions\";\nexport * from \"./find-options/FindOneOptions\";\nexport * from \"./find-options/FindOperator\";\nexport * from \"./find-options/FindOperatorType\";\nexport * from \"./find-options/JoinOptions\";\nexport * from \"./find-options/OrderByCondition\";\nexport * from \"./find-options/FindOptionsUtils\";\nexport * from \"./logger/Logger\";\nexport * from \"./logger/LoggerOptions\";\nexport * from \"./logger/AdvancedConsoleLogger\";\nexport * from \"./logger/SimpleConsoleLogger\";\nexport * from \"./logger/FileLogger\";\nexport * from \"./metadata/EntityMetadata\";\nexport * from \"./entity-manager/EntityManager\";\nexport * from \"./repository/AbstractRepository\";\nexport * from \"./repository/Repository\";\nexport * from \"./repository/BaseEntity\";\nexport * from \"./repository/TreeRepository\";\nexport * from \"./repository/MongoRepository\";\nexport * from \"./repository/RemoveOptions\";\nexport * from \"./repository/SaveOptions\";\nexport * from \"./schema-builder/table/TableCheck\";\nexport * from \"./schema-builder/table/TableColumn\";\nexport * from \"./schema-builder/table/TableExclusion\";\nexport * from \"./schema-builder/table/TableForeignKey\";\nexport * from \"./schema-builder/table/TableIndex\";\nexport * from \"./schema-builder/table/TableUnique\";\nexport * from \"./schema-builder/table/Table\";\nexport * from \"./driver/mongodb/typings\";\nexport * from \"./driver/types/DatabaseType\";\nexport * from \"./driver/types/ReplicationMode\";\nexport * from \"./driver/sqlserver/MssqlParameter\";\n\nexport {ConnectionOptionsReader} from \"./connection/ConnectionOptionsReader\";\nexport {Connection} from \"./connection/Connection\";\nexport {ConnectionManager} from \"./connection/ConnectionManager\";\nexport {ConnectionOptions} from \"./connection/ConnectionOptions\";\nexport {Driver} from \"./driver/Driver\";\nexport {QueryBuilder} from \"./query-builder/QueryBuilder\";\nexport {SelectQueryBuilder} from \"./query-builder/SelectQueryBuilder\";\nexport {DeleteQueryBuilder} from \"./query-builder/DeleteQueryBuilder\";\nexport {InsertQueryBuilder} from \"./query-builder/InsertQueryBuilder\";\nexport {UpdateQueryBuilder} from \"./query-builder/UpdateQueryBuilder\";\nexport {RelationQueryBuilder} from \"./query-builder/RelationQueryBuilder\";\nexport {Brackets} from \"./query-builder/Brackets\";\nexport {WhereExpressionBuilder} from \"./query-builder/WhereExpressionBuilder\";\nexport {WhereExpression} from \"./query-builder/WhereExpressionBuilder\";\nexport {InsertResult} from \"./query-builder/result/InsertResult\";\nexport {UpdateResult} from \"./query-builder/result/UpdateResult\";\nexport {DeleteResult} from \"./query-builder/result/DeleteResult\";\nexport {QueryResult} from \"./query-runner/QueryResult\";\nexport {QueryRunner} from \"./query-runner/QueryRunner\";\nexport {MongoEntityManager} from \"./entity-manager/MongoEntityManager\";\nexport {Migration} from \"./migration/Migration\";\nexport {MigrationExecutor} from \"./migration/MigrationExecutor\";\nexport {MigrationInterface} from \"./migration/MigrationInterface\";\nexport {DefaultNamingStrategy} from \"./naming-strategy/DefaultNamingStrategy\";\nexport {NamingStrategyInterface} from \"./naming-strategy/NamingStrategyInterface\";\nexport {FindOneOptions} from \"./find-options/FindOneOptions\";\nexport {FindManyOptions} from \"./find-options/FindManyOptions\";\nexport {InsertEvent} from \"./subscriber/event/InsertEvent\";\nexport {LoadEvent} from \"./subscriber/event/LoadEvent\";\nexport {UpdateEvent} from \"./subscriber/event/UpdateEvent\";\nexport {RemoveEvent} from \"./subscriber/event/RemoveEvent\";\nexport {TransactionCommitEvent} from \"./subscriber/event/TransactionCommitEvent\";\nexport {TransactionRollbackEvent} from \"./subscriber/event/TransactionRollbackEvent\";\nexport {TransactionStartEvent} from \"./subscriber/event/TransactionStartEvent\";\nexport {EntitySubscriberInterface} from \"./subscriber/EntitySubscriberInterface\";\nexport {EntitySchema} from \"./entity-schema/EntitySchema\";\nexport {EntitySchemaColumnOptions} from \"./entity-schema/EntitySchemaColumnOptions\";\nexport {EntitySchemaIndexOptions} from \"./entity-schema/EntitySchemaIndexOptions\";\nexport {EntitySchemaRelationOptions} from \"./entity-schema/EntitySchemaRelationOptions\";\nexport {ColumnType} from \"./driver/types/ColumnTypes\";\n"],"sourceRoot":"."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/index.ts"],"names":[],"mappings":"AAAA;GACG;AACH,OAAO,kBAAkB,CAAC;AAE1B,4EAA4E;AAC5E,wBAAwB;AACxB,4EAA4E;AAE5E,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,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C,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AAY9E,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC","file":"index.js","sourcesContent":["/*!\n */\nimport \"reflect-metadata\";\n\n// -------------------------------------------------------------------------\n// Commonly Used exports\n// -------------------------------------------------------------------------\n\nexport * from \"./globals\";\nexport * from \"./container\";\nexport * from \"./common/EntityTarget\";\nexport * from \"./common/ObjectType\";\nexport * from \"./common/ObjectLiteral\";\nexport * from \"./common/DeepPartial\";\nexport * from \"./error\";\nexport * from \"./decorator/columns/Column\";\nexport * from \"./decorator/columns/CreateDateColumn\";\nexport * from \"./decorator/columns/DeleteDateColumn\";\nexport * from \"./decorator/columns/PrimaryGeneratedColumn\";\nexport * from \"./decorator/columns/PrimaryColumn\";\nexport * from \"./decorator/columns/UpdateDateColumn\";\nexport * from \"./decorator/columns/VersionColumn\";\nexport * from \"./decorator/columns/ViewColumn\";\nexport * from \"./decorator/columns/ObjectIdColumn\";\nexport * from \"./decorator/listeners/AfterInsert\";\nexport * from \"./decorator/listeners/AfterLoad\";\nexport * from \"./decorator/listeners/AfterRemove\";\nexport * from \"./decorator/listeners/AfterUpdate\";\nexport * from \"./decorator/listeners/BeforeInsert\";\nexport * from \"./decorator/listeners/BeforeRemove\";\nexport * from \"./decorator/listeners/BeforeUpdate\";\nexport * from \"./decorator/listeners/EventSubscriber\";\nexport * from \"./decorator/options/ColumnOptions\";\nexport * from \"./decorator/options/IndexOptions\";\nexport * from \"./decorator/options/JoinColumnOptions\";\nexport * from \"./decorator/options/JoinTableOptions\";\nexport * from \"./decorator/options/RelationOptions\";\nexport * from \"./decorator/options/EntityOptions\";\nexport * from \"./decorator/options/ValueTransformer\";\nexport * from \"./decorator/relations/JoinColumn\";\nexport * from \"./decorator/relations/JoinTable\";\nexport * from \"./decorator/relations/ManyToMany\";\nexport * from \"./decorator/relations/ManyToOne\";\nexport * from \"./decorator/relations/OneToMany\";\nexport * from \"./decorator/relations/OneToOne\";\nexport * from \"./decorator/relations/RelationCount\";\nexport * from \"./decorator/relations/RelationId\";\nexport * from \"./decorator/entity/Entity\";\nexport * from \"./decorator/entity/ChildEntity\";\nexport * from \"./decorator/entity/TableInheritance\";\nexport * from \"./decorator/entity-view/ViewEntity\";\nexport * from \"./decorator/transaction/Transaction\";\nexport * from \"./decorator/transaction/TransactionManager\";\nexport * from \"./decorator/transaction/TransactionRepository\";\nexport * from \"./decorator/tree/TreeLevelColumn\";\nexport * from \"./decorator/tree/TreeParent\";\nexport * from \"./decorator/tree/TreeChildren\";\nexport * from \"./decorator/tree/Tree\";\nexport * from \"./decorator/Index\";\nexport * from \"./decorator/Unique\";\nexport * from \"./decorator/Check\";\nexport * from \"./decorator/Exclusion\";\nexport * from \"./decorator/Generated\";\nexport * from \"./decorator/EntityRepository\";\nexport * from \"./find-options/operator/Any\";\nexport * from \"./find-options/operator/Between\";\nexport * from \"./find-options/operator/Equal\";\nexport * from \"./find-options/operator/In\";\nexport * from \"./find-options/operator/IsNull\";\nexport * from \"./find-options/operator/LessThan\";\nexport * from \"./find-options/operator/LessThanOrEqual\";\nexport * from \"./find-options/operator/ILike\";\nexport * from \"./find-options/operator/Like\";\nexport * from \"./find-options/operator/MoreThan\";\nexport * from \"./find-options/operator/MoreThanOrEqual\";\nexport * from \"./find-options/operator/Not\";\nexport * from \"./find-options/operator/Raw\";\nexport * from \"./find-options/FindConditions\";\nexport * from \"./find-options/FindManyOptions\";\nexport * from \"./find-options/FindOneOptions\";\nexport * from \"./find-options/FindOperator\";\nexport * from \"./find-options/FindOperatorType\";\nexport * from \"./find-options/JoinOptions\";\nexport * from \"./find-options/OrderByCondition\";\nexport * from \"./find-options/FindOptionsUtils\";\nexport * from \"./logger/Logger\";\nexport * from \"./logger/LoggerOptions\";\nexport * from \"./logger/AdvancedConsoleLogger\";\nexport * from \"./logger/SimpleConsoleLogger\";\nexport * from \"./logger/FileLogger\";\nexport * from \"./metadata/EntityMetadata\";\nexport * from \"./entity-manager/EntityManager\";\nexport * from \"./repository/AbstractRepository\";\nexport * from \"./repository/Repository\";\nexport * from \"./repository/BaseEntity\";\nexport * from \"./repository/TreeRepository\";\nexport * from \"./repository/MongoRepository\";\nexport * from \"./repository/RemoveOptions\";\nexport * from \"./repository/SaveOptions\";\nexport * from \"./schema-builder/table/TableCheck\";\nexport * from \"./schema-builder/table/TableColumn\";\nexport * from \"./schema-builder/table/TableExclusion\";\nexport * from \"./schema-builder/table/TableForeignKey\";\nexport * from \"./schema-builder/table/TableIndex\";\nexport * from \"./schema-builder/table/TableUnique\";\nexport * from \"./schema-builder/table/Table\";\nexport * from \"./schema-builder/options/TableCheckOptions\";\nexport * from \"./schema-builder/options/TableColumnOptions\";\nexport * from \"./schema-builder/options/TableExclusionOptions\";\nexport * from \"./schema-builder/options/TableForeignKeyOptions\";\nexport * from \"./schema-builder/options/TableIndexOptions\";\nexport * from \"./schema-builder/options/TableOptions\";\nexport * from \"./schema-builder/options/TableUniqueOptions\";\nexport * from \"./schema-builder/options/ViewOptions\";\nexport * from \"./driver/mongodb/typings\";\nexport * from \"./driver/types/DatabaseType\";\nexport * from \"./driver/types/ReplicationMode\";\nexport * from \"./driver/sqlserver/MssqlParameter\";\n\nexport {ConnectionOptionsReader} from \"./connection/ConnectionOptionsReader\";\nexport {Connection} from \"./connection/Connection\";\nexport {ConnectionManager} from \"./connection/ConnectionManager\";\nexport {ConnectionOptions} from \"./connection/ConnectionOptions\";\nexport {Driver} from \"./driver/Driver\";\nexport {QueryBuilder} from \"./query-builder/QueryBuilder\";\nexport {SelectQueryBuilder} from \"./query-builder/SelectQueryBuilder\";\nexport {DeleteQueryBuilder} from \"./query-builder/DeleteQueryBuilder\";\nexport {InsertQueryBuilder} from \"./query-builder/InsertQueryBuilder\";\nexport {UpdateQueryBuilder} from \"./query-builder/UpdateQueryBuilder\";\nexport {RelationQueryBuilder} from \"./query-builder/RelationQueryBuilder\";\nexport {Brackets} from \"./query-builder/Brackets\";\nexport {WhereExpressionBuilder} from \"./query-builder/WhereExpressionBuilder\";\nexport {WhereExpression} from \"./query-builder/WhereExpressionBuilder\";\nexport {InsertResult} from \"./query-builder/result/InsertResult\";\nexport {UpdateResult} from \"./query-builder/result/UpdateResult\";\nexport {DeleteResult} from \"./query-builder/result/DeleteResult\";\nexport {QueryResult} from \"./query-runner/QueryResult\";\nexport {QueryRunner} from \"./query-runner/QueryRunner\";\nexport {MongoEntityManager} from \"./entity-manager/MongoEntityManager\";\nexport {Migration} from \"./migration/Migration\";\nexport {MigrationExecutor} from \"./migration/MigrationExecutor\";\nexport {MigrationInterface} from \"./migration/MigrationInterface\";\nexport {DefaultNamingStrategy} from \"./naming-strategy/DefaultNamingStrategy\";\nexport {NamingStrategyInterface} from \"./naming-strategy/NamingStrategyInterface\";\nexport {FindOneOptions} from \"./find-options/FindOneOptions\";\nexport {FindManyOptions} from \"./find-options/FindManyOptions\";\nexport {InsertEvent} from \"./subscriber/event/InsertEvent\";\nexport {LoadEvent} from \"./subscriber/event/LoadEvent\";\nexport {UpdateEvent} from \"./subscriber/event/UpdateEvent\";\nexport {RemoveEvent} from \"./subscriber/event/RemoveEvent\";\nexport {TransactionCommitEvent} from \"./subscriber/event/TransactionCommitEvent\";\nexport {TransactionRollbackEvent} from \"./subscriber/event/TransactionRollbackEvent\";\nexport {TransactionStartEvent} from \"./subscriber/event/TransactionStartEvent\";\nexport {EntitySubscriberInterface} from \"./subscriber/EntitySubscriberInterface\";\nexport {EntitySchema} from \"./entity-schema/EntitySchema\";\nexport {EntitySchemaColumnOptions} from \"./entity-schema/EntitySchemaColumnOptions\";\nexport {EntitySchemaIndexOptions} from \"./entity-schema/EntitySchemaIndexOptions\";\nexport {EntitySchemaRelationOptions} from \"./entity-schema/EntitySchemaRelationOptions\";\nexport {ColumnType} from \"./driver/types/ColumnTypes\";\n"],"sourceRoot":"."}
|
|
@@ -851,10 +851,10 @@ var SubjectExecutor = /** @class */ (function () {
|
|
|
851
851
|
if (this.updateSubjects.length)
|
|
852
852
|
this.updateSpecialColumnsInInsertedAndUpdatedEntities(this.updateSubjects);
|
|
853
853
|
// update soft-removed entity properties
|
|
854
|
-
if (this.
|
|
854
|
+
if (this.softRemoveSubjects.length)
|
|
855
855
|
this.updateSpecialColumnsInInsertedAndUpdatedEntities(this.softRemoveSubjects);
|
|
856
856
|
// update recovered entity properties
|
|
857
|
-
if (this.
|
|
857
|
+
if (this.recoverSubjects.length)
|
|
858
858
|
this.updateSpecialColumnsInInsertedAndUpdatedEntities(this.recoverSubjects);
|
|
859
859
|
// remove ids from the entities that were removed
|
|
860
860
|
if (this.removeSubjects.length) {
|