typeorm 0.2.40-dev.e80f97d → 0.2.41-dev.2d0abe7

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.
Files changed (101) hide show
  1. package/browser/cache/DbQueryResultCache.js +12 -3
  2. package/browser/cache/DbQueryResultCache.js.map +1 -1
  3. package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +33 -39
  4. package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
  5. package/browser/driver/cockroachdb/CockroachQueryRunner.js +24 -30
  6. package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
  7. package/browser/driver/mongodb/MongoConnectionOptions.d.ts +4 -0
  8. package/browser/driver/mongodb/MongoConnectionOptions.js.map +1 -1
  9. package/browser/driver/mongodb/MongoQueryRunner.d.ts +2 -0
  10. package/browser/driver/mongodb/MongoQueryRunner.js +3 -0
  11. package/browser/driver/mongodb/MongoQueryRunner.js.map +1 -1
  12. package/browser/driver/mysql/MysqlQueryRunner.js +37 -39
  13. package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
  14. package/browser/driver/oracle/OracleDriver.js +1 -1
  15. package/browser/driver/oracle/OracleDriver.js.map +1 -1
  16. package/browser/driver/oracle/OracleQueryRunner.js +13 -24
  17. package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
  18. package/browser/driver/postgres/PostgresDriver.d.ts +1 -0
  19. package/browser/driver/postgres/PostgresDriver.js +16 -7
  20. package/browser/driver/postgres/PostgresDriver.js.map +1 -1
  21. package/browser/driver/postgres/PostgresQueryRunner.d.ts +5 -0
  22. package/browser/driver/postgres/PostgresQueryRunner.js +314 -135
  23. package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
  24. package/browser/driver/sap/SapQueryRunner.js +36 -42
  25. package/browser/driver/sap/SapQueryRunner.js.map +1 -1
  26. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +8 -14
  27. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
  28. package/browser/driver/sqlserver/SqlServerQueryRunner.js +31 -33
  29. package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  30. package/browser/driver/types/MetadataTableType.d.ts +5 -0
  31. package/browser/driver/types/MetadataTableType.js +8 -0
  32. package/browser/driver/types/MetadataTableType.js.map +1 -0
  33. package/browser/find-options/FindTreeOptions.d.ts +5 -1
  34. package/browser/find-options/FindTreeOptions.js.map +1 -1
  35. package/browser/migration/MigrationExecutor.js +55 -48
  36. package/browser/migration/MigrationExecutor.js.map +1 -1
  37. package/browser/query-runner/BaseQueryRunner.d.ts +23 -0
  38. package/browser/query-runner/BaseQueryRunner.js +37 -0
  39. package/browser/query-runner/BaseQueryRunner.js.map +1 -1
  40. package/browser/query-runner/QueryRunner.d.ts +5 -0
  41. package/browser/query-runner/QueryRunner.js.map +1 -1
  42. package/browser/repository/FindTreesOptions.d.ts +9 -0
  43. package/browser/repository/FindTreesOptions.js +3 -0
  44. package/browser/repository/FindTreesOptions.js.map +1 -0
  45. package/browser/repository/TreeRepository.d.ts +4 -1
  46. package/browser/repository/TreeRepository.js +8 -4
  47. package/browser/repository/TreeRepository.js.map +1 -1
  48. package/browser/schema-builder/RdbmsSchemaBuilder.d.ts +5 -1
  49. package/browser/schema-builder/RdbmsSchemaBuilder.js +58 -49
  50. package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
  51. package/cache/DbQueryResultCache.js +12 -3
  52. package/cache/DbQueryResultCache.js.map +1 -1
  53. package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +33 -39
  54. package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
  55. package/driver/cockroachdb/CockroachQueryRunner.js +24 -30
  56. package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
  57. package/driver/mongodb/MongoConnectionOptions.d.ts +4 -0
  58. package/driver/mongodb/MongoConnectionOptions.js.map +1 -1
  59. package/driver/mongodb/MongoQueryRunner.d.ts +2 -0
  60. package/driver/mongodb/MongoQueryRunner.js +3 -0
  61. package/driver/mongodb/MongoQueryRunner.js.map +1 -1
  62. package/driver/mysql/MysqlQueryRunner.js +37 -39
  63. package/driver/mysql/MysqlQueryRunner.js.map +1 -1
  64. package/driver/oracle/OracleDriver.js +1 -1
  65. package/driver/oracle/OracleDriver.js.map +1 -1
  66. package/driver/oracle/OracleQueryRunner.js +13 -24
  67. package/driver/oracle/OracleQueryRunner.js.map +1 -1
  68. package/driver/postgres/PostgresDriver.d.ts +1 -0
  69. package/driver/postgres/PostgresDriver.js +16 -7
  70. package/driver/postgres/PostgresDriver.js.map +1 -1
  71. package/driver/postgres/PostgresQueryRunner.d.ts +5 -0
  72. package/driver/postgres/PostgresQueryRunner.js +314 -135
  73. package/driver/postgres/PostgresQueryRunner.js.map +1 -1
  74. package/driver/sap/SapQueryRunner.js +36 -42
  75. package/driver/sap/SapQueryRunner.js.map +1 -1
  76. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +8 -14
  77. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
  78. package/driver/sqlserver/SqlServerQueryRunner.js +31 -33
  79. package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  80. package/driver/types/MetadataTableType.d.ts +5 -0
  81. package/driver/types/MetadataTableType.js +11 -0
  82. package/driver/types/MetadataTableType.js.map +1 -0
  83. package/find-options/FindTreeOptions.d.ts +5 -1
  84. package/find-options/FindTreeOptions.js.map +1 -1
  85. package/migration/MigrationExecutor.js +55 -48
  86. package/migration/MigrationExecutor.js.map +1 -1
  87. package/package.json +1 -1
  88. package/query-runner/BaseQueryRunner.d.ts +23 -0
  89. package/query-runner/BaseQueryRunner.js +37 -0
  90. package/query-runner/BaseQueryRunner.js.map +1 -1
  91. package/query-runner/QueryRunner.d.ts +5 -0
  92. package/query-runner/QueryRunner.js.map +1 -1
  93. package/repository/FindTreesOptions.d.ts +9 -0
  94. package/repository/FindTreesOptions.js +4 -0
  95. package/repository/FindTreesOptions.js.map +1 -0
  96. package/repository/TreeRepository.d.ts +4 -1
  97. package/repository/TreeRepository.js +7 -3
  98. package/repository/TreeRepository.js.map +1 -1
  99. package/schema-builder/RdbmsSchemaBuilder.d.ts +5 -1
  100. package/schema-builder/RdbmsSchemaBuilder.js +58 -49
  101. package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
@@ -276,4 +276,8 @@ export interface MongoConnectionOptions extends BaseConnectionOptions {
276
276
  * Automatic Client-Side Field Level Encryption configuration.
277
277
  */
278
278
  readonly autoEncryption?: any;
279
+ /**
280
+ * Enables or disables the ability to retry writes upon encountering transient network errors.
281
+ */
282
+ readonly retryWrites?: boolean;
279
283
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/driver/mongodb/MongoConnectionOptions.ts"],"names":[],"mappings":"","file":"MongoConnectionOptions.js","sourcesContent":["import {BaseConnectionOptions} from \"../../connection/BaseConnectionOptions\";\nimport {ReadPreference} from \"./typings\";\n\n/**\n * MongoDB specific connection options.\n * Synced with http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html\n */\nexport interface MongoConnectionOptions extends BaseConnectionOptions {\n\n /**\n * Database type.\n */\n readonly type: \"mongodb\";\n\n /**\n * Connection url where perform connection to.\n */\n readonly url?: string;\n\n /**\n * Database host.\n */\n readonly host?: string;\n\n /**\n * Database host replica set.\n */\n readonly hostReplicaSet?: string;\n\n /**\n * Database host port.\n */\n readonly port?: number;\n\n /**\n * Database username.\n */\n readonly username?: string;\n\n /**\n * Database password.\n */\n readonly password?: string;\n\n /**\n * Database name to connect to.\n */\n readonly database?: string;\n\n /**\n * The driver object\n * This defaults to require(\"mongodb\")\n */\n readonly driver?: any;\n\n /**\n * Set the maximum poolSize for each individual server or proxy connection.\n */\n readonly poolSize?: number;\n\n /**\n * Use ssl connection (needs to have a mongod server with ssl support). Default: false\n */\n readonly ssl?: boolean;\n\n /**\n * Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher).\n * Default: true\n */\n readonly sslValidate?: boolean;\n\n /**\n * Array of valid certificates either as Buffers or Strings\n * (needs to have a mongod server with ssl support, 2.4 or higher).\n */\n readonly sslCA?: string[]|Buffer[];\n\n /**\n * String or buffer containing the certificate we wish to present\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslCert?: string|Buffer;\n\n /**\n * String or buffer containing the certificate private key we wish to present\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslKey?: string;\n\n /**\n * String or buffer containing the certificate password\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslPass?: string|Buffer;\n\n /**\n * SSL Certificate revocation list binary buffer\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslCRL?: string|Buffer;\n\n /**\n * Reconnect on error. Default: true\n */\n readonly autoReconnect?: boolean;\n\n /**\n * TCP Socket NoDelay option. Default: true\n */\n readonly noDelay?: boolean;\n\n /**\n * The number of milliseconds to wait before initiating keepAlive on the TCP socket. Default: 30000\n */\n readonly keepAlive?: number;\n\n /**\n * TCP Connection timeout setting. Default: 30000\n */\n readonly connectTimeoutMS?: number;\n\n /**\n * Version of IP stack. Can be 4, 6.\n * If undefined, will attempt to connect with IPv6, and will fall back to IPv4 on failure\n */\n readonly family?: number;\n\n /**\n * TCP Socket timeout setting. Default: 360000\n */\n readonly socketTimeoutMS?: number;\n\n /**\n * Server attempt to reconnect #times. Default 30\n */\n readonly reconnectTries?: number;\n\n /**\n * Server will wait #milliseconds between retries. Default 1000\n */\n readonly reconnectInterval?: number;\n\n /**\n * Control if high availability monitoring runs for Replicaset or Mongos proxies. Default true\n */\n readonly ha?: boolean;\n\n /**\n * The High availability period for replicaset inquiry. Default: 10000\n */\n readonly haInterval?: number;\n\n /**\n * The name of the replicaset to connect to\n */\n readonly replicaSet?: string;\n\n /**\n * Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms).\n * Default: 15\n */\n readonly acceptableLatencyMS?: number;\n\n /**\n * Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms).\n * Default: 15\n */\n readonly secondaryAcceptableLatencyMS?: number;\n\n /**\n * Sets if the driver should connect even if no primary is available. Default: false\n */\n readonly connectWithNoPrimary?: boolean;\n\n /**\n * If the database authentication is dependent on another databaseName.\n */\n readonly authSource?: string;\n\n /**\n * The write concern.\n */\n readonly w?: string|number;\n\n /**\n * The write concern timeout value.\n */\n readonly wtimeout?: number;\n\n /**\n * Specify a journal write concern. Default: false\n */\n readonly j?: boolean;\n\n /**\n * Force server to assign _id values instead of driver. Default: false\n */\n readonly forceServerObjectId?: boolean;\n\n /**\n * Serialize functions on any object. Default: false\n */\n readonly serializeFunctions?: boolean;\n\n /**\n * Specify if the BSON serializer should ignore undefined fields. Default: false\n */\n readonly ignoreUndefined?: boolean;\n\n /**\n * Return document results as raw BSON buffers. Default: false\n */\n readonly raw?: boolean;\n\n /**\n * Promotes Long values to number if they fit inside the 53 bits resolution. Default: true\n */\n readonly promoteLongs?: boolean;\n\n /**\n * Promotes Binary BSON values to native Node Buffers. Default: false\n */\n readonly promoteBuffers?: boolean;\n\n /**\n * Promotes BSON values to native types where possible, set to false to only receive wrapper types. Default: true\n */\n readonly promoteValues?: boolean;\n\n /**\n * Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit. Default: false\n */\n readonly domainsEnabled?: boolean;\n\n /**\n * Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection,\n * default is -1 which is unlimited.\n */\n readonly bufferMaxEntries?: number;\n\n /**\n * The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY,\n * ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).\n */\n readonly readPreference?: ReadPreference|string;\n\n /**\n * A primary key factory object for generation of custom _id keys.\n */\n readonly pkFactory?: any;\n\n /**\n * A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible.\n */\n readonly promiseLibrary?: any;\n\n /**\n * Specify a read concern for the collection. (only MongoDB 3.2 or higher supported).\n */\n readonly readConcern?: any;\n\n /**\n * Specify a maxStalenessSeconds value for secondary reads, minimum is 90 seconds\n */\n readonly maxStalenessSeconds?: number;\n\n /**\n * Specify the log level used by the driver logger (error/warn/info/debug).\n */\n readonly loggerLevel?: \"error\"|\"warn\"|\"info\"|\"debug\";\n\n // Do not overwrite BaseConnectionOptions.logger\n // readonly logger?: any;\n\n /**\n * Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function\n * Default: true\n */\n readonly checkServerIdentity?: boolean|Function;\n\n /**\n * Validate MongoClient passed in options for correctness. Default: false\n */\n readonly validateOptions?: boolean|any;\n\n /**\n * The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections\n */\n readonly appname?: string;\n\n /**\n * Sets the authentication mechanism that MongoDB will use to authenticate the connection\n */\n readonly authMechanism?: string;\n\n /**\n * Type of compression to use: snappy or zlib\n */\n readonly compression?: any;\n\n /**\n * Specify a file sync write concern. Default: false\n */\n readonly fsync?: boolean;\n\n /**\n * Read preference tags\n */\n readonly readPreferenceTags?: any[];\n\n /**\n * The number of retries for a tailable cursor. Default: 5\n */\n readonly numberOfRetries?: number;\n\n /**\n * Enable auto reconnecting for single server instances. Default: true\n */\n readonly auto_reconnect?: boolean;\n\n /**\n * Enable command monitoring for this client. Default: false\n */\n readonly monitorCommands?: boolean;\n\n /**\n * If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections\n */\n readonly minSize?: number;\n\n /**\n * Determines whether or not to use the new url parser. Default: false\n */\n readonly useNewUrlParser?: boolean;\n\n /**\n * Determines whether or not to use the new Server Discovery and Monitoring engine. Default: false\n * https://github.com/mongodb/node-mongodb-native/releases/tag/v3.2.1\n */\n readonly useUnifiedTopology?: boolean;\n\n /**\n * Automatic Client-Side Field Level Encryption configuration.\n */\n readonly autoEncryption?: any;\n}\n"],"sourceRoot":"../.."}
1
+ {"version":3,"sources":["../../src/driver/mongodb/MongoConnectionOptions.ts"],"names":[],"mappings":"","file":"MongoConnectionOptions.js","sourcesContent":["import {BaseConnectionOptions} from \"../../connection/BaseConnectionOptions\";\nimport {ReadPreference} from \"./typings\";\n\n/**\n * MongoDB specific connection options.\n * Synced with http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html\n */\nexport interface MongoConnectionOptions extends BaseConnectionOptions {\n\n /**\n * Database type.\n */\n readonly type: \"mongodb\";\n\n /**\n * Connection url where perform connection to.\n */\n readonly url?: string;\n\n /**\n * Database host.\n */\n readonly host?: string;\n\n /**\n * Database host replica set.\n */\n readonly hostReplicaSet?: string;\n\n /**\n * Database host port.\n */\n readonly port?: number;\n\n /**\n * Database username.\n */\n readonly username?: string;\n\n /**\n * Database password.\n */\n readonly password?: string;\n\n /**\n * Database name to connect to.\n */\n readonly database?: string;\n\n /**\n * The driver object\n * This defaults to require(\"mongodb\")\n */\n readonly driver?: any;\n\n /**\n * Set the maximum poolSize for each individual server or proxy connection.\n */\n readonly poolSize?: number;\n\n /**\n * Use ssl connection (needs to have a mongod server with ssl support). Default: false\n */\n readonly ssl?: boolean;\n\n /**\n * Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher).\n * Default: true\n */\n readonly sslValidate?: boolean;\n\n /**\n * Array of valid certificates either as Buffers or Strings\n * (needs to have a mongod server with ssl support, 2.4 or higher).\n */\n readonly sslCA?: string[]|Buffer[];\n\n /**\n * String or buffer containing the certificate we wish to present\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslCert?: string|Buffer;\n\n /**\n * String or buffer containing the certificate private key we wish to present\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslKey?: string;\n\n /**\n * String or buffer containing the certificate password\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslPass?: string|Buffer;\n\n /**\n * SSL Certificate revocation list binary buffer\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslCRL?: string|Buffer;\n\n /**\n * Reconnect on error. Default: true\n */\n readonly autoReconnect?: boolean;\n\n /**\n * TCP Socket NoDelay option. Default: true\n */\n readonly noDelay?: boolean;\n\n /**\n * The number of milliseconds to wait before initiating keepAlive on the TCP socket. Default: 30000\n */\n readonly keepAlive?: number;\n\n /**\n * TCP Connection timeout setting. Default: 30000\n */\n readonly connectTimeoutMS?: number;\n\n /**\n * Version of IP stack. Can be 4, 6.\n * If undefined, will attempt to connect with IPv6, and will fall back to IPv4 on failure\n */\n readonly family?: number;\n\n /**\n * TCP Socket timeout setting. Default: 360000\n */\n readonly socketTimeoutMS?: number;\n\n /**\n * Server attempt to reconnect #times. Default 30\n */\n readonly reconnectTries?: number;\n\n /**\n * Server will wait #milliseconds between retries. Default 1000\n */\n readonly reconnectInterval?: number;\n\n /**\n * Control if high availability monitoring runs for Replicaset or Mongos proxies. Default true\n */\n readonly ha?: boolean;\n\n /**\n * The High availability period for replicaset inquiry. Default: 10000\n */\n readonly haInterval?: number;\n\n /**\n * The name of the replicaset to connect to\n */\n readonly replicaSet?: string;\n\n /**\n * Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms).\n * Default: 15\n */\n readonly acceptableLatencyMS?: number;\n\n /**\n * Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms).\n * Default: 15\n */\n readonly secondaryAcceptableLatencyMS?: number;\n\n /**\n * Sets if the driver should connect even if no primary is available. Default: false\n */\n readonly connectWithNoPrimary?: boolean;\n\n /**\n * If the database authentication is dependent on another databaseName.\n */\n readonly authSource?: string;\n\n /**\n * The write concern.\n */\n readonly w?: string|number;\n\n /**\n * The write concern timeout value.\n */\n readonly wtimeout?: number;\n\n /**\n * Specify a journal write concern. Default: false\n */\n readonly j?: boolean;\n\n /**\n * Force server to assign _id values instead of driver. Default: false\n */\n readonly forceServerObjectId?: boolean;\n\n /**\n * Serialize functions on any object. Default: false\n */\n readonly serializeFunctions?: boolean;\n\n /**\n * Specify if the BSON serializer should ignore undefined fields. Default: false\n */\n readonly ignoreUndefined?: boolean;\n\n /**\n * Return document results as raw BSON buffers. Default: false\n */\n readonly raw?: boolean;\n\n /**\n * Promotes Long values to number if they fit inside the 53 bits resolution. Default: true\n */\n readonly promoteLongs?: boolean;\n\n /**\n * Promotes Binary BSON values to native Node Buffers. Default: false\n */\n readonly promoteBuffers?: boolean;\n\n /**\n * Promotes BSON values to native types where possible, set to false to only receive wrapper types. Default: true\n */\n readonly promoteValues?: boolean;\n\n /**\n * Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit. Default: false\n */\n readonly domainsEnabled?: boolean;\n\n /**\n * Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection,\n * default is -1 which is unlimited.\n */\n readonly bufferMaxEntries?: number;\n\n /**\n * The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY,\n * ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).\n */\n readonly readPreference?: ReadPreference|string;\n\n /**\n * A primary key factory object for generation of custom _id keys.\n */\n readonly pkFactory?: any;\n\n /**\n * A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible.\n */\n readonly promiseLibrary?: any;\n\n /**\n * Specify a read concern for the collection. (only MongoDB 3.2 or higher supported).\n */\n readonly readConcern?: any;\n\n /**\n * Specify a maxStalenessSeconds value for secondary reads, minimum is 90 seconds\n */\n readonly maxStalenessSeconds?: number;\n\n /**\n * Specify the log level used by the driver logger (error/warn/info/debug).\n */\n readonly loggerLevel?: \"error\"|\"warn\"|\"info\"|\"debug\";\n\n // Do not overwrite BaseConnectionOptions.logger\n // readonly logger?: any;\n\n /**\n * Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function\n * Default: true\n */\n readonly checkServerIdentity?: boolean|Function;\n\n /**\n * Validate MongoClient passed in options for correctness. Default: false\n */\n readonly validateOptions?: boolean|any;\n\n /**\n * The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections\n */\n readonly appname?: string;\n\n /**\n * Sets the authentication mechanism that MongoDB will use to authenticate the connection\n */\n readonly authMechanism?: string;\n\n /**\n * Type of compression to use: snappy or zlib\n */\n readonly compression?: any;\n\n /**\n * Specify a file sync write concern. Default: false\n */\n readonly fsync?: boolean;\n\n /**\n * Read preference tags\n */\n readonly readPreferenceTags?: any[];\n\n /**\n * The number of retries for a tailable cursor. Default: 5\n */\n readonly numberOfRetries?: number;\n\n /**\n * Enable auto reconnecting for single server instances. Default: true\n */\n readonly auto_reconnect?: boolean;\n\n /**\n * Enable command monitoring for this client. Default: false\n */\n readonly monitorCommands?: boolean;\n\n /**\n * If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections\n */\n readonly minSize?: number;\n\n /**\n * Determines whether or not to use the new url parser. Default: false\n */\n readonly useNewUrlParser?: boolean;\n\n /**\n * Determines whether or not to use the new Server Discovery and Monitoring engine. Default: false\n * https://github.com/mongodb/node-mongodb-native/releases/tag/v3.2.1\n */\n readonly useUnifiedTopology?: boolean;\n\n /**\n * Automatic Client-Side Field Level Encryption configuration.\n */\n readonly autoEncryption?: any;\n\n /**\n * Enables or disables the ability to retry writes upon encountering transient network errors.\n */\n readonly retryWrites?: boolean;\n}\n"],"sourceRoot":"../.."}
@@ -15,6 +15,7 @@ import { TableUnique } from "../../schema-builder/table/TableUnique";
15
15
  import { Broadcaster } from "../../subscriber/Broadcaster";
16
16
  import { TableCheck } from "../../schema-builder/table/TableCheck";
17
17
  import { TableExclusion } from "../../schema-builder/table/TableExclusion";
18
+ import { ReplicationMode } from "../types/ReplicationMode";
18
19
  /**
19
20
  * Runs queries on a single MongoDB connection.
20
21
  */
@@ -316,6 +317,7 @@ export declare class MongoQueryRunner implements QueryRunner {
316
317
  * Loads all views (with given names) from the database and creates a Table from them.
317
318
  */
318
319
  getViews(collectionNames: string[]): Promise<View[]>;
320
+ getReplicationMode(): ReplicationMode;
319
321
  /**
320
322
  * Checks if database with the given name exist.
321
323
  */
@@ -626,6 +626,9 @@ var MongoQueryRunner = /** @class */ (function () {
626
626
  });
627
627
  });
628
628
  };
629
+ MongoQueryRunner.prototype.getReplicationMode = function () {
630
+ return 'master';
631
+ };
629
632
  /**
630
633
  * Checks if database with the given name exist.
631
634
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/driver/mongodb/MongoQueryRunner.ts"],"names":[],"mappings":";;;;AA6CA,4DAAyD;AAGzD,qCAA2C;AAE3C;;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,yBAAW,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACH,iCAAM,GAAN,UAAO,cAAsB,EAAE,KAAqB;QAChD,OAAO,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,oCAAS,GAAT,UAAU,cAAsB,EAAE,QAAyB,EAAE,OAAsC;QAC/F,OAAO,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAED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AAD,CAt0BA,AAs0BC,IAAA;AAt0BY,4CAAgB","file":"MongoQueryRunner.js","sourcesContent":["import {QueryRunner} from \"../../query-runner/QueryRunner\";\nimport {ObjectLiteral} from \"../../common/ObjectLiteral\";\nimport {TableColumn} from \"../../schema-builder/table/TableColumn\";\nimport {Table} from \"../../schema-builder/table/Table\";\nimport {TableForeignKey} from \"../../schema-builder/table/TableForeignKey\";\nimport {TableIndex} from \"../../schema-builder/table/TableIndex\";\nimport {View} from \"../../schema-builder/view/View\";\nimport {\n AggregationCursor,\n BulkWriteOpResultObject,\n ChangeStream,\n ChangeStreamOptions,\n Code,\n Collection,\n CollectionAggregationOptions,\n CollectionBulkWriteOptions,\n CollectionInsertManyOptions,\n CollectionInsertOneOptions,\n CollectionOptions,\n CollStats,\n CommandCursor,\n Cursor,\n DeleteWriteOpResultObject,\n FindAndModifyWriteOpResultObject,\n FindOneAndReplaceOption,\n GeoHaystackSearchOptions,\n GeoNearOptions,\n InsertOneWriteOpResult,\n InsertWriteOpResult,\n MapReduceOptions,\n MongoClient,\n MongoCountPreferences,\n MongodbIndexOptions,\n OrderedBulkOperation,\n ParallelCollectionScanOptions,\n ReadPreference,\n ReplaceOneOptions,\n UnorderedBulkOperation,\n UpdateWriteOpResult\n} from \"./typings\";\nimport {Connection} from \"../../connection/Connection\";\nimport {ReadStream} from \"../../platform/PlatformTools\";\nimport {MongoEntityManager} from \"../../entity-manager/MongoEntityManager\";\nimport {SqlInMemory} from \"../SqlInMemory\";\nimport {TableUnique} from \"../../schema-builder/table/TableUnique\";\nimport {Broadcaster} from \"../../subscriber/Broadcaster\";\nimport {TableCheck} from \"../../schema-builder/table/TableCheck\";\nimport {TableExclusion} from \"../../schema-builder/table/TableExclusion\";\nimport { TypeORMError } from \"../../error\";\n\n/**\n * Runs queries on a single MongoDB connection.\n */\nexport class MongoQueryRunner implements QueryRunner {\n\n // -------------------------------------------------------------------------\n // Public Implemented Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection used by this query runner.\n */\n connection: Connection;\n\n /**\n * Broadcaster used on this query runner to broadcast entity events.\n */\n broadcaster: Broadcaster;\n\n /**\n * Entity manager working only with current query runner.\n */\n manager: MongoEntityManager;\n\n /**\n * Indicates if connection for this query runner is released.\n * Once its released, query runner cannot run queries anymore.\n * Always false for mongodb since mongodb has a single query executor instance.\n */\n isReleased = false;\n\n /**\n * Indicates if transaction is active in this query executor.\n * Always false for mongodb since mongodb does not support transactions.\n */\n isTransactionActive = false;\n\n /**\n * Stores temporarily user data.\n * Useful for sharing data with subscribers.\n */\n data = {};\n\n /**\n * All synchronized tables in the database.\n */\n loadedTables: Table[];\n\n /**\n * All synchronized views in the database.\n */\n loadedViews: View[];\n\n /**\n * Real database connection from a connection pool used to perform queries.\n */\n databaseConnection: MongoClient;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(connection: Connection, databaseConnection: MongoClient) {\n this.connection = connection;\n this.databaseConnection = databaseConnection;\n this.broadcaster = new Broadcaster(this);\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates a cursor for a query that can be used to iterate over results from MongoDB.\n */\n cursor(collectionName: string, query?: ObjectLiteral): Cursor<any> {\n return this.getCollection(collectionName).find(query || {});\n }\n\n /**\n * Execute an aggregation framework pipeline against the collection.\n */\n aggregate(collectionName: string, pipeline: ObjectLiteral[], options?: CollectionAggregationOptions): AggregationCursor<any> {\n return this.getCollection(collectionName).aggregate(pipeline, options);\n }\n\n /**\n * Perform a bulkWrite operation without a fluent API.\n */\n async bulkWrite(collectionName: string, operations: ObjectLiteral[], options?: CollectionBulkWriteOptions): Promise<BulkWriteOpResultObject> {\n return await this.getCollection(collectionName).bulkWrite(operations, options);\n }\n\n /**\n * Count number of matching documents in the db to a query.\n */\n async count(collectionName: string, query?: ObjectLiteral, options?: MongoCountPreferences): Promise<any> {\n return await this.getCollection(collectionName).countDocuments(query || {}, options);\n }\n\n /**\n * Creates an index on the db and collection.\n */\n async createCollectionIndex(collectionName: string, fieldOrSpec: string | any, options?: MongodbIndexOptions): Promise<string> {\n return await this.getCollection(collectionName).createIndex(fieldOrSpec, options);\n }\n\n /**\n * Creates multiple indexes in the collection, this method is only supported for MongoDB 2.6 or higher.\n * Earlier version of MongoDB will throw a command not supported error. Index specifications are defined at http://docs.mongodb.org/manual/reference/command/createIndexes/.\n */\n async createCollectionIndexes(collectionName: string, indexSpecs: ObjectLiteral[]): Promise<void> {\n return await this.getCollection(collectionName).createIndexes(indexSpecs);\n }\n\n /**\n * Delete multiple documents on MongoDB.\n */\n async deleteMany(collectionName: string, query: ObjectLiteral, options?: CollectionOptions): Promise<DeleteWriteOpResultObject> {\n return await this.getCollection(collectionName).deleteMany(query, options);\n }\n\n /**\n * Delete a document on MongoDB.\n */\n async deleteOne(collectionName: string, query: ObjectLiteral, options?: CollectionOptions): Promise<DeleteWriteOpResultObject> {\n return await this.getCollection(collectionName).deleteOne(query, options);\n }\n\n /**\n * The distinct command returns returns a list of distinct values for the given key across a collection.\n */\n async distinct(collectionName: string, key: string, query: ObjectLiteral, options?: { readPreference?: ReadPreference | string }): Promise<any> {\n return await this.getCollection(collectionName).distinct(key, query, options);\n }\n\n /**\n * Drops an index from this collection.\n */\n async dropCollectionIndex(collectionName: string, indexName: string, options?: CollectionOptions): Promise<any> {\n return await this.getCollection(collectionName).dropIndex(indexName, options);\n }\n\n /**\n * Drops all indexes from the collection.\n */\n async dropCollectionIndexes(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).dropIndexes();\n }\n\n /**\n * Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.\n */\n async findOneAndDelete(collectionName: string, query: ObjectLiteral, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise<FindAndModifyWriteOpResultObject> {\n return await this.getCollection(collectionName).findOneAndDelete(query, options);\n }\n\n /**\n * Find a document and replace it in one atomic operation, requires a write lock for the duration of the operation.\n */\n async findOneAndReplace(collectionName: string, query: ObjectLiteral, replacement: Object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject> {\n return await this.getCollection(collectionName).findOneAndReplace(query, replacement, options);\n }\n\n /**\n * Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.\n */\n async findOneAndUpdate(collectionName: string, query: ObjectLiteral, update: Object, options?: FindOneAndReplaceOption): Promise<FindAndModifyWriteOpResultObject> {\n return await this.getCollection(collectionName).findOneAndUpdate(query, update, options);\n }\n\n /**\n * Execute a geo search using a geo haystack index on a collection.\n */\n async geoHaystackSearch(collectionName: string, x: number, y: number, options?: GeoHaystackSearchOptions): Promise<any> {\n return await this.getCollection(collectionName).geoHaystackSearch(x, y, options);\n }\n\n /**\n * Execute the geoNear command to search for items in the collection.\n */\n async geoNear(collectionName: string, x: number, y: number, options?: GeoNearOptions): Promise<any> {\n return await this.getCollection(collectionName).geoNear(x, y, options);\n }\n\n /**\n * Run a group command across a collection.\n */\n async group(collectionName: string, keys: Object | Array<any> | Function | Code, condition: Object, initial: Object, reduce: Function | Code, finalize: Function | Code, command: boolean, options?: { readPreference?: ReadPreference | string }): Promise<any> {\n return await this.getCollection(collectionName).group(keys, condition, initial, reduce, finalize, command, options);\n }\n\n /**\n * Retrieve all the indexes on the collection.\n */\n async collectionIndexes(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).indexes();\n }\n\n /**\n * Retrieve all the indexes on the collection.\n */\n async collectionIndexExists(collectionName: string, indexes: string | string[]): Promise<boolean> {\n return await this.getCollection(collectionName).indexExists(indexes);\n }\n\n /**\n * Retrieves this collections index info.\n */\n async collectionIndexInformation(collectionName: string, options?: { full: boolean }): Promise<any> {\n return await this.getCollection(collectionName).indexInformation(options);\n }\n\n /**\n * Initiate an In order bulk write operation, operations will be serially executed in the order they are added, creating a new operation for each switch in types.\n */\n initializeOrderedBulkOp(collectionName: string, options?: CollectionOptions): OrderedBulkOperation {\n return this.getCollection(collectionName).initializeOrderedBulkOp(options);\n }\n\n /**\n * Initiate a Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.\n */\n initializeUnorderedBulkOp(collectionName: string, options?: CollectionOptions): UnorderedBulkOperation {\n return this.getCollection(collectionName).initializeUnorderedBulkOp(options);\n }\n\n /**\n * Inserts an array of documents into MongoDB.\n */\n async insertMany(collectionName: string, docs: ObjectLiteral[], options?: CollectionInsertManyOptions): Promise<InsertWriteOpResult> {\n return await this.getCollection(collectionName).insertMany(docs, options);\n }\n\n /**\n * Inserts a single document into MongoDB.\n */\n async insertOne(collectionName: string, doc: ObjectLiteral, options?: CollectionInsertOneOptions): Promise<InsertOneWriteOpResult> {\n return await this.getCollection(collectionName).insertOne(doc, options);\n }\n\n /**\n * Returns if the collection is a capped collection.\n */\n async isCapped(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).isCapped();\n }\n\n /**\n * Get the list of all indexes information for the collection.\n */\n listCollectionIndexes(collectionName: string, options?: { batchSize?: number, readPreference?: ReadPreference | string }): CommandCursor {\n return this.getCollection(collectionName).listIndexes(options);\n }\n\n /**\n * Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.\n */\n async mapReduce(collectionName: string, map: Function | string, reduce: Function | string, options?: MapReduceOptions): Promise<any> {\n return await this.getCollection(collectionName).mapReduce(map, reduce, options);\n }\n\n /**\n * Return N number of parallel cursors for a collection allowing parallel reading of entire collection.\n * There are no ordering guarantees for returned results.\n */\n async parallelCollectionScan(collectionName: string, options?: ParallelCollectionScanOptions): Promise<Cursor<any>[]> {\n return await this.getCollection(collectionName).parallelCollectionScan(options);\n }\n\n /**\n * Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.\n */\n async reIndex(collectionName: string): Promise<any> {\n return await this.getCollection(collectionName).reIndex();\n }\n\n /**\n * Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.\n */\n async rename(collectionName: string, newName: string, options?: { dropTarget?: boolean }): Promise<Collection<any>> {\n return await this.getCollection(collectionName).rename(newName, options);\n }\n\n /**\n * Replace a document on MongoDB.\n */\n async replaceOne(collectionName: string, query: ObjectLiteral, doc: ObjectLiteral, options?: ReplaceOneOptions): Promise<UpdateWriteOpResult> {\n return await this.getCollection(collectionName).replaceOne(query, doc, options);\n }\n\n /**\n * Get all the collection statistics.\n */\n async stats(collectionName: string, options?: { scale: number }): Promise<CollStats> {\n return await this.getCollection(collectionName).stats(options);\n }\n\n /**\n * Watching new changes as stream.\n */\n watch(collectionName: string, pipeline?: Object[], options?: ChangeStreamOptions): ChangeStream {\n return this.getCollection(collectionName).watch(pipeline, options);\n }\n\n /**\n * Update multiple documents on MongoDB.\n */\n async updateMany(collectionName: string, query: ObjectLiteral, update: ObjectLiteral, options?: { upsert?: boolean, w?: any, wtimeout?: number, j?: boolean }): Promise<UpdateWriteOpResult> {\n return await this.getCollection(collectionName).updateMany(query, update, options);\n }\n\n /**\n * Update a single document on MongoDB.\n */\n async updateOne(collectionName: string, query: ObjectLiteral, update: ObjectLiteral, options?: ReplaceOneOptions): Promise<UpdateWriteOpResult> {\n return await this.getCollection(collectionName).updateOne(query, update, options);\n }\n\n // -------------------------------------------------------------------------\n // Public Implemented Methods (from QueryRunner)\n // -------------------------------------------------------------------------\n\n /**\n * Removes all collections from the currently connected database.\n * Be careful with using this method and avoid using it in production or migrations\n * (because it can clear all your database).\n */\n async clearDatabase(): Promise<void> {\n await this.databaseConnection.db(this.connection.driver.database!).dropDatabase();\n }\n\n /**\n * For MongoDB database we don't create connection, because its single connection already created by a driver.\n */\n async connect(): Promise<any> {\n }\n\n /**\n * For MongoDB database we don't release connection, because its single connection.\n */\n async release(): Promise<void> {\n // releasing connection are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Starts transaction.\n */\n async startTransaction(): Promise<void> {\n // transactions are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Commits transaction.\n */\n async commitTransaction(): Promise<void> {\n // transactions are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Rollbacks transaction.\n */\n async rollbackTransaction(): Promise<void> {\n // transactions are not supported by mongodb driver, so simply don't do anything here\n }\n\n /**\n * Executes a given SQL query.\n */\n query(query: string, parameters?: any[]): Promise<any> {\n throw new TypeORMError(`Executing SQL query is not supported by MongoDB driver.`);\n }\n\n /**\n * Returns raw data stream.\n */\n stream(query: string, parameters?: any[], onEnd?: Function, onError?: Function): Promise<ReadStream> {\n throw new TypeORMError(`Stream is not supported by MongoDB driver. Use watch instead.`);\n }\n\n /**\n * Insert a new row with given values into the given table.\n * Returns value of inserted object id.\n\n async insert(collectionName: string, keyValues: ObjectLiteral): Promise<any> { // todo: fix any\n const results = await this.databaseConnection\n .collection(collectionName)\n .insertOne(keyValues);\n const generatedMap = this.connection.getMetadata(collectionName).objectIdColumn!.createValueMap(results.insertedId);\n return {\n result: results,\n generatedMap: generatedMap\n };\n }*/\n\n /**\n * Updates rows that match given conditions in the given table.\n\n async update(collectionName: string, valuesMap: ObjectLiteral, conditions: ObjectLiteral): Promise<any> { // todo: fix any\n await this.databaseConnection\n .collection(collectionName)\n .updateOne(conditions, valuesMap);\n }*/\n\n /**\n * Deletes from the given table by a given conditions.\n\n async delete(collectionName: string, conditions: ObjectLiteral|ObjectLiteral[]|string, maybeParameters?: any[]): Promise<any> { // todo: fix any\n if (typeof conditions === \"string\")\n throw new TypeORMError(`String condition is not supported by MongoDB driver.`);\n\n await this.databaseConnection\n .collection(collectionName)\n .deleteOne(conditions);\n }*/\n\n /**\n * Returns all available database names including system databases.\n */\n async getDatabases(): Promise<string[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Returns all available schema names including system schemas.\n * If database parameter specified, returns schemas of that database.\n */\n async getSchemas(database?: string): Promise<string[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads given table's data from the database.\n */\n async getTable(collectionName: string): Promise<Table | undefined> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads all tables (with given names) from the database and creates a Table from them.\n */\n async getTables(collectionNames: string[]): Promise<Table[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads given views's data from the database.\n */\n async getView(collectionName: string): Promise<View | undefined> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads all views (with given names) from the database and creates a Table from them.\n */\n async getViews(collectionNames: string[]): Promise<View[]> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if database with the given name exist.\n */\n async hasDatabase(database: string): Promise<boolean> {\n throw new TypeORMError(`Check database queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads currently using database\n */\n async getCurrentDatabase(): Promise<undefined> {\n throw new TypeORMError(`Check database queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if schema with the given name exist.\n */\n async hasSchema(schema: string): Promise<boolean> {\n throw new TypeORMError(`Check schema queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Loads currently using database schema\n */\n async getCurrentSchema(): Promise<undefined> {\n throw new TypeORMError(`Check schema queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if table with the given name exist in the database.\n */\n async hasTable(collectionName: string): Promise<boolean> {\n throw new TypeORMError(`Check schema queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Checks if column with the given name exist in the given table.\n */\n async hasColumn(tableOrName: Table | string, columnName: string): Promise<boolean> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a database if it's not created.\n */\n async createDatabase(database: string): Promise<void> {\n throw new TypeORMError(`Database create queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops database.\n */\n async dropDatabase(database: string, ifExist?: boolean): Promise<void> {\n throw new TypeORMError(`Database drop queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new table schema.\n */\n async createSchema(schemaPath: string, ifNotExist?: boolean): Promise<void> {\n throw new TypeORMError(`Schema create queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops table schema.\n */\n async dropSchema(schemaPath: string, ifExist?: boolean): Promise<void> {\n throw new TypeORMError(`Schema drop queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new table from the given table and columns inside it.\n */\n async createTable(table: Table): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops the table.\n */\n async dropTable(tableName: Table | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new view.\n */\n async createView(view: View): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops the view.\n */\n async dropView(target: View|string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Renames the given table.\n */\n async renameTable(oldTableOrName: Table | string, newTableOrName: Table | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new column from the column in the table.\n */\n async addColumn(tableOrName: Table | string, column: TableColumn): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new columns from the column in the table.\n */\n async addColumns(tableOrName: Table | string, columns: TableColumn[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Renames column in the given table.\n */\n async renameColumn(tableOrName: Table | string, oldTableColumnOrName: TableColumn | string, newTableColumnOrName: TableColumn | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Changes a column in the table.\n */\n async changeColumn(tableOrName: Table | string, oldTableColumnOrName: TableColumn | string, newColumn: TableColumn): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Changes a column in the table.\n */\n async changeColumns(tableOrName: Table | string, changedColumns: { newColumn: TableColumn, oldColumn: TableColumn }[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops column in the table.\n */\n async dropColumn(tableOrName: Table | string, columnOrName: TableColumn | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops the columns in the table.\n */\n async dropColumns(tableOrName: Table | string, columns: TableColumn[] | string[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new primary key.\n */\n async createPrimaryKey(tableOrName: Table | string, columnNames: string[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Updates composite primary keys.\n */\n async updatePrimaryKeys(tableOrName: Table | string, columns: TableColumn[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops a primary key.\n */\n async dropPrimaryKey(tableOrName: Table | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new unique constraint.\n */\n async createUniqueConstraint(tableOrName: Table | string, uniqueConstraint: TableUnique): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new unique constraints.\n */\n async createUniqueConstraints(tableOrName: Table | string, uniqueConstraints: TableUnique[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an unique constraint.\n */\n async dropUniqueConstraint(tableOrName: Table | string, uniqueOrName: TableUnique | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an unique constraints.\n */\n async dropUniqueConstraints(tableOrName: Table | string, uniqueConstraints: TableUnique[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new check constraint.\n */\n async createCheckConstraint(tableOrName: Table | string, checkConstraint: TableCheck): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new check constraints.\n */\n async createCheckConstraints(tableOrName: Table | string, checkConstraints: TableCheck[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops check constraint.\n */\n async dropCheckConstraint(tableOrName: Table | string, checkOrName: TableCheck | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops check constraints.\n */\n async dropCheckConstraints(tableOrName: Table | string, checkConstraints: TableCheck[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new exclusion constraint.\n */\n async createExclusionConstraint(tableOrName: Table | string, exclusionConstraint: TableExclusion): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new exclusion constraints.\n */\n async createExclusionConstraints(tableOrName: Table | string, exclusionConstraints: TableExclusion[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops exclusion constraint.\n */\n async dropExclusionConstraint(tableOrName: Table | string, exclusionOrName: TableExclusion | string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops exclusion constraints.\n */\n async dropExclusionConstraints(tableOrName: Table | string, exclusionConstraints: TableExclusion[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new foreign key.\n */\n async createForeignKey(tableOrName: Table | string, foreignKey: TableForeignKey): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new foreign keys.\n */\n async createForeignKeys(tableOrName: Table | string, foreignKeys: TableForeignKey[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops a foreign key from the table.\n */\n async dropForeignKey(tableOrName: Table | string, foreignKey: TableForeignKey): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops a foreign keys from the table.\n */\n async dropForeignKeys(tableOrName: Table | string, foreignKeys: TableForeignKey[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new index.\n */\n async createIndex(tableOrName: Table | string, index: TableIndex): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Creates a new indices\n */\n async createIndices(tableOrName: Table | string, indices: TableIndex[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an index from the table.\n */\n async dropIndex(collectionName: string, indexName: string): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops an indices from the table.\n */\n async dropIndices(tableOrName: Table | string, indices: TableIndex[]): Promise<void> {\n throw new TypeORMError(`Schema update queries are not supported by MongoDB driver.`);\n }\n\n /**\n * Drops collection.\n */\n async clearTable(collectionName: string): Promise<void> {\n await this.databaseConnection\n .db(this.connection.driver.database!)\n .dropCollection(collectionName);\n }\n\n /**\n * Enables special query runner mode in which sql queries won't be executed,\n * instead they will be memorized into a special variable inside query runner.\n * You can get memorized sql using getMemorySql() method.\n */\n enableSqlMemory(): void {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Disables special query runner mode in which sql queries won't be executed\n * started by calling enableSqlMemory() method.\n *\n * Previously memorized sql will be flushed.\n */\n disableSqlMemory(): void {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Flushes all memorized sqls.\n */\n clearSqlMemory(): void {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Gets sql stored in the memory. Parameters in the sql are already replaced.\n */\n getMemorySql(): SqlInMemory {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Executes up sql queries.\n */\n async executeMemoryUpSql(): Promise<void> {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n /**\n * Executes down sql queries.\n */\n async executeMemoryDownSql(): Promise<void> {\n throw new TypeORMError(`This operation is not supported by MongoDB driver.`);\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Gets collection from the database with a given name.\n */\n protected getCollection(collectionName: string): Collection<any> {\n return this.databaseConnection.db(this.connection.driver.database!).collection(collectionName);\n }\n\n}\n"],"sourceRoot":"../.."}
1
+ {"version":3,"sources":["../../src/driver/mongodb/MongoQueryRunner.ts"],"names":[],"mappings":";;;;AA6CA,4DAAyD;AAGzD,qCAAyC;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,yBAAW,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACH,iCAAM,GAAN,UAAO,cAAsB,EAAE,KAAqB;QAChD,OAAO,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,oCAAS,GAAT,UAAU,cAAsB,EAAE,QAAyB,EAAE,OAAsC;QAC/F,OAAO,IAAI,CAAC,aAAa,CAAC,c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AkB,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;AA10BY,4CAAgB","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":"../.."}
@@ -19,6 +19,7 @@ var BaseQueryRunner_1 = require("../../query-runner/BaseQueryRunner");
19
19
  var Broadcaster_1 = require("../../subscriber/Broadcaster");
20
20
  var VersionUtils_1 = require("../../util/VersionUtils");
21
21
  var error_1 = require("../../error");
22
+ var MetadataTableType_1 = require("../types/MetadataTableType");
22
23
  /**
23
24
  * Runs queries on a single mysql database connection.
24
25
  */
@@ -1717,7 +1718,7 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
1717
1718
  return "(`t`.`schema` = '" + database + "' AND `t`.`name` = '" + name + "')";
1718
1719
  }).join(" OR ");
1719
1720
  query = "SELECT `t`.*, `v`.`check_option` FROM " + this.escapePath(this.getTypeormMetadataTableName()) + " `t` " +
1720
- ("INNER JOIN `information_schema`.`views` `v` ON `v`.`table_schema` = `t`.`schema` AND `v`.`table_name` = `t`.`name` WHERE `t`.`type` = 'VIEW' " + (viewsCondition ? "AND (" + viewsCondition + ")" : ""));
1721
+ ("INNER JOIN `information_schema`.`views` `v` ON `v`.`table_schema` = `t`.`schema` AND `v`.`table_name` = `t`.`name` WHERE `t`.`type` = '" + MetadataTableType_1.MetadataTableType.VIEW + "' " + (viewsCondition ? "AND (" + viewsCondition + ")" : ""));
1721
1722
  return [4 /*yield*/, this.query(query)];
1722
1723
  case 3:
1723
1724
  dbViews = _a.sent();
@@ -1829,23 +1830,23 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
1829
1830
  table.columns = dbColumns
1830
1831
  .filter(function (dbColumn) { return dbColumn["TABLE_NAME"] === dbTable["TABLE_NAME"] && dbColumn["TABLE_SCHEMA"] === dbTable["TABLE_SCHEMA"]; })
1831
1832
  .map(function (dbColumn) {
1832
- var columnUniqueIndex = dbIndices.find(function (dbIndex) {
1833
- if (dbIndex["TABLE_NAME"] !== dbTable["TABLE_NAME"] || dbIndex["TABLE_SCHEMA"] !== dbTable["TABLE_SCHEMA"]) {
1834
- return false;
1835
- }
1836
- // Index is not for this column
1837
- if (dbIndex["COLUMN_NAME"] !== dbColumn["COLUMN_NAME"]) {
1838
- return false;
1839
- }
1840
- var nonUnique = parseInt(dbIndex["NON_UNIQUE"], 10);
1841
- return nonUnique === 0;
1833
+ var columnUniqueIndices = dbIndices.filter(function (dbIndex) {
1834
+ return dbIndex["TABLE_NAME"] === dbTable["TABLE_NAME"]
1835
+ && dbIndex["TABLE_SCHEMA"] === dbTable["TABLE_SCHEMA"]
1836
+ && dbIndex["COLUMN_NAME"] === dbColumn["COLUMN_NAME"]
1837
+ && parseInt(dbIndex["NON_UNIQUE"], 10) === 0;
1842
1838
  });
1843
1839
  var tableMetadata = _this.connection.entityMetadatas.find(function (metadata) { return _this.getTablePath(table) === _this.getTablePath(metadata); });
1844
- var hasIgnoredIndex = columnUniqueIndex && tableMetadata && tableMetadata.indices
1845
- .some(function (index) { return index.name === columnUniqueIndex["INDEX_NAME"] && index.synchronize === false; });
1846
- var isConstraintComposite = columnUniqueIndex
1847
- ? !!dbIndices.find(function (dbIndex) { return dbIndex["INDEX_NAME"] === columnUniqueIndex["INDEX_NAME"] && dbIndex["COLUMN_NAME"] !== dbColumn["COLUMN_NAME"]; })
1848
- : false;
1840
+ var hasIgnoredIndex = columnUniqueIndices.length > 0
1841
+ && tableMetadata
1842
+ && tableMetadata.indices.some(function (index) {
1843
+ return columnUniqueIndices.some(function (uniqueIndex) {
1844
+ return index.name === uniqueIndex["INDEX_NAME"] && index.synchronize === false;
1845
+ });
1846
+ });
1847
+ var isConstraintComposite = columnUniqueIndices.every(function (uniqueIndex) {
1848
+ return dbIndices.some(function (dbIndex) { return dbIndex["INDEX_NAME"] === uniqueIndex["INDEX_NAME"] && dbIndex["COLUMN_NAME"] !== dbColumn["COLUMN_NAME"]; });
1849
+ });
1849
1850
  var tableColumn = new TableColumn_1.TableColumn();
1850
1851
  tableColumn.name = dbColumn["COLUMN_NAME"];
1851
1852
  tableColumn.type = dbColumn["DATA_TYPE"].toLowerCase();
@@ -1882,7 +1883,7 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
1882
1883
  tableColumn.asExpression = dbColumn["GENERATION_EXPRESSION"];
1883
1884
  tableColumn.generatedType = dbColumn["EXTRA"].indexOf("VIRTUAL") !== -1 ? "VIRTUAL" : "STORED";
1884
1885
  }
1885
- tableColumn.isUnique = !!columnUniqueIndex && !hasIgnoredIndex && !isConstraintComposite;
1886
+ tableColumn.isUnique = columnUniqueIndices.length > 0 && !hasIgnoredIndex && !isConstraintComposite;
1886
1887
  tableColumn.isNullable = dbColumn["IS_NULLABLE"] === "YES";
1887
1888
  tableColumn.isPrimary = dbPrimaryKeys.some(function (dbPrimaryKey) {
1888
1889
  return (dbPrimaryKey["TABLE_NAME"] === dbColumn["TABLE_NAME"] &&
@@ -2058,19 +2059,19 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
2058
2059
  };
2059
2060
  MysqlQueryRunner.prototype.insertViewDefinitionSql = function (view) {
2060
2061
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2061
- var currentDatabase, expression, _a, query, parameters;
2062
- return (0, tslib_1.__generator)(this, function (_b) {
2063
- switch (_b.label) {
2062
+ var currentDatabase, expression;
2063
+ return (0, tslib_1.__generator)(this, function (_a) {
2064
+ switch (_a.label) {
2064
2065
  case 0: return [4 /*yield*/, this.getCurrentDatabase()];
2065
2066
  case 1:
2066
- currentDatabase = _b.sent();
2067
+ currentDatabase = _a.sent();
2067
2068
  expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
2068
- _a = (0, tslib_1.__read)(this.connection.createQueryBuilder()
2069
- .insert()
2070
- .into(this.getTypeormMetadataTableName())
2071
- .values({ type: "VIEW", schema: currentDatabase, name: view.name, value: expression })
2072
- .getQueryAndParameters(), 2), query = _a[0], parameters = _a[1];
2073
- return [2 /*return*/, new Query_1.Query(query, parameters)];
2069
+ return [2 /*return*/, this.insertTypeormMetadataSql({
2070
+ type: MetadataTableType_1.MetadataTableType.VIEW,
2071
+ schema: currentDatabase,
2072
+ name: view.name,
2073
+ value: expression
2074
+ })];
2074
2075
  }
2075
2076
  });
2076
2077
  });
@@ -2086,21 +2087,18 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
2086
2087
  */
2087
2088
  MysqlQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
2088
2089
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2089
- var currentDatabase, viewName, qb, _a, query, parameters;
2090
- return (0, tslib_1.__generator)(this, function (_b) {
2091
- switch (_b.label) {
2090
+ var currentDatabase, viewName;
2091
+ return (0, tslib_1.__generator)(this, function (_a) {
2092
+ switch (_a.label) {
2092
2093
  case 0: return [4 /*yield*/, this.getCurrentDatabase()];
2093
2094
  case 1:
2094
- currentDatabase = _b.sent();
2095
+ currentDatabase = _a.sent();
2095
2096
  viewName = viewOrPath instanceof View_1.View ? viewOrPath.name : viewOrPath;
2096
- qb = this.connection.createQueryBuilder();
2097
- _a = (0, tslib_1.__read)(qb.delete()
2098
- .from(this.getTypeormMetadataTableName())
2099
- .where(qb.escape("type") + " = 'VIEW'")
2100
- .andWhere(qb.escape("schema") + " = :schema", { schema: currentDatabase })
2101
- .andWhere(qb.escape("name") + " = :name", { name: viewName })
2102
- .getQueryAndParameters(), 2), query = _a[0], parameters = _a[1];
2103
- return [2 /*return*/, new Query_1.Query(query, parameters)];
2097
+ return [2 /*return*/, this.deleteTypeormMetadataSql({
2098
+ type: MetadataTableType_1.MetadataTableType.VIEW,
2099
+ schema: currentDatabase,
2100
+ name: viewName
2101
+ })];
2104
2102
  }
2105
2103
  });
2106
2104
  });