typeorm 0.2.40-dev.d039319 → 0.2.41-dev.29cb891
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +33 -39
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +24 -30
- package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/MongoConnectionOptions.d.ts +4 -0
- package/browser/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.js +37 -39
- package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/browser/driver/oracle/OracleDriver.js +1 -1
- package/browser/driver/oracle/OracleDriver.js.map +1 -1
- package/browser/driver/oracle/OracleQueryRunner.js +13 -24
- package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresDriver.d.ts +1 -0
- package/browser/driver/postgres/PostgresDriver.js +16 -7
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.d.ts +5 -0
- package/browser/driver/postgres/PostgresQueryRunner.js +314 -135
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/sap/SapQueryRunner.js +36 -42
- package/browser/driver/sap/SapQueryRunner.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +8 -14
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.js +31 -33
- package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/browser/driver/types/MetadataTableType.d.ts +5 -0
- package/browser/driver/types/MetadataTableType.js +8 -0
- package/browser/driver/types/MetadataTableType.js.map +1 -0
- package/browser/find-options/FindConditions.d.ts +6 -2
- package/browser/find-options/FindConditions.js.map +1 -1
- package/browser/find-options/FindTreeOptions.d.ts +5 -1
- package/browser/find-options/FindTreeOptions.js.map +1 -1
- package/browser/migration/MigrationExecutor.js +55 -48
- package/browser/migration/MigrationExecutor.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.d.ts +1 -1
- package/browser/query-builder/SelectQueryBuilder.js +4 -20
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.d.ts +22 -0
- package/browser/query-runner/BaseQueryRunner.js +34 -0
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/repository/FindTreesOptions.d.ts +9 -0
- package/browser/repository/FindTreesOptions.js +3 -0
- package/browser/repository/FindTreesOptions.js.map +1 -0
- package/browser/repository/TreeRepository.d.ts +4 -1
- package/browser/repository/TreeRepository.js +8 -4
- package/browser/repository/TreeRepository.js.map +1 -1
- package/browser/schema-builder/RdbmsSchemaBuilder.d.ts +5 -1
- package/browser/schema-builder/RdbmsSchemaBuilder.js +58 -49
- package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +33 -39
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +24 -30
- package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/driver/mongodb/MongoConnectionOptions.d.ts +4 -0
- package/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.js +37 -39
- package/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/driver/oracle/OracleDriver.js +1 -1
- package/driver/oracle/OracleDriver.js.map +1 -1
- package/driver/oracle/OracleQueryRunner.js +13 -24
- package/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/driver/postgres/PostgresDriver.d.ts +1 -0
- package/driver/postgres/PostgresDriver.js +16 -7
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.d.ts +5 -0
- package/driver/postgres/PostgresQueryRunner.js +314 -135
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/sap/SapQueryRunner.js +36 -42
- package/driver/sap/SapQueryRunner.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +8 -14
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqlserver/SqlServerQueryRunner.js +31 -33
- package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/driver/types/MetadataTableType.d.ts +5 -0
- package/driver/types/MetadataTableType.js +11 -0
- package/driver/types/MetadataTableType.js.map +1 -0
- package/find-options/FindConditions.d.ts +6 -2
- package/find-options/FindConditions.js.map +1 -1
- package/find-options/FindTreeOptions.d.ts +5 -1
- package/find-options/FindTreeOptions.js.map +1 -1
- package/migration/MigrationExecutor.js +55 -48
- package/migration/MigrationExecutor.js.map +1 -1
- package/package.json +1 -1
- package/query-builder/SelectQueryBuilder.d.ts +1 -1
- package/query-builder/SelectQueryBuilder.js +4 -20
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-runner/BaseQueryRunner.d.ts +22 -0
- package/query-runner/BaseQueryRunner.js +34 -0
- package/query-runner/BaseQueryRunner.js.map +1 -1
- package/repository/FindTreesOptions.d.ts +9 -0
- package/repository/FindTreesOptions.js +4 -0
- package/repository/FindTreesOptions.js.map +1 -0
- package/repository/TreeRepository.d.ts +4 -1
- package/repository/TreeRepository.js +7 -3
- package/repository/TreeRepository.js.map +1 -1
- package/schema-builder/RdbmsSchemaBuilder.d.ts +5 -1
- package/schema-builder/RdbmsSchemaBuilder.js +58 -49
- 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":["../browser/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":["../browser/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":"../.."}
|
|
@@ -16,6 +16,7 @@ import { BaseQueryRunner } from "../../query-runner/BaseQueryRunner";
|
|
|
16
16
|
import { Broadcaster } from "../../subscriber/Broadcaster";
|
|
17
17
|
import { VersionUtils } from "../../util/VersionUtils";
|
|
18
18
|
import { TypeORMError } from "../../error";
|
|
19
|
+
import { MetadataTableType } from "../types/MetadataTableType";
|
|
19
20
|
/**
|
|
20
21
|
* Runs queries on a single mysql database connection.
|
|
21
22
|
*/
|
|
@@ -1714,7 +1715,7 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1714
1715
|
return "(`t`.`schema` = '" + database + "' AND `t`.`name` = '" + name + "')";
|
|
1715
1716
|
}).join(" OR ");
|
|
1716
1717
|
query = "SELECT `t`.*, `v`.`check_option` FROM " + this.escapePath(this.getTypeormMetadataTableName()) + " `t` " +
|
|
1717
|
-
("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 + ")" : ""));
|
|
1718
|
+
("INNER JOIN `information_schema`.`views` `v` ON `v`.`table_schema` = `t`.`schema` AND `v`.`table_name` = `t`.`name` WHERE `t`.`type` = '" + MetadataTableType.VIEW + "' " + (viewsCondition ? "AND (" + viewsCondition + ")" : ""));
|
|
1718
1719
|
return [4 /*yield*/, this.query(query)];
|
|
1719
1720
|
case 3:
|
|
1720
1721
|
dbViews = _a.sent();
|
|
@@ -1826,23 +1827,23 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1826
1827
|
table.columns = dbColumns
|
|
1827
1828
|
.filter(function (dbColumn) { return dbColumn["TABLE_NAME"] === dbTable["TABLE_NAME"] && dbColumn["TABLE_SCHEMA"] === dbTable["TABLE_SCHEMA"]; })
|
|
1828
1829
|
.map(function (dbColumn) {
|
|
1829
|
-
var
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
if (dbIndex["COLUMN_NAME"] !== dbColumn["COLUMN_NAME"]) {
|
|
1835
|
-
return false;
|
|
1836
|
-
}
|
|
1837
|
-
var nonUnique = parseInt(dbIndex["NON_UNIQUE"], 10);
|
|
1838
|
-
return nonUnique === 0;
|
|
1830
|
+
var columnUniqueIndices = dbIndices.filter(function (dbIndex) {
|
|
1831
|
+
return dbIndex["TABLE_NAME"] === dbTable["TABLE_NAME"]
|
|
1832
|
+
&& dbIndex["TABLE_SCHEMA"] === dbTable["TABLE_SCHEMA"]
|
|
1833
|
+
&& dbIndex["COLUMN_NAME"] === dbColumn["COLUMN_NAME"]
|
|
1834
|
+
&& parseInt(dbIndex["NON_UNIQUE"], 10) === 0;
|
|
1839
1835
|
});
|
|
1840
1836
|
var tableMetadata = _this.connection.entityMetadatas.find(function (metadata) { return _this.getTablePath(table) === _this.getTablePath(metadata); });
|
|
1841
|
-
var hasIgnoredIndex =
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1837
|
+
var hasIgnoredIndex = columnUniqueIndices.length > 0
|
|
1838
|
+
&& tableMetadata
|
|
1839
|
+
&& tableMetadata.indices.some(function (index) {
|
|
1840
|
+
return columnUniqueIndices.some(function (uniqueIndex) {
|
|
1841
|
+
return index.name === uniqueIndex["INDEX_NAME"] && index.synchronize === false;
|
|
1842
|
+
});
|
|
1843
|
+
});
|
|
1844
|
+
var isConstraintComposite = columnUniqueIndices.every(function (uniqueIndex) {
|
|
1845
|
+
return dbIndices.some(function (dbIndex) { return dbIndex["INDEX_NAME"] === uniqueIndex["INDEX_NAME"] && dbIndex["COLUMN_NAME"] !== dbColumn["COLUMN_NAME"]; });
|
|
1846
|
+
});
|
|
1846
1847
|
var tableColumn = new TableColumn();
|
|
1847
1848
|
tableColumn.name = dbColumn["COLUMN_NAME"];
|
|
1848
1849
|
tableColumn.type = dbColumn["DATA_TYPE"].toLowerCase();
|
|
@@ -1879,7 +1880,7 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1879
1880
|
tableColumn.asExpression = dbColumn["GENERATION_EXPRESSION"];
|
|
1880
1881
|
tableColumn.generatedType = dbColumn["EXTRA"].indexOf("VIRTUAL") !== -1 ? "VIRTUAL" : "STORED";
|
|
1881
1882
|
}
|
|
1882
|
-
tableColumn.isUnique =
|
|
1883
|
+
tableColumn.isUnique = columnUniqueIndices.length > 0 && !hasIgnoredIndex && !isConstraintComposite;
|
|
1883
1884
|
tableColumn.isNullable = dbColumn["IS_NULLABLE"] === "YES";
|
|
1884
1885
|
tableColumn.isPrimary = dbPrimaryKeys.some(function (dbPrimaryKey) {
|
|
1885
1886
|
return (dbPrimaryKey["TABLE_NAME"] === dbColumn["TABLE_NAME"] &&
|
|
@@ -2055,19 +2056,19 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
2055
2056
|
};
|
|
2056
2057
|
MysqlQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2057
2058
|
return __awaiter(this, void 0, void 0, function () {
|
|
2058
|
-
var currentDatabase, expression
|
|
2059
|
-
return __generator(this, function (
|
|
2060
|
-
switch (
|
|
2059
|
+
var currentDatabase, expression;
|
|
2060
|
+
return __generator(this, function (_a) {
|
|
2061
|
+
switch (_a.label) {
|
|
2061
2062
|
case 0: return [4 /*yield*/, this.getCurrentDatabase()];
|
|
2062
2063
|
case 1:
|
|
2063
|
-
currentDatabase =
|
|
2064
|
+
currentDatabase = _a.sent();
|
|
2064
2065
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2066
|
+
return [2 /*return*/, this.insertTypeormMetadataSql({
|
|
2067
|
+
type: MetadataTableType.VIEW,
|
|
2068
|
+
schema: currentDatabase,
|
|
2069
|
+
name: view.name,
|
|
2070
|
+
value: expression
|
|
2071
|
+
})];
|
|
2071
2072
|
}
|
|
2072
2073
|
});
|
|
2073
2074
|
});
|
|
@@ -2083,21 +2084,18 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
2083
2084
|
*/
|
|
2084
2085
|
MysqlQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
|
|
2085
2086
|
return __awaiter(this, void 0, void 0, function () {
|
|
2086
|
-
var currentDatabase, viewName
|
|
2087
|
-
return __generator(this, function (
|
|
2088
|
-
switch (
|
|
2087
|
+
var currentDatabase, viewName;
|
|
2088
|
+
return __generator(this, function (_a) {
|
|
2089
|
+
switch (_a.label) {
|
|
2089
2090
|
case 0: return [4 /*yield*/, this.getCurrentDatabase()];
|
|
2090
2091
|
case 1:
|
|
2091
|
-
currentDatabase =
|
|
2092
|
+
currentDatabase = _a.sent();
|
|
2092
2093
|
viewName = viewOrPath instanceof View ? viewOrPath.name : viewOrPath;
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
.andWhere(qb.escape("name") + " = :name", { name: viewName })
|
|
2099
|
-
.getQueryAndParameters(), 2), query = _a[0], parameters = _a[1];
|
|
2100
|
-
return [2 /*return*/, new Query(query, parameters)];
|
|
2094
|
+
return [2 /*return*/, this.deleteTypeormMetadataSql({
|
|
2095
|
+
type: MetadataTableType.VIEW,
|
|
2096
|
+
schema: currentDatabase,
|
|
2097
|
+
name: viewName
|
|
2098
|
+
})];
|
|
2101
2099
|
}
|
|
2102
2100
|
});
|
|
2103
2101
|
});
|