typeorm 0.2.42-dev.600bd4e → 0.2.42-dev.8f2ae71
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/common/DeepPartial.d.ts +3 -3
- package/browser/common/DeepPartial.js.map +1 -1
- package/browser/decorator/listeners/AfterRecover.d.ts +4 -0
- package/browser/decorator/listeners/AfterRecover.js +16 -0
- package/browser/decorator/listeners/AfterRecover.js.map +1 -0
- package/browser/decorator/listeners/AfterSoftRemove.d.ts +4 -0
- package/browser/decorator/listeners/AfterSoftRemove.js +16 -0
- package/browser/decorator/listeners/AfterSoftRemove.js.map +1 -0
- package/browser/decorator/listeners/BeforeRecover.d.ts +4 -0
- package/browser/decorator/listeners/BeforeRecover.js +16 -0
- package/browser/decorator/listeners/BeforeRecover.js.map +1 -0
- package/browser/decorator/listeners/BeforeSoftRemove.d.ts +4 -0
- package/browser/decorator/listeners/BeforeSoftRemove.js +16 -0
- package/browser/decorator/listeners/BeforeSoftRemove.js.map +1 -0
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.d.ts +8 -0
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js +30 -0
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/browser/driver/capacitor/CapacitorQueryRunner.d.ts +8 -0
- package/browser/driver/capacitor/CapacitorQueryRunner.js +30 -0
- package/browser/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
- package/browser/driver/cordova/CordovaQueryRunner.d.ts +8 -0
- package/browser/driver/cordova/CordovaQueryRunner.js +30 -0
- package/browser/driver/cordova/CordovaQueryRunner.js.map +1 -1
- package/browser/driver/expo/ExpoQueryRunner.d.ts +8 -0
- package/browser/driver/expo/ExpoQueryRunner.js +30 -0
- package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/MongoQueryRunner.d.ts +8 -0
- package/browser/driver/mongodb/MongoQueryRunner.js +20 -0
- package/browser/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/browser/driver/nativescript/NativescriptQueryRunner.d.ts +8 -0
- package/browser/driver/nativescript/NativescriptQueryRunner.js +30 -0
- package/browser/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/browser/driver/react-native/ReactNativeQueryRunner.d.ts +8 -0
- package/browser/driver/react-native/ReactNativeQueryRunner.js +30 -0
- package/browser/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
- package/browser/driver/sqlite/SqliteQueryRunner.d.ts +8 -0
- package/browser/driver/sqlite/SqliteQueryRunner.js +30 -0
- package/browser/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +2 -2
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqljs/SqljsQueryRunner.d.ts +8 -0
- package/browser/driver/sqljs/SqljsQueryRunner.js +30 -0
- package/browser/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/browser/entity-manager/EntityManager.js.map +1 -1
- package/browser/entity-manager/MongoEntityManager.d.ts +2 -0
- package/browser/entity-manager/MongoEntityManager.js +35 -4
- package/browser/entity-manager/MongoEntityManager.js.map +1 -1
- package/browser/index.d.ts +4 -0
- package/browser/index.js +4 -0
- package/browser/index.js.map +1 -1
- package/browser/metadata/EntityMetadata.d.ts +16 -0
- package/browser/metadata/EntityMetadata.js +16 -0
- package/browser/metadata/EntityMetadata.js.map +1 -1
- package/browser/metadata/types/EventListenerTypes.d.ts +5 -1
- package/browser/metadata/types/EventListenerTypes.js +4 -0
- package/browser/metadata/types/EventListenerTypes.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataBuilder.js +4 -0
- package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataValidator.js +1 -1
- package/browser/metadata-builder/EntityMetadataValidator.js.map +1 -1
- package/browser/migration/MigrationExecutor.js +37 -25
- package/browser/migration/MigrationExecutor.js.map +1 -1
- package/browser/persistence/SubjectExecutor.d.ts +4 -2
- package/browser/persistence/SubjectExecutor.js +105 -13
- package/browser/persistence/SubjectExecutor.js.map +1 -1
- package/browser/persistence/tree/MaterializedPathSubjectExecutor.js +1 -1
- package/browser/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/browser/query-builder/InsertQueryBuilder.js +9 -0
- package/browser/query-builder/InsertQueryBuilder.js.map +1 -1
- package/browser/query-builder/SoftDeleteQueryBuilder.js +44 -30
- package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.d.ts +8 -0
- package/browser/query-runner/BaseQueryRunner.js +20 -0
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/query-runner/QueryRunner.d.ts +8 -0
- package/browser/query-runner/QueryRunner.js.map +1 -1
- package/browser/repository/TreeRepository.js +2 -1
- package/browser/repository/TreeRepository.js.map +1 -1
- package/browser/schema-builder/RdbmsSchemaBuilder.js +36 -30
- package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/browser/subscriber/Broadcaster.d.ts +40 -0
- package/browser/subscriber/Broadcaster.js +156 -0
- package/browser/subscriber/Broadcaster.js.map +1 -1
- package/browser/subscriber/EntitySubscriberInterface.d.ts +18 -0
- package/browser/subscriber/EntitySubscriberInterface.js.map +1 -1
- package/browser/subscriber/event/RecoverEvent.d.ts +6 -0
- package/browser/subscriber/event/RecoverEvent.js +3 -0
- package/browser/subscriber/event/RecoverEvent.js.map +1 -0
- package/browser/subscriber/event/SoftRemoveEvent.d.ts +6 -0
- package/browser/subscriber/event/SoftRemoveEvent.js +3 -0
- package/browser/subscriber/event/SoftRemoveEvent.js.map +1 -0
- package/commands/MigrationShowCommand.js +3 -4
- package/commands/MigrationShowCommand.js.map +1 -1
- package/common/DeepPartial.d.ts +3 -3
- package/common/DeepPartial.js.map +1 -1
- package/decorator/listeners/AfterRecover.d.ts +4 -0
- package/decorator/listeners/AfterRecover.js +20 -0
- package/decorator/listeners/AfterRecover.js.map +1 -0
- package/decorator/listeners/AfterSoftRemove.d.ts +4 -0
- package/decorator/listeners/AfterSoftRemove.js +20 -0
- package/decorator/listeners/AfterSoftRemove.js.map +1 -0
- package/decorator/listeners/BeforeRecover.d.ts +4 -0
- package/decorator/listeners/BeforeRecover.js +20 -0
- package/decorator/listeners/BeforeRecover.js.map +1 -0
- package/decorator/listeners/BeforeSoftRemove.d.ts +4 -0
- package/decorator/listeners/BeforeSoftRemove.js +20 -0
- package/decorator/listeners/BeforeSoftRemove.js.map +1 -0
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.d.ts +8 -0
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +30 -0
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/driver/capacitor/CapacitorQueryRunner.d.ts +8 -0
- package/driver/capacitor/CapacitorQueryRunner.js +30 -0
- package/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
- package/driver/cordova/CordovaQueryRunner.d.ts +8 -0
- package/driver/cordova/CordovaQueryRunner.js +30 -0
- package/driver/cordova/CordovaQueryRunner.js.map +1 -1
- package/driver/expo/ExpoQueryRunner.d.ts +8 -0
- package/driver/expo/ExpoQueryRunner.js +30 -0
- package/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/driver/mongodb/MongoQueryRunner.d.ts +8 -0
- package/driver/mongodb/MongoQueryRunner.js +20 -0
- package/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/driver/nativescript/NativescriptQueryRunner.d.ts +8 -0
- package/driver/nativescript/NativescriptQueryRunner.js +30 -0
- package/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/driver/react-native/ReactNativeQueryRunner.d.ts +8 -0
- package/driver/react-native/ReactNativeQueryRunner.js +30 -0
- package/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
- package/driver/sqlite/SqliteQueryRunner.d.ts +8 -0
- package/driver/sqlite/SqliteQueryRunner.js +30 -0
- package/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +2 -2
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqljs/SqljsQueryRunner.d.ts +8 -0
- package/driver/sqljs/SqljsQueryRunner.js +30 -0
- package/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-manager/MongoEntityManager.d.ts +2 -0
- package/entity-manager/MongoEntityManager.js +35 -4
- package/entity-manager/MongoEntityManager.js.map +1 -1
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/index.js.map +1 -1
- package/index.mjs +8 -0
- package/metadata/EntityMetadata.d.ts +16 -0
- package/metadata/EntityMetadata.js +16 -0
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/types/EventListenerTypes.d.ts +5 -1
- package/metadata/types/EventListenerTypes.js +4 -0
- package/metadata/types/EventListenerTypes.js.map +1 -1
- package/metadata-builder/EntityMetadataBuilder.js +4 -0
- package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/metadata-builder/EntityMetadataValidator.js +1 -1
- package/metadata-builder/EntityMetadataValidator.js.map +1 -1
- package/migration/MigrationExecutor.js +37 -25
- package/migration/MigrationExecutor.js.map +1 -1
- package/package.json +1 -1
- package/persistence/SubjectExecutor.d.ts +4 -2
- package/persistence/SubjectExecutor.js +105 -13
- package/persistence/SubjectExecutor.js.map +1 -1
- package/persistence/tree/MaterializedPathSubjectExecutor.js +1 -1
- package/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/query-builder/InsertQueryBuilder.js +9 -0
- package/query-builder/InsertQueryBuilder.js.map +1 -1
- package/query-builder/SoftDeleteQueryBuilder.js +44 -30
- package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/query-runner/BaseQueryRunner.d.ts +8 -0
- package/query-runner/BaseQueryRunner.js +20 -0
- package/query-runner/BaseQueryRunner.js.map +1 -1
- package/query-runner/QueryRunner.d.ts +8 -0
- package/query-runner/QueryRunner.js.map +1 -1
- package/repository/TreeRepository.js +2 -1
- package/repository/TreeRepository.js.map +1 -1
- package/schema-builder/RdbmsSchemaBuilder.js +36 -30
- package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/subscriber/Broadcaster.d.ts +40 -0
- package/subscriber/Broadcaster.js +156 -0
- package/subscriber/Broadcaster.js.map +1 -1
- package/subscriber/EntitySubscriberInterface.d.ts +18 -0
- package/subscriber/EntitySubscriberInterface.js.map +1 -1
- package/subscriber/event/RecoverEvent.d.ts +6 -0
- package/subscriber/event/RecoverEvent.js +4 -0
- package/subscriber/event/RecoverEvent.js.map +1 -0
- package/subscriber/event/SoftRemoveEvent.d.ts +6 -0
- package/subscriber/event/SoftRemoveEvent.js +4 -0
- package/subscriber/event/SoftRemoveEvent.js.map +1 -0
- package/typeorm-class-transformer-shim.js +20 -0
- package/typeorm-model-shim.js +20 -0
|
@@ -1 +1 @@
|
|
|
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,aAAa,CAAC;AAGzC;;GAEG;AACH;IAuDI,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,0BAAY,UAAsB,EAAE,kBAA+B;QAtCnE;;;;WAIG;QACH,eAAU,GAAG,KAAK,CAAC;QAEnB;;;WAGG;QACH,wBAAmB,GAAG,KAAK,CAAC;QAE5B;;;WAGG;QACH,SAAI,GAAG,EAAE,CAAC;QAsBN,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,4EAA4E;IAC5E,iBAAiB;IACjB,4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ED;;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":"../.."}
|
|
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,aAAa,CAAC;AAGzC;;GAEG;AACH;IAuDI,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,0BAAY,UAAsB,EAAE,kBAA+B;QAtCnE;;;;WAIG;QACH,eAAU,GAAG,KAAK,CAAC;QAEnB;;;WAGG;QACH,wBAAmB,GAAG,KAAK,CAAC;QAE5B;;;WAGG;QACH,SAAI,GAAG,EAAE,CAAC;QAsBN,IAAI,CAAC,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AEG;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,CAx1BA,AAw1BC,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 * Called before migrations are run.\n */\n async beforeMigration(): Promise<void> {\n // Do nothing\n }\n\n /**\n * Called after migrations are run.\n */\n async afterMigration(): Promise<void> {\n // Do nothing\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":"../.."}
|
|
@@ -10,6 +10,14 @@ export declare class NativescriptQueryRunner extends AbstractSqliteQueryRunner {
|
|
|
10
10
|
*/
|
|
11
11
|
driver: NativescriptDriver;
|
|
12
12
|
constructor(driver: NativescriptDriver);
|
|
13
|
+
/**
|
|
14
|
+
* Called before migrations are run.
|
|
15
|
+
*/
|
|
16
|
+
beforeMigration(): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Called after migrations are run.
|
|
19
|
+
*/
|
|
20
|
+
afterMigration(): Promise<void>;
|
|
13
21
|
/**
|
|
14
22
|
* Executes a given SQL query.
|
|
15
23
|
*/
|
|
@@ -19,6 +19,36 @@ var NativescriptQueryRunner = /** @class */ (function (_super) {
|
|
|
19
19
|
_this.broadcaster = new Broadcaster(_this);
|
|
20
20
|
return _this;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Called before migrations are run.
|
|
24
|
+
*/
|
|
25
|
+
NativescriptQueryRunner.prototype.beforeMigration = function () {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27
|
+
return __generator(this, function (_a) {
|
|
28
|
+
switch (_a.label) {
|
|
29
|
+
case 0: return [4 /*yield*/, this.query("PRAGMA foreign_keys = OFF")];
|
|
30
|
+
case 1:
|
|
31
|
+
_a.sent();
|
|
32
|
+
return [2 /*return*/];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Called after migrations are run.
|
|
39
|
+
*/
|
|
40
|
+
NativescriptQueryRunner.prototype.afterMigration = function () {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
42
|
+
return __generator(this, function (_a) {
|
|
43
|
+
switch (_a.label) {
|
|
44
|
+
case 0: return [4 /*yield*/, this.query("PRAGMA foreign_keys = ON")];
|
|
45
|
+
case 1:
|
|
46
|
+
_a.sent();
|
|
47
|
+
return [2 /*return*/];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
};
|
|
22
52
|
/**
|
|
23
53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AED,IAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;wCACjC,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;wCAEjB,IAAI,CAAC,aAAa,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;4CACtC,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC;yCACxB;wCAED,IAAI,mBAAmB,EAAE;4CACrB,EAAE,CAAC,MAAM,CAAC,CAAC;yCACd;6CAAM;4CACH,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;yCAClB;oCAEL,CAAC,CAAC;oCACI,cAAc,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;oCAEnC,IAAI,aAAa,EAAE;wCACf,kBAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;qCAC1D;yCAAM;wCACH,kBAAkB,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;qCACtD;;;;yBACJ,CAAC,EAAC;;;KACN;IAED,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAE5E;;OAEG;IACO,6CAAW,GAArB,UAAsB,aAA4B,EAAE,UAAsB;QAAtB,2BAAA,EAAA,cAAsB;QACtE,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,KAAK,IAAK,OAAA,OAAI,GAAG,OAAG,GAAG,IAAI,EAAjB,CAAiB,CAAC,CAAC;IAC7E,CAAC;IACL,8BAAC;AAAD,CAnGA,AAmGC,CAnG4C,yBAAyB,GAmGrE","file":"NativescriptQueryRunner.js","sourcesContent":["import {ObjectLiteral} from \"../../common/ObjectLiteral\";\nimport {QueryRunnerAlreadyReleasedError} from \"../../error/QueryRunnerAlreadyReleasedError\";\nimport {QueryFailedError} from \"../../error/QueryFailedError\";\nimport {AbstractSqliteQueryRunner} from \"../sqlite-abstract/AbstractSqliteQueryRunner\";\nimport {NativescriptDriver} from \"./NativescriptDriver\";\nimport {Broadcaster} from \"../../subscriber/Broadcaster\";\nimport { QueryResult } from \"../../query-runner/QueryResult\";\n\n/**\n * Runs queries on a single sqlite database connection.\n */\nexport class NativescriptQueryRunner extends AbstractSqliteQueryRunner {\n\n /**\n * Database driver used by connection.\n */\n driver: NativescriptDriver;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(driver: NativescriptDriver) {\n super();\n this.driver = driver;\n this.connection = driver.connection;\n this.broadcaster = new Broadcaster(this);\n }\n\n /**\n * Called before migrations are run.\n */\n async beforeMigration(): Promise<void> {\n await this.query(`PRAGMA foreign_keys = OFF`);\n }\n\n /**\n * Called after migrations are run.\n */\n async afterMigration(): Promise<void> {\n await this.query(`PRAGMA foreign_keys = ON`);\n }\n\n /**\n * Executes a given SQL query.\n */\n async query(query: string, parameters?: any[], useStructuredResult = false): Promise<any> {\n\n if (this.isReleased) {\n throw new QueryRunnerAlreadyReleasedError();\n }\n\n const connection = this.driver.connection;\n\n return new Promise(async (ok, fail) => {\n\n const databaseConnection = await this.connect();\n const isInsertQuery = query.substr(0, 11) === \"INSERT INTO\";\n connection.logger.logQuery(query, parameters, this);\n\n const handler = (err: any, raw: any) => {\n\n // log slow queries if maxQueryExecution time is set\n const maxQueryExecutionTime = this.driver.options.maxQueryExecutionTime;\n const queryEndTime = +new Date();\n const queryExecutionTime = queryEndTime - queryStartTime;\n \n if (maxQueryExecutionTime && queryExecutionTime > maxQueryExecutionTime) {\n connection.logger.logQuerySlow(queryExecutionTime, query, parameters, this);\n }\n \n if (err) {\n connection.logger.logQueryError(err, query, parameters, this);\n fail(new QueryFailedError(query, parameters, err));\n }\n\n const result = new QueryResult();\n result.raw = raw;\n\n if (!isInsertQuery && Array.isArray(raw)) {\n result.records = raw;\n }\n\n if (useStructuredResult) {\n ok(result);\n } else {\n ok(result.raw);\n }\n \n };\n const queryStartTime = +new Date();\n\n if (isInsertQuery) {\n databaseConnection.execSQL(query, parameters, handler);\n } else {\n databaseConnection.all(query, parameters, handler);\n } \n });\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Parametrizes given object of values. Used to create column=value queries.\n */\n protected parametrize(objectLiteral: ObjectLiteral, startIndex: number = 0): string[] {\n return Object.keys(objectLiteral).map((key, index) => `\"${key}\"` + \"=?\");\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -10,6 +10,14 @@ export declare class ReactNativeQueryRunner extends AbstractSqliteQueryRunner {
|
|
|
10
10
|
*/
|
|
11
11
|
driver: ReactNativeDriver;
|
|
12
12
|
constructor(driver: ReactNativeDriver);
|
|
13
|
+
/**
|
|
14
|
+
* Called before migrations are run.
|
|
15
|
+
*/
|
|
16
|
+
beforeMigration(): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Called after migrations are run.
|
|
19
|
+
*/
|
|
20
|
+
afterMigration(): Promise<void>;
|
|
13
21
|
/**
|
|
14
22
|
* Executes a given SQL query.
|
|
15
23
|
*/
|
|
@@ -19,6 +19,36 @@ var ReactNativeQueryRunner = /** @class */ (function (_super) {
|
|
|
19
19
|
_this.broadcaster = new Broadcaster(_this);
|
|
20
20
|
return _this;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Called before migrations are run.
|
|
24
|
+
*/
|
|
25
|
+
ReactNativeQueryRunner.prototype.beforeMigration = function () {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
27
|
+
return __generator(this, function (_a) {
|
|
28
|
+
switch (_a.label) {
|
|
29
|
+
case 0: return [4 /*yield*/, this.query("PRAGMA foreign_keys = OFF")];
|
|
30
|
+
case 1:
|
|
31
|
+
_a.sent();
|
|
32
|
+
return [2 /*return*/];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Called after migrations are run.
|
|
39
|
+
*/
|
|
40
|
+
ReactNativeQueryRunner.prototype.afterMigration = function () {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
42
|
+
return __generator(this, function (_a) {
|
|
43
|
+
switch (_a.label) {
|
|
44
|
+
case 0: return [4 /*yield*/, this.query("PRAGMA foreign_keys = ON")];
|
|
45
|
+
case 1:
|
|
46
|
+
_a.sent();
|
|
47
|
+
return [2 /*return*/];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
};
|
|
22
52
|
/**
|
|
23
53
|
* Executes a given SQL query.
|
|
24
54
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/driver/react-native/ReactNativeQueryRunner.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,+BAA+B,EAAC,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,yBAAyB,EAAC,MAAM,8CAA8C,CAAC;AAEvF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D;;GAEG;AACH;IAA4C,0CAAyB;IAOjE,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,gCAAY,MAAyB;QAArC,YACI,iBAAO,SAIV;QAHG,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,KAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,KAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,KAAI,CAAC,CAAC;;IAC7C,CAAC;IAED;;OAEG;IACH,sCAAK,GAAL,UAAM,KAAa,EAAE,UAAkB,EAAE,mBAA2B;QAApE,iBAgDC;QAhDwC,oCAAA,EAAA,2BAA2B;QAChE,IAAI,IAAI,CAAC,UAAU;YACf,MAAM,IAAI,+BAA+B,EAAE,CAAC;QAEhD,OAAO,IAAI,OAAO,CAAC,UAAO,EAAE,EAAE,I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C,CAAC;6BAClB;wBACL,CAAC,EAAE,UAAC,GAAQ;4BACR,KAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,KAAI,CAAC,CAAC;4BAC1E,IAAI,CAAC,IAAI,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;wBACvD,CAAC,CAAC,CAAC;;;;aACN,CAAC,CAAC;IACP,CAAC;IAED,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAE5E;;OAEG;IACO,4CAAW,GAArB,UAAsB,aAA4B,EAAE,UAAsB;QAAtB,2BAAA,EAAA,cAAsB;QACtE,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,KAAK,IAAK,OAAA,OAAI,GAAG,OAAG,GAAG,IAAI,EAAjB,CAAiB,CAAC,CAAC;IAC7E,CAAC;IACL,6BAAC;AAAD,CA/FA,AA+FC,CA/F2C,yBAAyB,GA+FpE","file":"ReactNativeQueryRunner.js","sourcesContent":["import {ObjectLiteral} from \"../../common/ObjectLiteral\";\nimport {QueryRunnerAlreadyReleasedError} from \"../../error/QueryRunnerAlreadyReleasedError\";\nimport {QueryFailedError} from \"../../error/QueryFailedError\";\nimport {AbstractSqliteQueryRunner} from \"../sqlite-abstract/AbstractSqliteQueryRunner\";\nimport {ReactNativeDriver} from \"./ReactNativeDriver\";\nimport {Broadcaster} from \"../../subscriber/Broadcaster\";\nimport { QueryResult } from \"../../query-runner/QueryResult\";\n\n/**\n * Runs queries on a single sqlite database connection.\n */\nexport class ReactNativeQueryRunner extends AbstractSqliteQueryRunner {\n\n /**\n * Database driver used by connection.\n */\n driver: ReactNativeDriver;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(driver: ReactNativeDriver) {\n super();\n this.driver = driver;\n this.connection = driver.connection;\n this.broadcaster = new Broadcaster(this);\n }\n\n /**\n * Called before migrations are run.\n */\n async beforeMigration(): Promise<void> {\n await this.query(`PRAGMA foreign_keys = OFF`);\n }\n\n /**\n * Called after migrations are run.\n */\n async afterMigration(): Promise<void> {\n await this.query(`PRAGMA foreign_keys = ON`);\n }\n\n /**\n * Executes a given SQL query.\n */\n query(query: string, parameters?: any[], useStructuredResult = false): Promise<any> {\n if (this.isReleased)\n throw new QueryRunnerAlreadyReleasedError();\n\n return new Promise(async (ok, fail) => {\n const databaseConnection = await this.connect();\n this.driver.connection.logger.logQuery(query, parameters, this);\n const queryStartTime = +new Date();\n databaseConnection.executeSql(query, parameters, (raw: any) => {\n\n // log slow queries if maxQueryExecution time is set\n const maxQueryExecutionTime = this.driver.options.maxQueryExecutionTime;\n const queryEndTime = +new Date();\n const queryExecutionTime = queryEndTime - queryStartTime;\n if (maxQueryExecutionTime && queryExecutionTime > maxQueryExecutionTime)\n this.driver.connection.logger.logQuerySlow(queryExecutionTime, query, parameters, this);\n\n const result = new QueryResult();\n\n // return id of inserted row, if query was insert statement.\n if (query.substr(0, 11) === \"INSERT INTO\") {\n result.raw = raw.insertId;\n }\n\n if (raw?.hasOwnProperty('rowsAffected')) {\n result.affected = raw.rowsAffected;\n }\n\n if (raw?.hasOwnProperty('rows')) {\n let records = [];\n for (let i = 0; i < raw.rows.length; i++) {\n records.push(raw.rows.item(i));\n }\n\n result.raw = records;\n result.records = records;\n }\n\n if (useStructuredResult) {\n ok(result);\n } else {\n ok(result.raw);\n }\n }, (err: any) => {\n this.driver.connection.logger.logQueryError(err, query, parameters, this);\n fail(new QueryFailedError(query, parameters, err));\n });\n });\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Parametrizes given object of values. Used to create column=value queries.\n */\n protected parametrize(objectLiteral: ObjectLiteral, startIndex: number = 0): string[] {\n return Object.keys(objectLiteral).map((key, index) => `\"${key}\"` + \"=?\");\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -12,6 +12,14 @@ export declare class SqliteQueryRunner extends AbstractSqliteQueryRunner {
|
|
|
12
12
|
*/
|
|
13
13
|
driver: SqliteDriver;
|
|
14
14
|
constructor(driver: SqliteDriver);
|
|
15
|
+
/**
|
|
16
|
+
* Called before migrations are run.
|
|
17
|
+
*/
|
|
18
|
+
beforeMigration(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Called after migrations are run.
|
|
21
|
+
*/
|
|
22
|
+
afterMigration(): Promise<void>;
|
|
15
23
|
/**
|
|
16
24
|
* Executes a given SQL query.
|
|
17
25
|
*/
|
|
@@ -23,6 +23,36 @@ var SqliteQueryRunner = /** @class */ (function (_super) {
|
|
|
23
23
|
_this.broadcaster = new Broadcaster(_this);
|
|
24
24
|
return _this;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Called before migrations are run.
|
|
28
|
+
*/
|
|
29
|
+
SqliteQueryRunner.prototype.beforeMigration = function () {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
31
|
+
return __generator(this, function (_a) {
|
|
32
|
+
switch (_a.label) {
|
|
33
|
+
case 0: return [4 /*yield*/, this.query("PRAGMA foreign_keys = OFF")];
|
|
34
|
+
case 1:
|
|
35
|
+
_a.sent();
|
|
36
|
+
return [2 /*return*/];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Called after migrations are run.
|
|
43
|
+
*/
|
|
44
|
+
SqliteQueryRunner.prototype.afterMigration = function () {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
+
return __generator(this, function (_a) {
|
|
47
|
+
switch (_a.label) {
|
|
48
|
+
case 0: return [4 /*yield*/, this.query("PRAGMA foreign_keys = ON")];
|
|
49
|
+
case 1:
|
|
50
|
+
_a.sent();
|
|
51
|
+
return [2 /*return*/];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
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,kBAAkB,GAAG,YAAY,GAAG,cAAc,CAAC;4BACzD,IAAI,qBAAqB,IAAI,kBAAkB,GAAG,qBAAqB;gCACnE,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;4BAEhF,IAAI,GAAG,EAAE;gCACL,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;gCAC9D,IAAI,CAAC,IAAI,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;6BACtD;iCAAM;gCACH,IAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;gCAEjC,IAAI,aAAa,EAAE;oCACf,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;iCAC/B;qCAAM;oCACH,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC;iCACrB;gCAED,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;oCAErB,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;iCACzB;gCAED,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;gCAElC,IAAI,mBAAmB,EAAE;oCACrB,EAAE,CAAC,MAAM,CAAC,CAAC;iCACd;qCAAM;oCACH,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;iCAClB;6BACJ;wBACL,CAAC,CAAC;wBAEF,qBAAM,OAAO,EAAE,EAAA;;wBAAf,SAAe,CAAC;;;;aACnB,CAAC,CAAC;IACP,CAAC;IACL,wBAAC;AAAD,CA5GA,AA4GC,CA5GsC,yBAAyB,GA4G/D","file":"SqliteQueryRunner.js","sourcesContent":["import {QueryRunnerAlreadyReleasedError} from \"../../error/QueryRunnerAlreadyReleasedError\";\nimport {QueryFailedError} from \"../../error/QueryFailedError\";\nimport {AbstractSqliteQueryRunner} from \"../sqlite-abstract/AbstractSqliteQueryRunner\";\nimport {SqliteConnectionOptions} from \"./SqliteConnectionOptions\";\nimport {SqliteDriver} from \"./SqliteDriver\";\nimport {Broadcaster} from \"../../subscriber/Broadcaster\";\nimport { ConnectionIsNotSetError } from '../../error/ConnectionIsNotSetError';\nimport { QueryResult } from \"../../query-runner/QueryResult\";\n\n/**\n * Runs queries on a single sqlite database connection.\n *\n * Does not support compose primary keys with autoincrement field.\n * todo: need to throw exception for this case.\n */\nexport class SqliteQueryRunner extends AbstractSqliteQueryRunner {\n\n /**\n * Database driver used by connection.\n */\n driver: SqliteDriver;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(driver: SqliteDriver) {\n super();\n this.driver = driver;\n this.connection = driver.connection;\n this.broadcaster = new Broadcaster(this);\n }\n\n /**\n * Called before migrations are run.\n */\n async beforeMigration(): Promise<void> {\n await this.query(`PRAGMA foreign_keys = OFF`);\n }\n\n /**\n * Called after migrations are run.\n */\n async afterMigration(): Promise<void> {\n await this.query(`PRAGMA foreign_keys = ON`);\n }\n\n /**\n * Executes a given SQL query.\n */\n query(query: string, parameters?: any[], useStructuredResult = false): Promise<any> {\n if (this.isReleased)\n throw new QueryRunnerAlreadyReleasedError();\n\n const connection = this.driver.connection;\n const options = connection.options as SqliteConnectionOptions;\n const maxQueryExecutionTime = this.driver.options.maxQueryExecutionTime;\n\n if (!connection.isConnected){\n throw new ConnectionIsNotSetError('sqlite')\n }\n\n return new Promise(async (ok, fail) => {\n\n const databaseConnection = await this.connect();\n this.driver.connection.logger.logQuery(query, parameters, this);\n const queryStartTime = +new Date();\n const isInsertQuery = query.startsWith(\"INSERT \");\n const isDeleteQuery = query.startsWith(\"DELETE \");\n const isUpdateQuery = query.startsWith(\"UPDATE \");\n\n const execute = async () => {\n if (isInsertQuery || isDeleteQuery || isUpdateQuery) {\n await databaseConnection.run(query, parameters, handler);\n } else {\n await databaseConnection.all(query, parameters, handler);\n }\n };\n\n const handler = function (err: any, rows: any) {\n if (err && err.toString().indexOf(\"SQLITE_BUSY:\") !== -1) {\n if (typeof options.busyErrorRetry === \"number\" && options.busyErrorRetry > 0) {\n setTimeout(execute, options.busyErrorRetry);\n return;\n }\n }\n\n // log slow queries if maxQueryExecution time is set\n const queryEndTime = +new Date();\n const queryExecutionTime = queryEndTime - queryStartTime;\n if (maxQueryExecutionTime && queryExecutionTime > maxQueryExecutionTime)\n connection.logger.logQuerySlow(queryExecutionTime, query, parameters, this);\n\n if (err) {\n connection.logger.logQueryError(err, query, parameters, this);\n fail(new QueryFailedError(query, parameters, err));\n } else {\n const result = new QueryResult();\n\n if (isInsertQuery) {\n result.raw = this[\"lastID\"];\n } else {\n result.raw = rows;\n }\n\n if (Array.isArray(rows)) {\n\n result.records = rows;\n }\n\n result.affected = this[\"changes\"];\n\n if (useStructuredResult) {\n ok(result);\n } else {\n ok(result.raw);\n }\n }\n };\n\n await execute();\n });\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1431,7 +1431,7 @@ var AbstractSqliteQueryRunner = /** @class */ (function (_super) {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
if (tableColumn.type === "varchar") {
|
|
1433
1433
|
// Check if this is an enum
|
|
1434
|
-
var enumMatch = sql.match(new RegExp("\"(" + tableColumn.name + ")\" varchar CHECK\\s*\\(\\s
|
|
1434
|
+
var enumMatch = sql.match(new RegExp("\"(" + tableColumn.name + ")\" varchar CHECK\\s*\\(\\s*\"\\1\"\\s+IN\\s*\\(('[^']+'(?:\\s*,\\s*'[^']+')+)\\s*\\)\\s*\\)"));
|
|
1435
1435
|
if (enumMatch) {
|
|
1436
1436
|
// This is an enum
|
|
1437
1437
|
tableColumn.enum = enumMatch[2].substr(1, enumMatch[2].length - 2).split("','");
|
|
@@ -1701,7 +1701,7 @@ var AbstractSqliteQueryRunner = /** @class */ (function (_super) {
|
|
|
1701
1701
|
c += " " + this.connection.driver.createFullType(column);
|
|
1702
1702
|
}
|
|
1703
1703
|
if (column.enum)
|
|
1704
|
-
c += " CHECK( " + column.name + " IN (" + column.enum.map(function (val) { return "'" + val + "'"; }).join(",") + ") )";
|
|
1704
|
+
c += " CHECK( \"" + column.name + "\" IN (" + column.enum.map(function (val) { return "'" + val + "'"; }).join(",") + ") )";
|
|
1705
1705
|
if (column.isPrimary && !skipPrimary)
|
|
1706
1706
|
c += " PRIMARY KEY";
|
|
1707
1707
|
if (column.isGenerated === true && column.generationStrategy === "increment") // don't use skipPrimary here since updates can update already exist primary without auto inc.
|