Comparing version
@@ -232,3 +232,3 @@ import { MssqlParameter } from "../driver/sqlserver/MssqlParameter"; | ||
async remove(identifiers, queryRunner) { | ||
let _queryRunner = queryRunner || this.getQueryRunner(); | ||
const _queryRunner = queryRunner || this.getQueryRunner(); | ||
await Promise.all(identifiers.map((identifier) => { | ||
@@ -235,0 +235,0 @@ const qb = _queryRunner.manager.createQueryBuilder(); |
import appRootPath from "app-root-path"; | ||
import path from "path"; | ||
import { TypeORMError } from "../error"; | ||
import { PlatformTools } from "../platform/PlatformTools"; | ||
import { importOrRequireFile } from "../util/ImportUtils"; | ||
import { isAbsolute } from "../util/PathUtils"; | ||
import { ConnectionOptionsEnvReader } from "./options-reader/ConnectionOptionsEnvReader"; | ||
import { TypeORMError } from "../error"; | ||
import { isAbsolute } from "../util/PathUtils"; | ||
import { importOrRequireFile } from "../util/ImportUtils"; | ||
/** | ||
@@ -183,5 +183,3 @@ * Reads connection options from the ormconfig. | ||
get baseDirectory() { | ||
if (this.options && this.options.root) | ||
return this.options.root; | ||
return appRootPath.path; | ||
return this.options?.root ?? appRootPath.path; | ||
} | ||
@@ -192,5 +190,3 @@ /** | ||
get baseConfigName() { | ||
if (this.options && this.options.configName) | ||
return this.options.configName; | ||
return "ormconfig"; | ||
return this.options?.configName ?? "ormconfig"; | ||
} | ||
@@ -197,0 +193,0 @@ } |
@@ -417,3 +417,3 @@ import { registerQueryBuilders } from "../query-builder"; | ||
return metadataFromMap; | ||
for (let [_, metadata] of this.entityMetadatasMap) { | ||
for (const [_, metadata] of this.entityMetadatasMap) { | ||
if (InstanceChecker.isEntitySchema(target) && | ||
@@ -477,3 +477,3 @@ metadata.name === target.options.name) { | ||
// set current data source to the entities | ||
for (let entityMetadata of entityMetadatas) { | ||
for (const entityMetadata of entityMetadatas) { | ||
if (InstanceChecker.isBaseEntityConstructor(entityMetadata.target)) { | ||
@@ -480,0 +480,0 @@ entityMetadata.target.useDataSource(this); |
@@ -5,4 +5,5 @@ import { SelectQueryBuilder } from "../../query-builder/SelectQueryBuilder"; | ||
* | ||
* @deprecated Do not use this decorator, it may be removed in the future versions | ||
* @deprecated This decorator will removed in the future versions. | ||
* Use {@link VirtualColumn} to calculate the count instead. | ||
*/ | ||
export declare function RelationCount<T>(relation: string | ((object: T) => any), alias?: string, queryBuilderFactory?: (qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>): PropertyDecorator; |
@@ -5,3 +5,4 @@ import { getMetadataArgsStorage } from "../../globals"; | ||
* | ||
* @deprecated Do not use this decorator, it may be removed in the future versions | ||
* @deprecated This decorator will removed in the future versions. | ||
* Use {@link VirtualColumn} to calculate the count instead. | ||
*/ | ||
@@ -8,0 +9,0 @@ export function RelationCount(relation, alias, queryBuilderFactory) { |
@@ -272,3 +272,3 @@ import { DriverUtils } from "../DriverUtils"; | ||
if (!this.database) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
const queryRunner = this.createQueryRunner("master"); | ||
this.database = await queryRunner.getCurrentDatabase(); | ||
@@ -312,3 +312,3 @@ await queryRunner.release(); | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -341,3 +341,3 @@ return value | ||
buildTableName(tableName, schema, database) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (database) { | ||
@@ -344,0 +344,0 @@ tablePath.unshift(database); |
@@ -207,3 +207,3 @@ import { TypeORMError } from "../../error"; | ||
if (!this.database || !this.searchSchema) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
const queryRunner = this.createQueryRunner("master"); | ||
if (!this.database) { | ||
@@ -338,3 +338,3 @@ this.database = await queryRunner.getCurrentDatabase(); | ||
value = value | ||
.substr(1, value.length - 2) | ||
.slice(1, -1) | ||
.split(",") | ||
@@ -345,6 +345,4 @@ .map((val) => { | ||
val = val.slice(1, -1); | ||
// replace double escaped backslash to single escaped e.g. \\\\ -> \\ | ||
val = val.replace(/(\\\\)/g, "\\"); | ||
// replace escaped double quotes to non-escaped e.g. \"asd\" -> "asd" | ||
return val.replace(/(\\")/g, '"'); | ||
// replace escaped backslash and double quotes | ||
return val.replace(/\\(\\|")/g, "$1"); | ||
}); | ||
@@ -388,3 +386,3 @@ // convert to number if that exists in possible enum options | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -418,3 +416,3 @@ return value | ||
buildTableName(tableName, schema) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (schema) { | ||
@@ -421,0 +419,0 @@ tablePath.unshift(schema); |
@@ -298,3 +298,3 @@ import { QueryRunner } from "../../query-runner/QueryRunner"; | ||
*/ | ||
protected getVersion(): Promise<string>; | ||
getVersion(): Promise<string>; | ||
/** | ||
@@ -301,0 +301,0 @@ * Builds drop table sql. |
@@ -62,3 +62,3 @@ import { QueryRunnerAlreadyReleasedError } from "../../error/QueryRunnerAlreadyReleasedError"; | ||
else { | ||
let resultSet = []; | ||
const resultSet = []; | ||
for (let i = 0; i < raw.rows.length; i++) { | ||
@@ -65,0 +65,0 @@ resultSet.push(raw.rows.item(i)); |
@@ -32,4 +32,3 @@ import { hash, shorten } from "../util/StringUtils"; | ||
static isReleaseVersionOrGreater(driver, version) { | ||
return (driver.version != null && | ||
VersionUtils.isGreaterOrEqual(driver.version, version)); | ||
return VersionUtils.isGreaterOrEqual(driver.version, version); | ||
} | ||
@@ -95,3 +94,3 @@ static isPostgresFamily(driver) { | ||
const joiner = buildOptions && buildOptions.joiner ? buildOptions.joiner : "_"; | ||
let newAlias = alias.length === 1 ? alias[0] : alias.join(joiner); | ||
const newAlias = alias.length === 1 ? alias[0] : alias.join(joiner); | ||
if (maxAliasLength && | ||
@@ -175,3 +174,3 @@ maxAliasLength > 0 && | ||
let replicaSet = undefined; | ||
let optionsObject = {}; | ||
const optionsObject = {}; | ||
if (afterBase && afterBase.indexOf("?") !== -1) { | ||
@@ -211,3 +210,3 @@ // split params | ||
} | ||
let connectionUrl = { | ||
const connectionUrl = { | ||
type: type, | ||
@@ -214,0 +213,0 @@ host: host, |
@@ -131,3 +131,3 @@ import { QueryRunnerAlreadyReleasedError } from "../../error/QueryRunnerAlreadyReleasedError"; | ||
if (raw?.hasOwnProperty("rows")) { | ||
let resultSet = []; | ||
const resultSet = []; | ||
for (let i = 0; i < raw.rows.length; i++) { | ||
@@ -134,0 +134,0 @@ resultSet.push(raw.rows.item(i)); |
@@ -5,3 +5,2 @@ import { BaseDataSourceOptions } from "../../data-source/BaseDataSourceOptions"; | ||
* MongoDB specific connection options. | ||
* Synced with http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html | ||
*/ | ||
@@ -42,6 +41,2 @@ export interface MongoConnectionOptions extends BaseDataSourceOptions { | ||
/** | ||
* Specifies whether to force dispatch all operations to the specified host. Default: false | ||
*/ | ||
readonly directConnection?: boolean; | ||
/** | ||
* The driver object | ||
@@ -52,234 +47,208 @@ * This defaults to require("mongodb") | ||
/** | ||
* Use ssl connection (needs to have a mongod server with ssl support). Default: false | ||
* MongoClientOptions | ||
* Synced with https://mongodb.github.io/node-mongodb-native/5.9/interfaces/MongoClientOptions.html | ||
*/ | ||
readonly ssl?: boolean; | ||
/** | ||
* Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher). | ||
* Default: true | ||
* 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 | ||
*/ | ||
readonly sslValidate?: boolean; | ||
readonly appName?: string; | ||
/** | ||
* Array of valid certificates either as Buffers or Strings | ||
* (needs to have a mongod server with ssl support, 2.4 or higher). | ||
* Specify the authentication mechanism that MongoDB will use to authenticate the connection. | ||
*/ | ||
readonly sslCA?: string | Buffer; | ||
readonly authMechanism?: string; | ||
/** | ||
* String or buffer containing the certificate we wish to present | ||
* (needs to have a mongod server with ssl support, 2.4 or higher) | ||
* Specify the database name associated with the user’s credentials. | ||
*/ | ||
readonly sslCert?: string | Buffer; | ||
readonly authSource?: string; | ||
/** | ||
* String or buffer containing the certificate private key we wish to present | ||
* (needs to have a mongod server with ssl support, 2.4 or higher) | ||
* Optionally enable in-use auto encryption | ||
*/ | ||
readonly sslKey?: string; | ||
readonly autoEncryption?: any; | ||
/** | ||
* String or buffer containing the certificate password | ||
* (needs to have a mongod server with ssl support, 2.4 or higher) | ||
* Verifies the certificate `cert` is issued to `hostname`. | ||
*/ | ||
readonly sslPass?: string | Buffer; | ||
readonly checkServerIdentity?: Function; | ||
/** | ||
* SSL Certificate revocation list binary buffer | ||
* (needs to have a mongod server with ssl support, 2.4 or higher) | ||
* An array or comma-delimited string of compressors to enable network | ||
* compression for communication between this client and a mongod/mongos instance. | ||
*/ | ||
readonly sslCRL?: string | Buffer; | ||
readonly compressors?: string | string[]; | ||
/** | ||
* Reconnect on error. Default: true | ||
* The time in milliseconds to attempt a connection before timing out. | ||
*/ | ||
readonly autoReconnect?: boolean; | ||
readonly connectTimeoutMS?: number; | ||
/** | ||
* TCP Socket NoDelay option. Default: true | ||
* Allow a driver to force a Single topology type with a connection string containing one host | ||
*/ | ||
readonly noDelay?: boolean; | ||
readonly directConnection?: boolean; | ||
/** | ||
* The number of milliseconds to wait before initiating keepAlive on the TCP socket. Default: 30000 | ||
* IP family | ||
*/ | ||
readonly keepAlive?: number; | ||
/** | ||
* TCP Connection timeout setting. Default: 30000 | ||
*/ | ||
readonly connectTimeoutMS?: number; | ||
/** | ||
* Version of IP stack. Can be 4, 6. | ||
* If undefined, will attempt to connect with IPv6, and will fall back to IPv4 on failure | ||
*/ | ||
readonly family?: number; | ||
/** | ||
* TCP Socket timeout setting. Default: 360000 | ||
* Force server to assign `_id` values instead of driver | ||
*/ | ||
readonly socketTimeoutMS?: number; | ||
readonly forceServerObjectId?: boolean; | ||
/** | ||
* Server attempt to reconnect #times. Default 30 | ||
* serialize will not emit undefined fields | ||
* note that the driver sets this to `false` | ||
*/ | ||
readonly reconnectTries?: number; | ||
readonly ignoreUndefined?: boolean; | ||
/** | ||
* Server will wait #milliseconds between retries. Default 1000 | ||
* @deprecated TCP Connection keep alive enabled. Will not be able to turn off in the future. | ||
*/ | ||
readonly reconnectInterval?: number; | ||
readonly keepAlive?: boolean; | ||
/** | ||
* Control if high availability monitoring runs for Replicaset or Mongos proxies. Default true | ||
* @deprecated The number of milliseconds to wait before initiating keepAlive on the TCP socket. | ||
* Will not be configurable in the future. | ||
*/ | ||
readonly ha?: boolean; | ||
readonly keepAliveInitialDelay?: number; | ||
/** | ||
* The High availability period for replicaset inquiry. Default: 10000 | ||
* The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. | ||
*/ | ||
readonly haInterval?: number; | ||
readonly localThresholdMS?: number; | ||
/** | ||
* The name of the replicaset to connect to | ||
* Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations. | ||
*/ | ||
readonly replicaSet?: string; | ||
readonly maxStalenessSeconds?: number; | ||
/** | ||
* Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms). | ||
* Default: 15 | ||
* The minimum number of connections in the connection pool. | ||
*/ | ||
readonly acceptableLatencyMS?: number; | ||
readonly minPoolSize?: number; | ||
/** | ||
* Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms). | ||
* Default: 15 | ||
* Enable command monitoring for this client | ||
*/ | ||
readonly secondaryAcceptableLatencyMS?: number; | ||
readonly monitorCommands?: boolean; | ||
/** | ||
* Sets if the driver should connect even if no primary is available. Default: false | ||
* TCP Connection no delay | ||
*/ | ||
readonly connectWithNoPrimary?: boolean; | ||
readonly noDelay?: boolean; | ||
/** | ||
* If the database authentication is dependent on another databaseName. | ||
* A primary key factory function for generation of custom `_id` keys | ||
*/ | ||
readonly authSource?: string; | ||
readonly pkFactory?: any; | ||
/** | ||
* The write concern. | ||
* when deserializing a Binary will return it as a node.js Buffer instance. | ||
*/ | ||
readonly w?: string | number; | ||
readonly promoteBuffers?: boolean; | ||
/** | ||
* The write concern timeout value. | ||
* when deserializing a Long will fit it into a Number if it's smaller than 53 bits. | ||
*/ | ||
readonly wtimeout?: number; | ||
/** | ||
* Specify a journal write concern. Default: false | ||
*/ | ||
readonly j?: boolean; | ||
/** | ||
* Force server to assign _id values instead of driver. Default: false | ||
*/ | ||
readonly forceServerObjectId?: boolean; | ||
/** | ||
* Serialize functions on any object. Default: false | ||
*/ | ||
readonly serializeFunctions?: boolean; | ||
/** | ||
* Specify if the BSON serializer should ignore undefined fields. Default: false | ||
*/ | ||
readonly ignoreUndefined?: boolean; | ||
/** | ||
* Return document results as raw BSON buffers. Default: false | ||
*/ | ||
readonly raw?: boolean; | ||
/** | ||
* Promotes Long values to number if they fit inside the 53 bits resolution. Default: true | ||
*/ | ||
readonly promoteLongs?: boolean; | ||
/** | ||
* Promotes Binary BSON values to native Node Buffers. Default: false | ||
* when deserializing will promote BSON values to their Node.js closest equivalent types. | ||
*/ | ||
readonly promoteBuffers?: boolean; | ||
/** | ||
* Promotes BSON values to native types where possible, set to false to only receive wrapper types. Default: true | ||
*/ | ||
readonly promoteValues?: boolean; | ||
/** | ||
* Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit. Default: false | ||
* Enabling the raw option will return a Node.js Buffer which is allocated using allocUnsafe API | ||
*/ | ||
readonly domainsEnabled?: boolean; | ||
readonly raw?: boolean; | ||
/** | ||
* Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, | ||
* default is -1 which is unlimited. | ||
* Specify a read concern for the collection (only MongoDB 3.2 or higher supported) | ||
*/ | ||
readonly bufferMaxEntries?: number; | ||
readonly readConcern?: any; | ||
/** | ||
* The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, | ||
* ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). | ||
* Specifies the read preferences for this connection | ||
*/ | ||
readonly readPreference?: ReadPreference | string; | ||
/** | ||
* A primary key factory object for generation of custom _id keys. | ||
* Specifies the tags document as a comma-separated list of colon-separated key-value pairs. | ||
*/ | ||
readonly pkFactory?: any; | ||
readonly readPreferenceTags?: any[]; | ||
/** | ||
* A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible. | ||
* Specifies the name of the replica set, if the mongod is a member of a replica set. | ||
*/ | ||
readonly promiseLibrary?: any; | ||
readonly replicaSet?: string; | ||
/** | ||
* Specify a read concern for the collection. (only MongoDB 3.2 or higher supported). | ||
* Enable retryable writes. | ||
*/ | ||
readonly readConcern?: any; | ||
readonly retryWrites?: boolean; | ||
/** | ||
* Specify a maxStalenessSeconds value for secondary reads, minimum is 90 seconds | ||
* serialize the javascript functions | ||
*/ | ||
readonly maxStalenessSeconds?: number; | ||
readonly serializeFunctions?: boolean; | ||
/** | ||
* Specify the log level used by the driver logger (error/warn/info/debug). | ||
* The time in milliseconds to attempt a send or receive on a socket before the attempt times out. | ||
*/ | ||
readonly loggerLevel?: "error" | "warn" | "info" | "debug"; | ||
readonly socketTimeoutMS?: number; | ||
/** | ||
* 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 | ||
* Default: true | ||
* @deprecated A boolean to enable or disables TLS/SSL for the connection. | ||
* (The ssl option is equivalent to the tls option.) | ||
*/ | ||
readonly checkServerIdentity?: boolean | Function; | ||
readonly ssl?: boolean; | ||
/** | ||
* Validate MongoClient passed in options for correctness. Default: false | ||
* @deprecated SSL Root Certificate file path. | ||
* | ||
* Will be removed in the next major version. Please use tlsCAFile instead. | ||
*/ | ||
readonly validateOptions?: boolean | any; | ||
readonly sslCA?: string; | ||
/** | ||
* 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 | ||
* @deprecated SSL Certificate revocation list file path. | ||
* | ||
* Will be removed in the next major version. | ||
*/ | ||
readonly appname?: string; | ||
readonly sslCRL?: string; | ||
/** | ||
* Sets the authentication mechanism that MongoDB will use to authenticate the connection | ||
* @deprecated SSL Certificate file path. | ||
* | ||
* Will be removed in the next major version. Please use tlsCertificateKeyFile instead. | ||
*/ | ||
readonly authMechanism?: string; | ||
readonly sslCert?: string; | ||
/** | ||
* Type of compression to use: snappy or zlib | ||
* @deprecated SSL Key file file path. | ||
* | ||
* Will be removed in the next major version. Please use tlsCertificateKeyFile instead. | ||
*/ | ||
readonly compression?: any; | ||
readonly sslKey?: string; | ||
/** | ||
* Specify a file sync write concern. Default: false | ||
* @deprecated SSL Certificate pass phrase. | ||
* | ||
* Will be removed in the next major version. Please use tlsCertificateKeyFilePassword instead. | ||
*/ | ||
readonly fsync?: boolean; | ||
readonly sslPass?: string; | ||
/** | ||
* Read preference tags | ||
* @deprecated Validate mongod server certificate against Certificate Authority | ||
* | ||
* Will be removed in the next major version. Please use tlsAllowInvalidCertificates instead. | ||
*/ | ||
readonly readPreferenceTags?: any[]; | ||
readonly sslValidate?: boolean; | ||
/** | ||
* The number of retries for a tailable cursor. Default: 5 | ||
* Enables or disables TLS/SSL for the connection. | ||
*/ | ||
readonly numberOfRetries?: number; | ||
readonly tls?: boolean; | ||
/** | ||
* Enable auto reconnecting for single server instances. Default: true | ||
* Bypasses validation of the certificates presented by the mongod/mongos instance | ||
*/ | ||
readonly auto_reconnect?: boolean; | ||
readonly tlsAllowInvalidCertificates?: boolean; | ||
/** | ||
* Enable command monitoring for this client. Default: false | ||
* Specifies the location of a local .pem file that contains the root certificate chain from the Certificate Authority. | ||
*/ | ||
readonly monitorCommands?: boolean; | ||
readonly tlsCAFile?: string; | ||
/** | ||
* If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections | ||
* Specifies the location of a local .pem file that contains the client's TLS/SSL certificate and key. | ||
*/ | ||
readonly minSize?: number; | ||
readonly tlsCertificateKeyFile?: string; | ||
/** | ||
* Determines whether or not to use the new url parser. Default: false | ||
* Specifies the password to de-crypt the tlsCertificateKeyFile. | ||
*/ | ||
readonly useNewUrlParser?: boolean; | ||
readonly tlsCertificateKeyFilePassword?: string; | ||
/** | ||
* Determines whether or not to use the new Server Discovery and Monitoring engine. Default: false | ||
* https://github.com/mongodb/node-mongodb-native/releases/tag/v3.2.1 | ||
* @deprecated The write concern w value | ||
* | ||
* Please use the `writeConcern` option instead | ||
*/ | ||
readonly useUnifiedTopology?: boolean; | ||
readonly w?: string | number; | ||
/** | ||
* Automatic Client-Side Field Level Encryption configuration. | ||
* A MongoDB WriteConcern, which describes the level of acknowledgement | ||
* requested from MongoDB for write operations. | ||
*/ | ||
readonly autoEncryption?: any; | ||
readonly writeConcern?: any; | ||
/** | ||
* Enables or disables the ability to retry writes upon encountering transient network errors. | ||
* @deprecated The write concern timeout | ||
* | ||
* Please use the `writeConcern` option instead | ||
*/ | ||
readonly retryWrites?: boolean; | ||
readonly wtimeoutMS?: number; | ||
} |
@@ -92,9 +92,8 @@ import { Driver } from "../Driver"; | ||
maxAliasLength?: number; | ||
cteCapabilities: CteCapabilities; | ||
/** | ||
* Valid mongo connection options | ||
* NOTE: Keep sync with MongoConnectionOptions | ||
* Sync with http://mongodb.github.io/node-mongodb-native/3.5/api/MongoClient.html | ||
* NOTE: Keep in sync with MongoConnectionOptions | ||
*/ | ||
protected validOptionNames: string[]; | ||
cteCapabilities: CteCapabilities; | ||
constructor(connection: DataSource); | ||
@@ -101,0 +100,0 @@ /** |
@@ -80,2 +80,5 @@ import { ConnectionIsNotSetError } from "../../error/ConnectionIsNotSetError"; | ||
}; | ||
this.cteCapabilities = { | ||
enabled: false, | ||
}; | ||
// ------------------------------------------------------------------------- | ||
@@ -86,73 +89,59 @@ // Protected Properties | ||
* Valid mongo connection options | ||
* NOTE: Keep sync with MongoConnectionOptions | ||
* Sync with http://mongodb.github.io/node-mongodb-native/3.5/api/MongoClient.html | ||
* NOTE: Keep in sync with MongoConnectionOptions | ||
*/ | ||
this.validOptionNames = [ | ||
"poolSize", | ||
"appName", | ||
"authMechanism", | ||
"authSource", | ||
"autoEncryption", | ||
"checkServerIdentity", | ||
"compressors", | ||
"connectTimeoutMS", | ||
"directConnection", | ||
"family", | ||
"forceServerObjectId", | ||
"ignoreUndefined", | ||
"keepAlive", | ||
"keepAliveInitialDelay", | ||
"localThresholdMS", | ||
"maxStalenessSeconds", | ||
"minPoolSize", | ||
"monitorCommands", | ||
"noDelay", | ||
"pkFactory", | ||
"promoteBuffers", | ||
"promoteLongs", | ||
"promoteValues", | ||
"raw", | ||
"readConcern", | ||
"readPreference", | ||
"readPreferenceTags", | ||
"replicaSet", | ||
"retryWrites", | ||
"serializeFunctions", | ||
"socketTimeoutMS", | ||
"ssl", | ||
"sslValidate", | ||
"sslCA", | ||
"sslCRL", | ||
"sslCert", | ||
"sslKey", | ||
"sslPass", | ||
"sslCRL", | ||
"autoReconnect", | ||
"noDelay", | ||
"keepAlive", | ||
"keepAliveInitialDelay", | ||
"connectTimeoutMS", | ||
"family", | ||
"socketTimeoutMS", | ||
"reconnectTries", | ||
"reconnectInterval", | ||
"ha", | ||
"haInterval", | ||
"replicaSet", | ||
"secondaryAcceptableLatencyMS", | ||
"acceptableLatencyMS", | ||
"connectWithNoPrimary", | ||
"authSource", | ||
"sslValidate", | ||
"tls", | ||
"tlsAllowInvalidCertificates", | ||
"tlsCAFile", | ||
"tlsCertificateKeyFile", | ||
"tlsCertificateKeyFilePassword", | ||
"w", | ||
"wtimeout", | ||
"j", | ||
"writeConcern", | ||
"forceServerObjectId", | ||
"serializeFunctions", | ||
"ignoreUndefined", | ||
"raw", | ||
"bufferMaxEntries", | ||
"readPreference", | ||
"pkFactory", | ||
"promiseLibrary", | ||
"readConcern", | ||
"maxStalenessSeconds", | ||
"loggerLevel", | ||
// Do not overwrite BaseDataSourceOptions.logger | ||
// "logger", | ||
"promoteValues", | ||
"promoteBuffers", | ||
"promoteLongs", | ||
"domainsEnabled", | ||
"checkServerIdentity", | ||
"validateOptions", | ||
"wtimeoutMS", | ||
// Undocumented deprecated options | ||
// todo: remove next major version | ||
"appname", | ||
// omit auth - we are building url from username and password | ||
// "auth" | ||
"authMechanism", | ||
"compression", | ||
"fsync", | ||
"readPreferenceTags", | ||
"numberOfRetries", | ||
"auto_reconnect", | ||
"minSize", | ||
"monitorCommands", | ||
"j", | ||
"useNewUrlParser", | ||
"useUnifiedTopology", | ||
"autoEncryption", | ||
"retryWrites", | ||
"directConnection", | ||
"wtimeout", | ||
]; | ||
this.cteCapabilities = { | ||
enabled: false, | ||
}; | ||
this.options = connection.options; | ||
@@ -385,6 +374,6 @@ // validate options to make sure everything is correct and driver will be able to establish connection | ||
options.host + portUrlPart || | ||
"127.0.0.1" + portUrlPart}/${options.database || ""}?replicaSet=${options.replicaSet}${options.tls ? "&tls=true" : ""}`; | ||
"127.0.0.1" + portUrlPart}/${options.database || ""}`; | ||
} | ||
else { | ||
connectionString = `${schemaUrlPart}://${credentialsUrlPart}${options.host || "127.0.0.1"}${portUrlPart}/${options.database || ""}${options.tls ? "?tls=true" : ""}`; | ||
connectionString = `${schemaUrlPart}://${credentialsUrlPart}${options.host || "127.0.0.1"}${portUrlPart}/${options.database || ""}`; | ||
} | ||
@@ -398,11 +387,14 @@ return connectionString; | ||
const mongoOptions = {}; | ||
for (let index = 0; index < this.validOptionNames.length; index++) { | ||
const optionName = this.validOptionNames[index]; | ||
if (options.extra && optionName in options.extra) { | ||
mongoOptions[optionName] = options.extra[optionName]; | ||
} | ||
else if (optionName in options) { | ||
for (const optionName of this.validOptionNames) { | ||
if (optionName in options) { | ||
mongoOptions[optionName] = options[optionName]; | ||
} | ||
} | ||
mongoOptions.driverInfo = { | ||
name: "TypeORM", | ||
}; | ||
if ("poolSize" in options) { | ||
mongoOptions["maxPoolSize"] = options["poolSize"]; | ||
} | ||
Object.assign(mongoOptions, options.extra); | ||
return mongoOptions; | ||
@@ -409,0 +401,0 @@ } |
@@ -305,3 +305,3 @@ import { ConnectionIsNotSetError } from "../../error/ConnectionIsNotSetError"; | ||
if (!this.database) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
const queryRunner = this.createQueryRunner("master"); | ||
this.database = await queryRunner.getCurrentDatabase(); | ||
@@ -311,17 +311,15 @@ await queryRunner.release(); | ||
const queryRunner = this.createQueryRunner("master"); | ||
const result = await queryRunner.query(`SELECT VERSION() AS \`version\``); | ||
const dbVersion = result[0].version; | ||
this.version = dbVersion; | ||
this.version = await queryRunner.getVersion(); | ||
await queryRunner.release(); | ||
if (this.options.type === "mariadb") { | ||
if (VersionUtils.isGreaterOrEqual(dbVersion, "10.0.5")) { | ||
if (VersionUtils.isGreaterOrEqual(this.version, "10.0.5")) { | ||
this._isReturningSqlSupported.delete = true; | ||
} | ||
if (VersionUtils.isGreaterOrEqual(dbVersion, "10.5.0")) { | ||
if (VersionUtils.isGreaterOrEqual(this.version, "10.5.0")) { | ||
this._isReturningSqlSupported.insert = true; | ||
} | ||
if (VersionUtils.isGreaterOrEqual(dbVersion, "10.2.0")) { | ||
if (VersionUtils.isGreaterOrEqual(this.version, "10.2.0")) { | ||
this.cteCapabilities.enabled = true; | ||
} | ||
if (VersionUtils.isGreaterOrEqual(dbVersion, "10.7.0")) { | ||
if (VersionUtils.isGreaterOrEqual(this.version, "10.7.0")) { | ||
this.uuidColumnTypeSuported = true; | ||
@@ -331,3 +329,3 @@ } | ||
else if (this.options.type === "mysql") { | ||
if (VersionUtils.isGreaterOrEqual(dbVersion, "8.0.0")) { | ||
if (VersionUtils.isGreaterOrEqual(this.version, "8.0.0")) { | ||
this.cteCapabilities.enabled = true; | ||
@@ -390,3 +388,3 @@ } | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -419,3 +417,3 @@ return value | ||
buildTableName(tableName, schema, database) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (database) { | ||
@@ -584,3 +582,3 @@ tablePath.unshift(database); | ||
this.options.type === "mariadb" && | ||
!VersionUtils.isGreaterOrEqual(this.version ?? "0.0.0", "10.4.3")) { | ||
!VersionUtils.isGreaterOrEqual(this.version, "10.4.3")) { | ||
/* | ||
@@ -587,0 +585,0 @@ * MariaDB implements this as a LONGTEXT rather, as the JSON data type contradicts the SQL standard, |
@@ -327,3 +327,3 @@ import { QueryRunner } from "../../query-runner/QueryRunner"; | ||
protected buildCreateColumnSql(column: TableColumn, skipPrimary: boolean, skipName?: boolean): string; | ||
protected getVersion(): Promise<string>; | ||
getVersion(): Promise<string>; | ||
/** | ||
@@ -330,0 +330,0 @@ * Checks if column display width is by default. |
@@ -232,3 +232,3 @@ import { ConnectionIsNotSetError } from "../../error/ConnectionIsNotSetError"; | ||
if (!this.database || !this.schema) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
const queryRunner = this.createQueryRunner("master"); | ||
if (!this.database) { | ||
@@ -292,3 +292,3 @@ this.database = await queryRunner.getCurrentDatabase(); | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -325,3 +325,3 @@ return value | ||
buildTableName(tableName, schema, database) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (schema) { | ||
@@ -328,0 +328,0 @@ tablePath.unshift(schema); |
@@ -16,2 +16,3 @@ import { ObjectLiteral } from "../../common/ObjectLiteral"; | ||
import { PostgresConnectionOptions } from "./PostgresConnectionOptions"; | ||
import { PostgresQueryRunner } from "./PostgresQueryRunner"; | ||
import { Table } from "../../schema-builder/table/Table"; | ||
@@ -164,3 +165,3 @@ import { View } from "../../schema-builder/view/View"; | ||
*/ | ||
createQueryRunner(mode: ReplicationMode): QueryRunner; | ||
createQueryRunner(mode: ReplicationMode): PostgresQueryRunner; | ||
/** | ||
@@ -167,0 +168,0 @@ * Prepares given value to a value to be persisted, based on its column type and metadata. |
@@ -98,2 +98,3 @@ import { ConnectionIsNotSetError } from "../../error/ConnectionIsNotSetError"; | ||
"macaddr", | ||
"macaddr8", | ||
"tsvector", | ||
@@ -259,12 +260,11 @@ "tsquery", | ||
} | ||
if (!this.database || !this.searchSchema) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
if (!this.database) { | ||
this.database = await queryRunner.getCurrentDatabase(); | ||
} | ||
if (!this.searchSchema) { | ||
this.searchSchema = await queryRunner.getCurrentSchema(); | ||
} | ||
await queryRunner.release(); | ||
const queryRunner = this.createQueryRunner("master"); | ||
this.version = await queryRunner.getVersion(); | ||
if (!this.database) { | ||
this.database = await queryRunner.getCurrentDatabase(); | ||
} | ||
if (!this.searchSchema) { | ||
this.searchSchema = await queryRunner.getCurrentSchema(); | ||
} | ||
await queryRunner.release(); | ||
if (!this.schema) { | ||
@@ -285,6 +285,3 @@ this.schema = this.searchSchema; | ||
} | ||
const results = (await this.executeQuery(connection, "SELECT version();")); | ||
const versionString = results.rows[0].version.replace(/^PostgreSQL ([\d.]+) .*$/, "$1"); | ||
this.version = versionString; | ||
this.isGeneratedColumnsSupported = VersionUtils.isGreaterOrEqual(versionString, "12.0"); | ||
this.isGeneratedColumnsSupported = VersionUtils.isGreaterOrEqual(this.version, "12.0"); | ||
await release(); | ||
@@ -564,3 +561,3 @@ } | ||
value = value | ||
.substr(1, value.length - 2) | ||
.slice(1, -1) | ||
.split(",") | ||
@@ -571,6 +568,4 @@ .map((val) => { | ||
val = val.slice(1, -1); | ||
// replace double escaped backslash to single escaped e.g. \\\\ -> \\ | ||
val = val.replace(/(\\\\)/g, "\\"); | ||
// replace escaped double quotes to non-escaped e.g. \"asd\" -> "asd" | ||
return val.replace(/(\\")/g, '"'); | ||
// replace escaped backslash and double quotes | ||
return val.replace(/\\(\\|")/g, "$1"); | ||
}); | ||
@@ -618,3 +613,3 @@ // convert to number if that exists in possible enum options | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -648,3 +643,3 @@ return value | ||
buildTableName(tableName, schema) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (schema) { | ||
@@ -651,0 +646,0 @@ tablePath.unshift(schema); |
@@ -297,3 +297,3 @@ import { ReadStream } from "../../platform/PlatformTools"; | ||
*/ | ||
protected getVersion(): Promise<string>; | ||
getVersion(): Promise<string>; | ||
/** | ||
@@ -300,0 +300,0 @@ * Builds drop table sql. |
@@ -329,3 +329,3 @@ import { DateUtils } from "../../util/DateUtils"; | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -332,0 +332,0 @@ return value |
@@ -60,3 +60,3 @@ import { QueryRunnerAlreadyReleasedError } from "../../error/QueryRunnerAlreadyReleasedError"; | ||
if (raw?.hasOwnProperty("rows")) { | ||
let records = []; | ||
const records = []; | ||
for (let i = 0; i < raw.rows.length; i++) { | ||
@@ -63,0 +63,0 @@ records.push(raw.rows.item(i)); |
@@ -45,2 +45,6 @@ import { ColumnType, DataSource, EntityMetadata, ObjectLiteral, Table, TableColumn, TableForeignKey } from "../.."; | ||
/** | ||
* Version of SAP HANA. Requires a SQL query to the DB, so it is not always set | ||
*/ | ||
version?: string; | ||
/** | ||
* Database name used to perform all write queries. | ||
@@ -68,3 +72,4 @@ */ | ||
* | ||
* @see https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.03/en-US/20a1569875191014b507cf392724b7eb.html | ||
* @see https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/20a1569875191014b507cf392724b7eb.html | ||
* @see https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/data-types | ||
*/ | ||
@@ -71,0 +76,0 @@ supportedDataTypes: ColumnType[]; |
@@ -41,3 +41,4 @@ import { DriverPackageNotInstalledError } from "../../error/DriverPackageNotInstalledError"; | ||
* | ||
* @see https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.03/en-US/20a1569875191014b507cf392724b7eb.html | ||
* @see https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/20a1569875191014b507cf392724b7eb.html | ||
* @see https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/data-types | ||
*/ | ||
@@ -47,3 +48,3 @@ this.supportedDataTypes = [ | ||
"smallint", | ||
"int", | ||
"int", // typeorm alias for "integer" | ||
"integer", | ||
@@ -53,6 +54,6 @@ "bigint", | ||
"decimal", | ||
"dec", | ||
"dec", // typeorm alias for "decimal" | ||
"real", | ||
"double", | ||
"float", | ||
"float", // database alias for "real" / "double" | ||
"date", | ||
@@ -63,13 +64,13 @@ "time", | ||
"boolean", | ||
"char", | ||
"nchar", | ||
"varchar", | ||
"char", // not officially supported, in SAP HANA Cloud: alias for "nchar" | ||
"nchar", // not officially supported | ||
"varchar", // in SAP HANA Cloud: alias for "nvarchar" | ||
"nvarchar", | ||
"text", | ||
"alphanum", | ||
"shorttext", | ||
"text", // removed in SAP HANA Cloud | ||
"alphanum", // removed in SAP HANA Cloud | ||
"shorttext", // removed in SAP HANA Cloud | ||
"array", | ||
"varbinary", | ||
"blob", | ||
"clob", | ||
"clob", // in SAP HANA Cloud: alias for "nclob" | ||
"nclob", | ||
@@ -181,2 +182,4 @@ "st_geometry", | ||
dbParams.databaseName = this.options.database; | ||
if (this.options.schema) | ||
dbParams.currentSchema = this.options.schema; | ||
if (this.options.encrypt) | ||
@@ -215,12 +218,10 @@ dbParams.encrypt = this.options.encrypt; | ||
this.master = this.client.createPool(dbParams, options); | ||
if (!this.database || !this.schema) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
if (!this.database) { | ||
this.database = await queryRunner.getCurrentDatabase(); | ||
} | ||
if (!this.schema) { | ||
this.schema = await queryRunner.getCurrentSchema(); | ||
} | ||
await queryRunner.release(); | ||
const queryRunner = this.createQueryRunner("master"); | ||
const { version, database } = await queryRunner.getDatabaseAndVersion(); | ||
this.version = version; | ||
this.database = database; | ||
if (!this.schema) { | ||
this.schema = await queryRunner.getCurrentSchema(); | ||
} | ||
await queryRunner.release(); | ||
} | ||
@@ -269,3 +270,3 @@ /** | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -301,3 +302,3 @@ return value | ||
buildTableName(tableName, schema) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (schema) { | ||
@@ -431,2 +432,15 @@ tablePath.unshift(schema); | ||
} | ||
else if (column.type === "dec") { | ||
return "decimal"; | ||
} | ||
else if (column.type === "float") { | ||
const length = typeof column.length === "string" | ||
? parseInt(column.length) | ||
: column.length; | ||
// https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/4ee2f261e9c44003807d08ccc2e249ac.html | ||
if (length && length < 25) { | ||
return "real"; | ||
} | ||
return "double"; | ||
} | ||
else if (column.type === String) { | ||
@@ -449,3 +463,3 @@ return "nvarchar"; | ||
column.type === "simple-json") { | ||
return "text"; | ||
return "nclob"; | ||
} | ||
@@ -455,5 +469,17 @@ else if (column.type === "simple-enum") { | ||
} | ||
else { | ||
return column.type || ""; | ||
if (DriverUtils.isReleaseVersionOrGreater(this, "4.0")) { | ||
// SAP HANA Cloud deprecated / removed these data types | ||
if (column.type === "varchar" || | ||
column.type === "alphanum" || | ||
column.type === "shorttext") { | ||
return "nvarchar"; | ||
} | ||
else if (column.type === "text" || column.type === "clob") { | ||
return "nclob"; | ||
} | ||
else if (column.type === "char") { | ||
return "nchar"; | ||
} | ||
} | ||
return column.type || ""; | ||
} | ||
@@ -577,20 +603,7 @@ /** | ||
const tableColumn = tableColumns.find((c) => c.name === columnMetadata.databaseName); | ||
if (!tableColumn) | ||
return false; // we don't need new columns, we only need exist and changed | ||
// console.log("table:", columnMetadata.entityMetadata.tableName); | ||
// console.log("name:", tableColumn.name, columnMetadata.databaseName); | ||
// console.log("type:", tableColumn.type, _this.normalizeType(columnMetadata)); | ||
// console.log("length:", tableColumn.length, _this.getColumnLength(columnMetadata)); | ||
// console.log("width:", tableColumn.width, columnMetadata.width); | ||
// console.log("precision:", tableColumn.precision, columnMetadata.precision); | ||
// console.log("scale:", tableColumn.scale, columnMetadata.scale); | ||
// console.log("default:", tableColumn.default, columnMetadata.default); | ||
// console.log("isPrimary:", tableColumn.isPrimary, columnMetadata.isPrimary); | ||
// console.log("isNullable:", tableColumn.isNullable, columnMetadata.isNullable); | ||
// console.log("isUnique:", tableColumn.isUnique, _this.normalizeIsUnique(columnMetadata)); | ||
// console.log("isGenerated:", tableColumn.isGenerated, columnMetadata.isGenerated); | ||
// console.log((columnMetadata.generationStrategy !== "uuid" && tableColumn.isGenerated !== columnMetadata.isGenerated)); | ||
// console.log("=========================================="); | ||
const normalizeDefault = this.normalizeDefault(columnMetadata); | ||
const hanaNullComapatibleDefault = normalizeDefault == null ? undefined : normalizeDefault; | ||
if (!tableColumn) { | ||
// we don't need new columns, we only need exist and changed | ||
return false; | ||
} | ||
const normalizedDefault = this.normalizeDefault(columnMetadata); | ||
return (tableColumn.name !== columnMetadata.databaseName || | ||
@@ -606,3 +619,3 @@ tableColumn.type !== this.normalizeType(columnMetadata) || | ||
(!tableColumn.isGenerated && | ||
hanaNullComapatibleDefault !== tableColumn.default) || // we included check for generated here, because generated columns already can have default values | ||
normalizedDefault !== tableColumn.default) || // we included check for generated here, because generated columns already can have default values | ||
tableColumn.isPrimary !== columnMetadata.isPrimary || | ||
@@ -632,3 +645,3 @@ tableColumn.isNullable !== columnMetadata.isNullable || | ||
isFullTextColumnTypeSupported() { | ||
return true; | ||
return !DriverUtils.isReleaseVersionOrGreater(this, "4.0"); | ||
} | ||
@@ -635,0 +648,0 @@ /** |
@@ -87,2 +87,9 @@ import { ReadStream } from "../../platform/PlatformTools"; | ||
/** | ||
* Returns the database server version. | ||
*/ | ||
getDatabaseAndVersion(): Promise<{ | ||
database: string; | ||
version: string; | ||
}>; | ||
/** | ||
* Checks if schema with the given name exist. | ||
@@ -89,0 +96,0 @@ */ |
@@ -183,3 +183,3 @@ import { DriverPackageNotInstalledError } from "../../error/DriverPackageNotInstalledError"; | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (value === null) { | ||
@@ -207,3 +207,3 @@ return full; | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (value === null) { | ||
@@ -227,3 +227,3 @@ return " IS NULL"; | ||
buildTableName(tableName, schema, database) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (database) { | ||
@@ -230,0 +230,0 @@ tablePath.unshift(database); |
@@ -319,3 +319,3 @@ import { DateUtils } from "../../util/DateUtils"; | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -322,0 +322,0 @@ return value |
@@ -182,3 +182,3 @@ import { AbstractSqliteDriver } from "../sqlite-abstract/AbstractSqliteDriver"; | ||
try { | ||
let result = this.databaseConnection.exec(query); | ||
const result = this.databaseConnection.exec(query); | ||
this.connection.logger.logQuery(query); | ||
@@ -185,0 +185,0 @@ return OrmUtils.mergeDeep(map, generatedColumn.createValueMap(result[0].values[0][0])); |
@@ -210,3 +210,3 @@ import { ConnectionIsNotSetError } from "../../error/ConnectionIsNotSetError"; | ||
if (!this.database || !this.searchSchema) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
const queryRunner = this.createQueryRunner("master"); | ||
if (!this.database) { | ||
@@ -277,3 +277,3 @@ this.database = await queryRunner.getCurrentDatabase(); | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -307,3 +307,3 @@ return value | ||
buildTableName(tableName, schema, database) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (schema) { | ||
@@ -310,0 +310,0 @@ tablePath.unshift(schema); |
@@ -21,3 +21,3 @@ /** | ||
*/ | ||
export type SimpleColumnType = "simple-array" | "simple-json" | "simple-enum" | "int2" | "integer" | "int4" | "int8" | "int64" | "unsigned big int" | "float" | "float4" | "float8" | "float64" | "smallmoney" | "money" | "boolean" | "bool" | "tinyblob" | "tinytext" | "mediumblob" | "mediumtext" | "blob" | "text" | "ntext" | "citext" | "hstore" | "longblob" | "longtext" | "alphanum" | "shorttext" | "bytes" | "bytea" | "long" | "raw" | "long raw" | "bfile" | "clob" | "nclob" | "image" | "timetz" | "timestamptz" | "timestamp with local time zone" | "smalldatetime" | "date" | "interval year to month" | "interval day to second" | "interval" | "year" | "seconddate" | "point" | "line" | "lseg" | "box" | "circle" | "path" | "polygon" | "geography" | "geometry" | "linestring" | "multipoint" | "multilinestring" | "multipolygon" | "geometrycollection" | "st_geometry" | "st_point" | "int4range" | "int8range" | "numrange" | "tsrange" | "tstzrange" | "daterange" | "int4multirange" | "int8multirange" | "nummultirange" | "tsmultirange" | "tstzmultirange" | "datemultirange" | "enum" | "set" | "cidr" | "inet" | "inet4" | "inet6" | "macaddr" | "bit" | "bit varying" | "varbit" | "tsvector" | "tsquery" | "uuid" | "xml" | "json" | "jsonb" | "varbinary" | "hierarchyid" | "sql_variant" | "rowid" | "urowid" | "uniqueidentifier" | "rowversion" | "array" | "cube" | "ltree"; | ||
export type SimpleColumnType = "simple-array" | "simple-json" | "simple-enum" | "int2" | "integer" | "int4" | "int8" | "int64" | "unsigned big int" | "float" | "float4" | "float8" | "float64" | "smallmoney" | "money" | "boolean" | "bool" | "tinyblob" | "tinytext" | "mediumblob" | "mediumtext" | "blob" | "text" | "ntext" | "citext" | "hstore" | "longblob" | "longtext" | "alphanum" | "shorttext" | "bytes" | "bytea" | "long" | "raw" | "long raw" | "bfile" | "clob" | "nclob" | "image" | "timetz" | "timestamptz" | "timestamp with local time zone" | "smalldatetime" | "date" | "interval year to month" | "interval day to second" | "interval" | "year" | "seconddate" | "point" | "line" | "lseg" | "box" | "circle" | "path" | "polygon" | "geography" | "geometry" | "linestring" | "multipoint" | "multilinestring" | "multipolygon" | "geometrycollection" | "st_geometry" | "st_point" | "int4range" | "int8range" | "numrange" | "tsrange" | "tstzrange" | "daterange" | "int4multirange" | "int8multirange" | "nummultirange" | "tsmultirange" | "tstzmultirange" | "datemultirange" | "enum" | "set" | "cidr" | "inet" | "inet4" | "inet6" | "macaddr" | "macaddr8" | "bit" | "bit varying" | "varbit" | "tsvector" | "tsquery" | "uuid" | "xml" | "json" | "jsonb" | "varbinary" | "hierarchyid" | "sql_variant" | "rowid" | "urowid" | "uniqueidentifier" | "rowversion" | "array" | "cube" | "ltree"; | ||
/** | ||
@@ -24,0 +24,0 @@ * Any column type column can be. |
@@ -148,3 +148,3 @@ import { EntityManager } from "./EntityManager"; | ||
Object.keys(result.raw.insertedIds).forEach((key) => { | ||
let insertedId = result.raw.insertedIds[key]; | ||
const insertedId = result.raw.insertedIds[key]; | ||
result.generatedMaps.push(this.connection.driver.createGeneratedMap(this.connection.getMetadata(target), insertedId)); | ||
@@ -151,0 +151,0 @@ result.identifiers.push(this.connection.driver.createGeneratedMap(this.connection.getMetadata(target), insertedId)); |
@@ -5,3 +5,3 @@ import { ObjectId } from "../driver/mongodb/typings"; | ||
*/ | ||
export type FindOptionsSelectProperty<Property> = Property extends Promise<infer I> ? FindOptionsSelectProperty<I> | boolean : Property extends Array<infer I> ? FindOptionsSelectProperty<I> | boolean : Property extends string ? boolean : Property extends number ? boolean : Property extends boolean ? boolean : Property extends Function ? never : Property extends Buffer ? boolean : Property extends Date ? boolean : Property extends ObjectId ? boolean : Property extends object ? FindOptionsSelect<Property> : boolean; | ||
export type FindOptionsSelectProperty<Property> = Property extends Promise<infer I> ? FindOptionsSelectProperty<I> | boolean : Property extends Array<infer I> ? FindOptionsSelectProperty<I> | boolean : Property extends string ? boolean : Property extends number ? boolean : Property extends boolean ? boolean : Property extends Function ? never : Property extends Buffer ? boolean : Property extends Date ? boolean : Property extends ObjectId ? boolean : Property extends object ? FindOptionsSelect<Property> | boolean : boolean; | ||
/** | ||
@@ -8,0 +8,0 @@ * Select find options. |
@@ -259,3 +259,3 @@ import { FindRelationsNotFoundError } from "../error"; | ||
// generate a relation alias | ||
let relationAlias = DriverUtils.buildAlias(qb.connection.driver, { joiner: "__" }, alias, relation.propertyPath); | ||
const relationAlias = DriverUtils.buildAlias(qb.connection.driver, { joiner: "__" }, alias, relation.propertyPath); | ||
// add a join for the found relation | ||
@@ -262,0 +262,0 @@ const selection = alias + "." + relation.propertyPath; |
@@ -132,2 +132,3 @@ /*! | ||
export * from "./driver/sqlserver/MssqlParameter"; | ||
export * from "./subscriber/event/QueryEvent"; | ||
export { ConnectionOptionsReader } from "./connection/ConnectionOptionsReader"; | ||
@@ -134,0 +135,0 @@ export { ConnectionOptions } from "./connection/ConnectionOptions"; |
@@ -135,2 +135,3 @@ /*! | ||
export * from "./driver/sqlserver/MssqlParameter"; | ||
export * from "./subscriber/event/QueryEvent"; | ||
// export * from "./data-source"; | ||
@@ -137,0 +138,0 @@ export { ConnectionOptionsReader } from "./connection/ConnectionOptionsReader"; |
@@ -13,3 +13,3 @@ import { PlatformTools } from "../platform/PlatformTools"; | ||
const messages = this.prepareLogMessages(logMessage); | ||
for (let message of messages) { | ||
for (const message of messages) { | ||
switch (message.type ?? level) { | ||
@@ -16,0 +16,0 @@ case "log": |
@@ -57,3 +57,3 @@ import { AbstractLogger } from "./AbstractLogger"; | ||
}); | ||
for (let message of messages) { | ||
for (const message of messages) { | ||
const messageTypeOrLevel = message.type ?? level; | ||
@@ -60,0 +60,0 @@ if (messageTypeOrLevel in this.logger) { |
@@ -28,3 +28,3 @@ import appRootPath from "app-root-path"; | ||
const strings = []; | ||
for (let message of messages) { | ||
for (const message of messages) { | ||
switch (message.type ?? level) { | ||
@@ -31,0 +31,0 @@ case "log": |
@@ -14,3 +14,3 @@ import { AbstractLogger } from "./AbstractLogger"; | ||
}); | ||
for (let message of messages) { | ||
for (const message of messages) { | ||
switch (message.type ?? level) { | ||
@@ -17,0 +17,0 @@ case "log": |
@@ -555,3 +555,3 @@ import { OrmUtils } from "../util/OrmUtils"; | ||
const columnValue = this.getEntityValue(entity); | ||
if (ObjectUtils.isObject(columnValue)) { | ||
if (typeof columnValue?.equals === "function") { | ||
return columnValue.equals(valueToCompareWith); | ||
@@ -558,0 +558,0 @@ } |
@@ -170,3 +170,3 @@ import { TypeORMError } from "../error"; | ||
return this.propertyName; | ||
let prefixes = []; | ||
const prefixes = []; | ||
if (this.parentEmbeddedMetadata) | ||
@@ -173,0 +173,0 @@ prefixes.push(this.parentEmbeddedMetadata.buildPrefix(connection)); |
@@ -135,3 +135,3 @@ import { Table } from "../schema-builder/table/Table"; | ||
// get the time when last migration was executed | ||
let lastTimeExecutedMigration = this.getLatestTimestampMigration(executedMigrations); | ||
const lastTimeExecutedMigration = this.getLatestTimestampMigration(executedMigrations); | ||
// get all user's migrations in the source code | ||
@@ -242,3 +242,3 @@ const allMigrations = this.getMigrations(); | ||
successMigrations.push(migration); | ||
this.connection.logger.logSchemaBuild(`Migration ${migration.name} has been ${this.fake ? "(fake)" : ""} executed successfully.`); | ||
this.connection.logger.logSchemaBuild(`Migration ${migration.name} has been ${this.fake ? "(fake) " : ""}executed successfully.`); | ||
}); | ||
@@ -285,3 +285,3 @@ } | ||
// get the time when last migration was executed | ||
let lastTimeExecutedMigration = this.getLatestExecutedMigration(executedMigrations); | ||
const lastTimeExecutedMigration = this.getLatestExecutedMigration(executedMigrations); | ||
// if no migrations found in the database then nothing to revert | ||
@@ -316,3 +316,3 @@ if (!lastTimeExecutedMigration) { | ||
await this.deleteExecutedMigration(queryRunner, migrationToRevert); | ||
this.connection.logger.logSchemaBuild(`Migration ${migrationToRevert.name} has been ${this.fake ? "(fake)" : ""} reverted successfully.`); | ||
this.connection.logger.logSchemaBuild(`Migration ${migrationToRevert.name} has been ${this.fake ? "(fake) " : ""}reverted successfully.`); | ||
// commit transaction if we started it | ||
@@ -319,0 +319,0 @@ if (transactionStartedByUs) |
@@ -43,3 +43,3 @@ import { MustBeEntityError } from "../error/MustBeEntityError"; | ||
// with third classes - like subscribers and listener methods | ||
let oldQueryRunnerData = queryRunner.data; | ||
const oldQueryRunnerData = queryRunner.data; | ||
if (this.options && this.options.data) { | ||
@@ -66,3 +66,3 @@ queryRunner.data = this.options.data; | ||
throw new CannotDetermineEntityError(this.mode); | ||
let metadata = this.connection | ||
const metadata = this.connection | ||
.getMetadata(entityTarget) | ||
@@ -69,0 +69,0 @@ .findInheritanceMetadata(entity); |
@@ -57,3 +57,3 @@ import { Subject } from "../Subject"; | ||
// by example: get category from the passed to persist post entity | ||
let relatedEntity = relation.getEntityValue(subject.entity); // by example: relatedEntity is a category here | ||
const relatedEntity = relation.getEntityValue(subject.entity); // by example: relatedEntity is a category here | ||
if (relatedEntity === undefined) | ||
@@ -60,0 +60,0 @@ // if relation is undefined then nothing to update |
@@ -105,3 +105,3 @@ /** | ||
// this way we tell what subjects we tried to load database entities of | ||
for (let subject of allSubjects) { | ||
for (const subject of allSubjects) { | ||
subject.databaseEntityLoaded = true; | ||
@@ -108,0 +108,0 @@ } |
@@ -378,3 +378,3 @@ import { SubjectTopologicalSorter } from "./SubjectTopologicalSorter"; | ||
const updateResult = await updateQueryBuilder.execute(); | ||
let updateGeneratedMap = updateResult.generatedMaps[0]; | ||
const updateGeneratedMap = updateResult.generatedMaps[0]; | ||
if (updateGeneratedMap) { | ||
@@ -381,0 +381,0 @@ subject.metadata.columns.forEach((column) => { |
@@ -126,5 +126,5 @@ import { TypeORMError } from "../error"; | ||
function uniqueNodes(arr) { | ||
let res = []; | ||
const res = []; | ||
for (let i = 0, len = arr.length; i < len; i++) { | ||
let edge = arr[i]; | ||
const edge = arr[i]; | ||
if (res.indexOf(edge[0]) < 0) | ||
@@ -155,9 +155,9 @@ res.push(edge[0]); | ||
// outgoing edges | ||
let outgoing = edges.filter(function (edge) { | ||
const outgoing = edges.filter(function (edge) { | ||
return edge[0] === node; | ||
}); | ||
if ((i = outgoing.length)) { | ||
let preds = predecessors.concat(node); | ||
const preds = predecessors.concat(node); | ||
do { | ||
let child = outgoing[--i][1]; | ||
const child = outgoing[--i][1]; | ||
visit(child, nodes.indexOf(child), preds); | ||
@@ -164,0 +164,0 @@ } while (i); |
@@ -177,3 +177,3 @@ import { OrmUtils } from "../../util/OrmUtils"; | ||
const rightColumnName = escape(metadata.nestedSetRightColumn.databaseName); | ||
let entitiesIds = []; | ||
const entitiesIds = []; | ||
for (const subject of subjects) { | ||
@@ -185,3 +185,3 @@ const entityId = metadata.getEntityIdMap(subject.entity); | ||
} | ||
let entitiesNs = await this.getNestedSetIds(metadata, entitiesIds); | ||
const entitiesNs = await this.getNestedSetIds(metadata, entitiesIds); | ||
for (const entity of entitiesNs) { | ||
@@ -188,0 +188,0 @@ const treeSize = entity.right - entity.left + 1; |
@@ -562,3 +562,4 @@ import { v4 as uuidv4 } from "uuid"; | ||
else if (value === null && | ||
this.connection.driver.options.type === "spanner") { | ||
(this.connection.driver.options.type === "spanner" || | ||
this.connection.driver.options.type === "oracle")) { | ||
expression += "NULL"; | ||
@@ -565,0 +566,0 @@ // support for SQL expressions in queries |
@@ -36,3 +36,3 @@ import { QueryBuilderUtils } from "./QueryBuilderUtils"; | ||
if (!this.isSelectedEvaluated) { | ||
let getValue = () => { | ||
const getValue = () => { | ||
for (const select of this.queryExpressionMap.selects) { | ||
@@ -92,3 +92,3 @@ if (select.selection === this.alias.name) | ||
if (!this.relationEvaluated) { | ||
let getValue = () => { | ||
const getValue = () => { | ||
if (!QueryBuilderUtils.isAliasProperty(this.entityOrProperty)) | ||
@@ -95,0 +95,0 @@ return undefined; |
@@ -766,3 +766,3 @@ import { QueryExpressionMap } from "./QueryExpressionMap"; | ||
const cteStrings = this.expressionMap.commonTableExpressions.map((cte) => { | ||
let cteBodyExpression = typeof cte.queryBuilder === 'string' ? cte.queryBuilder : ''; | ||
let cteBodyExpression = typeof cte.queryBuilder === "string" ? cte.queryBuilder : ""; | ||
if (typeof cte.queryBuilder !== "string") { | ||
@@ -1002,3 +1002,3 @@ if (cte.queryBuilder.hasCommonTableExpressions()) { | ||
if (InstanceChecker.isFindOperator(parameterValue)) { | ||
let parameters = []; | ||
const parameters = []; | ||
if (parameterValue.useParameter) { | ||
@@ -1005,0 +1005,0 @@ if (parameterValue.objectLiteralParameters) { |
@@ -311,5 +311,5 @@ import { DriverUtils } from "../driver/DriverUtils"; | ||
if (relatedEntities && hasAllJoinColumnsInEntity) { | ||
let relationIdMaps = []; | ||
const relationIdMaps = []; | ||
entities.forEach((entity) => { | ||
let relationIdMap = {}; | ||
const relationIdMap = {}; | ||
relation.entityMetadata.primaryColumns.forEach((primaryColumn) => { | ||
@@ -316,0 +316,0 @@ const key = primaryColumn.entityMetadata.name + |
@@ -351,3 +351,3 @@ import { QueryBuilder } from "./QueryBuilder"; | ||
createLimitExpression() { | ||
let limit = this.expressionMap.limit; | ||
const limit = this.expressionMap.limit; | ||
if (limit) { | ||
@@ -354,0 +354,0 @@ if (DriverUtils.isMySQLFamily(this.connection.driver)) { |
@@ -109,3 +109,3 @@ import { OrmUtils } from "../../util/OrmUtils"; | ||
} | ||
let entity = metadata.create(this.queryRunner, { | ||
const entity = metadata.create(this.queryRunner, { | ||
fromDeserializer: true, | ||
@@ -141,3 +141,3 @@ pojo: this.pojo, | ||
// we don't mark it as has data because if we will have all nulls in our object - we don't need such object | ||
else if (value !== null) | ||
else if (value !== null && !column.isVirtualProperty) | ||
hasData = true; | ||
@@ -144,0 +144,0 @@ column.setEntityValue(entity, this.driver.prepareHydratedValue(value, column)); |
@@ -291,3 +291,3 @@ import { QueryBuilder } from "./QueryBuilder"; | ||
const valuesSetNormalized = {}; | ||
for (let key in valuesSet) { | ||
for (const key in valuesSet) { | ||
if (valuesSet[key] !== undefined) { | ||
@@ -407,3 +407,3 @@ valuesSetNormalized[key] = valuesSet[key]; | ||
Object.keys(valuesSetNormalized).map((key) => { | ||
let value = valuesSetNormalized[key]; | ||
const value = valuesSetNormalized[key]; | ||
// todo: duplication zone | ||
@@ -471,3 +471,3 @@ if (typeof value === "function") { | ||
createLimitExpression() { | ||
let limit = this.expressionMap.limit; | ||
const limit = this.expressionMap.limit; | ||
if (limit) { | ||
@@ -474,0 +474,0 @@ if (DriverUtils.isMySQLFamily(this.connection.driver) || |
@@ -39,3 +39,3 @@ import { EntityManager } from "../../entity-manager/EntityManager"; | ||
/** | ||
* The duration of the query execution. | ||
* The duration of the query execution, in milliseconds. | ||
*/ | ||
@@ -42,0 +42,0 @@ executionTime?: number; |
@@ -21,4 +21,4 @@ /** | ||
function createDFS(edges, leavesOnly, result) { | ||
let currentPath = []; | ||
let visited = {}; | ||
const currentPath = []; | ||
const visited = {}; | ||
return function DFS(currentNode) { | ||
@@ -158,6 +158,6 @@ visited[currentNode] = true; | ||
if (this.hasNode(node)) { | ||
let result = []; | ||
let DFS = createDFS(this.outgoingEdges, leavesOnly, result); | ||
const result = []; | ||
const DFS = createDFS(this.outgoingEdges, leavesOnly, result); | ||
DFS(node); | ||
let idx = result.indexOf(node); | ||
const idx = result.indexOf(node); | ||
if (idx >= 0) { | ||
@@ -181,6 +181,6 @@ result.splice(idx, 1); | ||
if (this.hasNode(node)) { | ||
let result = []; | ||
let DFS = createDFS(this.incomingEdges, leavesOnly, result); | ||
const result = []; | ||
const DFS = createDFS(this.incomingEdges, leavesOnly, result); | ||
DFS(node); | ||
let idx = result.indexOf(node); | ||
const idx = result.indexOf(node); | ||
if (idx >= 0) { | ||
@@ -203,5 +203,5 @@ result.splice(idx, 1); | ||
overallOrder(leavesOnly) { | ||
let self = this; | ||
let result = []; | ||
let keys = Object.keys(this.nodes); | ||
const self = this; | ||
const result = []; | ||
const keys = Object.keys(this.nodes); | ||
if (keys.length === 0) { | ||
@@ -213,7 +213,7 @@ return result; // Empty graph | ||
// are several disconnected subgraphs inside this dependency graph. | ||
let CycleDFS = createDFS(this.outgoingEdges, false, []); | ||
const CycleDFS = createDFS(this.outgoingEdges, false, []); | ||
keys.forEach(function (n) { | ||
CycleDFS(n); | ||
}); | ||
let DFS = createDFS(this.outgoingEdges, leavesOnly, result); | ||
const DFS = createDFS(this.outgoingEdges, leavesOnly, result); | ||
// Find all potential starting points (nodes with nothing depending on them) an | ||
@@ -220,0 +220,0 @@ // run a DFS starting at these points to get the order |
@@ -19,6 +19,6 @@ import * as glob from "glob"; | ||
else if (Array.isArray(exported)) { | ||
exported.forEach((i) => loadFileClasses(i, allLoaded)); | ||
exported.forEach((value) => loadFileClasses(value, allLoaded)); | ||
} | ||
else if (ObjectUtils.isObject(exported)) { | ||
Object.keys(exported).forEach((key) => loadFileClasses(exported[key], allLoaded)); | ||
Object.values(exported).forEach((value) => loadFileClasses(value, allLoaded)); | ||
} | ||
@@ -25,0 +25,0 @@ return allLoaded; |
@@ -1,1 +0,1 @@ | ||
export declare const escapeRegExp: (s: String) => string; | ||
export declare const escapeRegExp: (s: string) => string; |
@@ -8,3 +8,3 @@ import { MixedList } from "../common/MixedList"; | ||
*/ | ||
static isObject(val: any): val is Object; | ||
static isObject(val: any): val is object; | ||
/** | ||
@@ -15,3 +15,3 @@ * Checks if given value is an object. | ||
*/ | ||
static isObjectWithName(val: any): val is Object & { | ||
static isObjectWithName(val: any): val is object & { | ||
name: string; | ||
@@ -18,0 +18,0 @@ }; |
@@ -162,3 +162,3 @@ export class OrmUtils { | ||
static replaceEmptyObjectsWithBooleans(obj) { | ||
for (let key in obj) { | ||
for (const key in obj) { | ||
if (obj[key] && typeof obj[key] === "object") { | ||
@@ -175,4 +175,4 @@ if (Object.keys(obj[key]).length === 0) { | ||
static propertyPathsToTruthyObject(paths) { | ||
let obj = {}; | ||
for (let path of paths) { | ||
const obj = {}; | ||
for (const path of paths) { | ||
const props = path.split("."); | ||
@@ -185,3 +185,3 @@ if (!props.length) | ||
let recursiveChild = obj[props[0]]; | ||
for (let [key, prop] of props.entries()) { | ||
for (const [key, prop] of props.entries()) { | ||
if (key === 0) | ||
@@ -188,0 +188,0 @@ continue; |
@@ -15,7 +15,7 @@ export class RandomGenerator { | ||
static sha1(str) { | ||
let _rotLeft = function (n, s) { | ||
let t4 = (n << s) | (n >>> (32 - s)); | ||
const _rotLeft = function (n, s) { | ||
const t4 = (n << s) | (n >>> (32 - s)); | ||
return t4; | ||
}; | ||
let _cvtHex = function (val) { | ||
const _cvtHex = function (val) { | ||
let str = ""; | ||
@@ -32,3 +32,3 @@ let i; | ||
let i, j; | ||
let W = new Array(80); | ||
const W = new Array(80); | ||
let H0 = 0x67452301; | ||
@@ -43,4 +43,4 @@ let H1 = 0xefcdab89; | ||
str = /*unescape*/ encodeURIComponent(str); | ||
let strLen = str.length; | ||
let wordArray = []; | ||
const strLen = str.length; | ||
const wordArray = []; | ||
for (i = 0; i < strLen - 3; i += 4) { | ||
@@ -47,0 +47,0 @@ j = |
@@ -1,4 +0,3 @@ | ||
export type Version = [number, number, number]; | ||
export declare class VersionUtils { | ||
static isGreaterOrEqual(version: string, targetVersion: string): boolean; | ||
static isGreaterOrEqual(version: string | undefined, targetVersion: string): boolean; | ||
} |
export class VersionUtils { | ||
static isGreaterOrEqual(version, targetVersion) { | ||
if (!version) { | ||
return false; | ||
} | ||
const v1 = parseVersion(version); | ||
const v2 = parseVersion(targetVersion); | ||
return (v1[0] > v2[0] || | ||
(v1[0] === v2[0] && v1[1] > v2[1]) || | ||
(v1[0] === v2[0] && v1[1] === v2[1] && v1[2] >= v2[2])); | ||
for (let i = 0; i < v1.length && i < v2.length; i++) { | ||
if (v1[i] > v2[i]) { | ||
return true; | ||
} | ||
else if (v1[i] < v2[i]) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
} | ||
function parseVersion(version = "") { | ||
const v = [0, 0, 0]; | ||
version.split(".").forEach((value, i) => (v[i] = parseInt(value, 10))); | ||
return v; | ||
function parseVersion(version) { | ||
return version.split(".").map((value) => parseInt(value, 10)); | ||
} | ||
//# sourceMappingURL=VersionUtils.js.map |
@@ -235,3 +235,3 @@ "use strict"; | ||
async remove(identifiers, queryRunner) { | ||
let _queryRunner = queryRunner || this.getQueryRunner(); | ||
const _queryRunner = queryRunner || this.getQueryRunner(); | ||
await Promise.all(identifiers.map((identifier) => { | ||
@@ -238,0 +238,0 @@ const qb = _queryRunner.manager.createQueryBuilder(); |
@@ -17,2 +17,3 @@ "use strict"; | ||
try { | ||
; | ||
[dataSourceFileExports] = await (0, ImportUtils_1.importOrRequireFile)(dataSourceFilePath); | ||
@@ -19,0 +20,0 @@ } |
@@ -221,4 +221,4 @@ "use strict"; | ||
compilerOptions: { | ||
lib: ["es5", "es6"], | ||
target: "es5", | ||
lib: ["es2021"], | ||
target: "es2021", | ||
module: "commonjs", | ||
@@ -464,3 +464,3 @@ moduleResolution: "node", | ||
mysql: | ||
image: "mysql:8.0.30" | ||
image: "mysql:9.2.0" | ||
ports: | ||
@@ -479,3 +479,3 @@ - "3306:3306" | ||
mariadb: | ||
image: "mariadb:10.8.4" | ||
image: "mariadb:11.7.2" | ||
ports: | ||
@@ -494,3 +494,3 @@ - "3306:3306" | ||
postgres: | ||
image: "postgres:14.5" | ||
image: "postgres:17.2" | ||
ports: | ||
@@ -508,3 +508,3 @@ - "5432:5432" | ||
cockroachdb: | ||
image: "cockroachdb/cockroach:v22.1.6" | ||
image: "cockroachdb/cockroach:v25.1.2" | ||
command: start --insecure | ||
@@ -525,3 +525,3 @@ ports: | ||
mssql: | ||
image: "microsoft/mssql-server-linux:rc2" | ||
image: "mcr.microsoft.com/mssql/server:2022-latest" | ||
ports: | ||
@@ -538,3 +538,3 @@ - "1433:1433" | ||
mongodb: | ||
image: "mongo:5.0.12" | ||
image: "mongo:8.0.5" | ||
container_name: "typeorm-mongodb" | ||
@@ -549,3 +549,3 @@ ports: | ||
spanner: | ||
image: gcr.io/cloud-spanner-emulator/emulator:1.4.1 | ||
image: gcr.io/cloud-spanner-emulator/emulator:1.5.30 | ||
ports: | ||
@@ -588,46 +588,48 @@ - "9010:9010" | ||
packageJson.devDependencies = {}; | ||
Object.assign(packageJson.devDependencies, { | ||
"ts-node": "10.9.1", | ||
"@types/node": "^16.11.10", | ||
typescript: "4.5.2", | ||
}); | ||
packageJson.devDependencies = { | ||
"@types/node": "^22.13.10", | ||
"ts-node": "^10.9.2", | ||
typescript: "^5.8.2", | ||
...packageJson.devDependencies, | ||
}; | ||
if (!packageJson.dependencies) | ||
packageJson.dependencies = {}; | ||
Object.assign(packageJson.dependencies, { | ||
packageJson.dependencies = { | ||
...packageJson.dependencies, | ||
"reflect-metadata": "^0.2.2", | ||
typeorm: require("../package.json").version !== "0.0.0" | ||
? require("../package.json").version // install version from package.json if present | ||
: require("../package.json").installFrom, // else use custom source | ||
"reflect-metadata": "^0.1.13", | ||
}); | ||
}; | ||
switch (database) { | ||
case "mysql": | ||
case "mariadb": | ||
packageJson.dependencies["mysql"] = "^2.14.1"; | ||
packageJson.dependencies["mysql2"] = "^3.14.0"; | ||
break; | ||
case "postgres": | ||
case "cockroachdb": | ||
packageJson.dependencies["pg"] = "^8.4.0"; | ||
packageJson.dependencies["pg"] = "^8.14.1"; | ||
break; | ||
case "sqlite": | ||
packageJson.dependencies["sqlite3"] = "^5.0.2"; | ||
packageJson.dependencies["sqlite3"] = "^5.1.7"; | ||
break; | ||
case "better-sqlite3": | ||
packageJson.dependencies["better-sqlite3"] = "^8.0.0"; | ||
packageJson.dependencies["better-sqlite3"] = "^8.7.0"; | ||
break; | ||
case "oracle": | ||
packageJson.dependencies["oracledb"] = "^5.1.0"; | ||
packageJson.dependencies["oracledb"] = "^6.8.0"; | ||
break; | ||
case "mssql": | ||
packageJson.dependencies["mssql"] = "^9.1.1"; | ||
packageJson.dependencies["mssql"] = "^10.0.4"; | ||
break; | ||
case "mongodb": | ||
packageJson.dependencies["mongodb"] = "^5.2.0"; | ||
packageJson.dependencies["mongodb"] = "^6.15.0"; | ||
break; | ||
case "spanner": | ||
packageJson.dependencies["@google-cloud/spanner"] = "^5.18.0"; | ||
packageJson.dependencies["@google-cloud/spanner"] = "^7.19.1 "; | ||
break; | ||
} | ||
if (express) { | ||
packageJson.dependencies["express"] = "^4.17.2"; | ||
packageJson.dependencies["body-parser"] = "^1.19.1"; | ||
packageJson.dependencies["express"] = "^4.21.2"; | ||
packageJson.dependencies["body-parser"] = "^1.20.3"; | ||
} | ||
@@ -634,0 +636,0 @@ if (!packageJson.scripts) |
@@ -81,6 +81,4 @@ "use strict"; | ||
static getJavascriptTemplate(name, timestamp) { | ||
return `const { MigrationInterface, QueryRunner } = require("typeorm"); | ||
return `module.exports = class ${(0, StringUtils_1.camelCase)(name, true)}${timestamp} { | ||
module.exports = class ${(0, StringUtils_1.camelCase)(name, true)}${timestamp} { | ||
async up(queryRunner) { | ||
@@ -87,0 +85,0 @@ } |
@@ -97,3 +97,3 @@ "use strict"; | ||
upSqls.push(" await queryRunner.query(`" + | ||
upQuery.query.replace(new RegExp("`", "g"), "\\`") + | ||
upQuery.query.replaceAll("`", "\\`") + | ||
"`" + | ||
@@ -105,3 +105,3 @@ MigrationGenerateCommand.queryParams(upQuery.parameters) + | ||
downSqls.push(" await queryRunner.query(`" + | ||
downQuery.query.replace(new RegExp("`", "g"), "\\`") + | ||
downQuery.query.replaceAll("`", "\\`") + | ||
"`" + | ||
@@ -193,5 +193,3 @@ MigrationGenerateCommand.queryParams(downQuery.parameters) + | ||
const migrationName = `${(0, StringUtils_1.camelCase)(name, true)}${timestamp}`; | ||
return `const { MigrationInterface, QueryRunner } = require("typeorm"); | ||
module.exports = class ${migrationName} { | ||
return `module.exports = class ${migrationName} { | ||
name = '${migrationName}' | ||
@@ -198,0 +196,0 @@ |
@@ -7,7 +7,7 @@ "use strict"; | ||
const path_1 = tslib_1.__importDefault(require("path")); | ||
const error_1 = require("../error"); | ||
const PlatformTools_1 = require("../platform/PlatformTools"); | ||
const ImportUtils_1 = require("../util/ImportUtils"); | ||
const PathUtils_1 = require("../util/PathUtils"); | ||
const ConnectionOptionsEnvReader_1 = require("./options-reader/ConnectionOptionsEnvReader"); | ||
const error_1 = require("../error"); | ||
const PathUtils_1 = require("../util/PathUtils"); | ||
const ImportUtils_1 = require("../util/ImportUtils"); | ||
/** | ||
@@ -188,5 +188,3 @@ * Reads connection options from the ormconfig. | ||
get baseDirectory() { | ||
if (this.options && this.options.root) | ||
return this.options.root; | ||
return app_root_path_1.default.path; | ||
return this.options?.root ?? app_root_path_1.default.path; | ||
} | ||
@@ -197,5 +195,3 @@ /** | ||
get baseConfigName() { | ||
if (this.options && this.options.configName) | ||
return this.options.configName; | ||
return "ormconfig"; | ||
return this.options?.configName ?? "ormconfig"; | ||
} | ||
@@ -202,0 +198,0 @@ } |
@@ -420,3 +420,3 @@ "use strict"; | ||
return metadataFromMap; | ||
for (let [_, metadata] of this.entityMetadatasMap) { | ||
for (const [_, metadata] of this.entityMetadatasMap) { | ||
if (InstanceChecker_1.InstanceChecker.isEntitySchema(target) && | ||
@@ -480,3 +480,3 @@ metadata.name === target.options.name) { | ||
// set current data source to the entities | ||
for (let entityMetadata of entityMetadatas) { | ||
for (const entityMetadata of entityMetadatas) { | ||
if (InstanceChecker_1.InstanceChecker.isBaseEntityConstructor(entityMetadata.target)) { | ||
@@ -483,0 +483,0 @@ entityMetadata.target.useDataSource(this); |
@@ -5,4 +5,5 @@ import { SelectQueryBuilder } from "../../query-builder/SelectQueryBuilder"; | ||
* | ||
* @deprecated Do not use this decorator, it may be removed in the future versions | ||
* @deprecated This decorator will removed in the future versions. | ||
* Use {@link VirtualColumn} to calculate the count instead. | ||
*/ | ||
export declare function RelationCount<T>(relation: string | ((object: T) => any), alias?: string, queryBuilderFactory?: (qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>): PropertyDecorator; |
@@ -8,3 +8,4 @@ "use strict"; | ||
* | ||
* @deprecated Do not use this decorator, it may be removed in the future versions | ||
* @deprecated This decorator will removed in the future versions. | ||
* Use {@link VirtualColumn} to calculate the count instead. | ||
*/ | ||
@@ -11,0 +12,0 @@ function RelationCount(relation, alias, queryBuilderFactory) { |
@@ -275,3 +275,3 @@ "use strict"; | ||
if (!this.database) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
const queryRunner = this.createQueryRunner("master"); | ||
this.database = await queryRunner.getCurrentDatabase(); | ||
@@ -315,3 +315,3 @@ await queryRunner.release(); | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -344,3 +344,3 @@ return value | ||
buildTableName(tableName, schema, database) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (database) { | ||
@@ -347,0 +347,0 @@ tablePath.unshift(database); |
@@ -210,3 +210,3 @@ "use strict"; | ||
if (!this.database || !this.searchSchema) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
const queryRunner = this.createQueryRunner("master"); | ||
if (!this.database) { | ||
@@ -341,3 +341,3 @@ this.database = await queryRunner.getCurrentDatabase(); | ||
value = value | ||
.substr(1, value.length - 2) | ||
.slice(1, -1) | ||
.split(",") | ||
@@ -348,6 +348,4 @@ .map((val) => { | ||
val = val.slice(1, -1); | ||
// replace double escaped backslash to single escaped e.g. \\\\ -> \\ | ||
val = val.replace(/(\\\\)/g, "\\"); | ||
// replace escaped double quotes to non-escaped e.g. \"asd\" -> "asd" | ||
return val.replace(/(\\")/g, '"'); | ||
// replace escaped backslash and double quotes | ||
return val.replace(/\\(\\|")/g, "$1"); | ||
}); | ||
@@ -391,3 +389,3 @@ // convert to number if that exists in possible enum options | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -421,3 +419,3 @@ return value | ||
buildTableName(tableName, schema) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (schema) { | ||
@@ -424,0 +422,0 @@ tablePath.unshift(schema); |
@@ -298,3 +298,3 @@ import { QueryRunner } from "../../query-runner/QueryRunner"; | ||
*/ | ||
protected getVersion(): Promise<string>; | ||
getVersion(): Promise<string>; | ||
/** | ||
@@ -301,0 +301,0 @@ * Builds drop table sql. |
@@ -65,3 +65,3 @@ "use strict"; | ||
else { | ||
let resultSet = []; | ||
const resultSet = []; | ||
for (let i = 0; i < raw.rows.length; i++) { | ||
@@ -68,0 +68,0 @@ resultSet.push(raw.rows.item(i)); |
@@ -35,4 +35,3 @@ "use strict"; | ||
static isReleaseVersionOrGreater(driver, version) { | ||
return (driver.version != null && | ||
VersionUtils_1.VersionUtils.isGreaterOrEqual(driver.version, version)); | ||
return VersionUtils_1.VersionUtils.isGreaterOrEqual(driver.version, version); | ||
} | ||
@@ -98,3 +97,3 @@ static isPostgresFamily(driver) { | ||
const joiner = buildOptions && buildOptions.joiner ? buildOptions.joiner : "_"; | ||
let newAlias = alias.length === 1 ? alias[0] : alias.join(joiner); | ||
const newAlias = alias.length === 1 ? alias[0] : alias.join(joiner); | ||
if (maxAliasLength && | ||
@@ -178,3 +177,3 @@ maxAliasLength > 0 && | ||
let replicaSet = undefined; | ||
let optionsObject = {}; | ||
const optionsObject = {}; | ||
if (afterBase && afterBase.indexOf("?") !== -1) { | ||
@@ -214,3 +213,3 @@ // split params | ||
} | ||
let connectionUrl = { | ||
const connectionUrl = { | ||
type: type, | ||
@@ -217,0 +216,0 @@ host: host, |
@@ -134,3 +134,3 @@ "use strict"; | ||
if (raw?.hasOwnProperty("rows")) { | ||
let resultSet = []; | ||
const resultSet = []; | ||
for (let i = 0; i < raw.rows.length; i++) { | ||
@@ -137,0 +137,0 @@ resultSet.push(raw.rows.item(i)); |
@@ -5,3 +5,2 @@ import { BaseDataSourceOptions } from "../../data-source/BaseDataSourceOptions"; | ||
* MongoDB specific connection options. | ||
* Synced with http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html | ||
*/ | ||
@@ -42,6 +41,2 @@ export interface MongoConnectionOptions extends BaseDataSourceOptions { | ||
/** | ||
* Specifies whether to force dispatch all operations to the specified host. Default: false | ||
*/ | ||
readonly directConnection?: boolean; | ||
/** | ||
* The driver object | ||
@@ -52,234 +47,208 @@ * This defaults to require("mongodb") | ||
/** | ||
* Use ssl connection (needs to have a mongod server with ssl support). Default: false | ||
* MongoClientOptions | ||
* Synced with https://mongodb.github.io/node-mongodb-native/5.9/interfaces/MongoClientOptions.html | ||
*/ | ||
readonly ssl?: boolean; | ||
/** | ||
* Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher). | ||
* Default: true | ||
* 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 | ||
*/ | ||
readonly sslValidate?: boolean; | ||
readonly appName?: string; | ||
/** | ||
* Array of valid certificates either as Buffers or Strings | ||
* (needs to have a mongod server with ssl support, 2.4 or higher). | ||
* Specify the authentication mechanism that MongoDB will use to authenticate the connection. | ||
*/ | ||
readonly sslCA?: string | Buffer; | ||
readonly authMechanism?: string; | ||
/** | ||
* String or buffer containing the certificate we wish to present | ||
* (needs to have a mongod server with ssl support, 2.4 or higher) | ||
* Specify the database name associated with the user’s credentials. | ||
*/ | ||
readonly sslCert?: string | Buffer; | ||
readonly authSource?: string; | ||
/** | ||
* String or buffer containing the certificate private key we wish to present | ||
* (needs to have a mongod server with ssl support, 2.4 or higher) | ||
* Optionally enable in-use auto encryption | ||
*/ | ||
readonly sslKey?: string; | ||
readonly autoEncryption?: any; | ||
/** | ||
* String or buffer containing the certificate password | ||
* (needs to have a mongod server with ssl support, 2.4 or higher) | ||
* Verifies the certificate `cert` is issued to `hostname`. | ||
*/ | ||
readonly sslPass?: string | Buffer; | ||
readonly checkServerIdentity?: Function; | ||
/** | ||
* SSL Certificate revocation list binary buffer | ||
* (needs to have a mongod server with ssl support, 2.4 or higher) | ||
* An array or comma-delimited string of compressors to enable network | ||
* compression for communication between this client and a mongod/mongos instance. | ||
*/ | ||
readonly sslCRL?: string | Buffer; | ||
readonly compressors?: string | string[]; | ||
/** | ||
* Reconnect on error. Default: true | ||
* The time in milliseconds to attempt a connection before timing out. | ||
*/ | ||
readonly autoReconnect?: boolean; | ||
readonly connectTimeoutMS?: number; | ||
/** | ||
* TCP Socket NoDelay option. Default: true | ||
* Allow a driver to force a Single topology type with a connection string containing one host | ||
*/ | ||
readonly noDelay?: boolean; | ||
readonly directConnection?: boolean; | ||
/** | ||
* The number of milliseconds to wait before initiating keepAlive on the TCP socket. Default: 30000 | ||
* IP family | ||
*/ | ||
readonly keepAlive?: number; | ||
/** | ||
* TCP Connection timeout setting. Default: 30000 | ||
*/ | ||
readonly connectTimeoutMS?: number; | ||
/** | ||
* Version of IP stack. Can be 4, 6. | ||
* If undefined, will attempt to connect with IPv6, and will fall back to IPv4 on failure | ||
*/ | ||
readonly family?: number; | ||
/** | ||
* TCP Socket timeout setting. Default: 360000 | ||
* Force server to assign `_id` values instead of driver | ||
*/ | ||
readonly socketTimeoutMS?: number; | ||
readonly forceServerObjectId?: boolean; | ||
/** | ||
* Server attempt to reconnect #times. Default 30 | ||
* serialize will not emit undefined fields | ||
* note that the driver sets this to `false` | ||
*/ | ||
readonly reconnectTries?: number; | ||
readonly ignoreUndefined?: boolean; | ||
/** | ||
* Server will wait #milliseconds between retries. Default 1000 | ||
* @deprecated TCP Connection keep alive enabled. Will not be able to turn off in the future. | ||
*/ | ||
readonly reconnectInterval?: number; | ||
readonly keepAlive?: boolean; | ||
/** | ||
* Control if high availability monitoring runs for Replicaset or Mongos proxies. Default true | ||
* @deprecated The number of milliseconds to wait before initiating keepAlive on the TCP socket. | ||
* Will not be configurable in the future. | ||
*/ | ||
readonly ha?: boolean; | ||
readonly keepAliveInitialDelay?: number; | ||
/** | ||
* The High availability period for replicaset inquiry. Default: 10000 | ||
* The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. | ||
*/ | ||
readonly haInterval?: number; | ||
readonly localThresholdMS?: number; | ||
/** | ||
* The name of the replicaset to connect to | ||
* Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations. | ||
*/ | ||
readonly replicaSet?: string; | ||
readonly maxStalenessSeconds?: number; | ||
/** | ||
* Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms). | ||
* Default: 15 | ||
* The minimum number of connections in the connection pool. | ||
*/ | ||
readonly acceptableLatencyMS?: number; | ||
readonly minPoolSize?: number; | ||
/** | ||
* Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms). | ||
* Default: 15 | ||
* Enable command monitoring for this client | ||
*/ | ||
readonly secondaryAcceptableLatencyMS?: number; | ||
readonly monitorCommands?: boolean; | ||
/** | ||
* Sets if the driver should connect even if no primary is available. Default: false | ||
* TCP Connection no delay | ||
*/ | ||
readonly connectWithNoPrimary?: boolean; | ||
readonly noDelay?: boolean; | ||
/** | ||
* If the database authentication is dependent on another databaseName. | ||
* A primary key factory function for generation of custom `_id` keys | ||
*/ | ||
readonly authSource?: string; | ||
readonly pkFactory?: any; | ||
/** | ||
* The write concern. | ||
* when deserializing a Binary will return it as a node.js Buffer instance. | ||
*/ | ||
readonly w?: string | number; | ||
readonly promoteBuffers?: boolean; | ||
/** | ||
* The write concern timeout value. | ||
* when deserializing a Long will fit it into a Number if it's smaller than 53 bits. | ||
*/ | ||
readonly wtimeout?: number; | ||
/** | ||
* Specify a journal write concern. Default: false | ||
*/ | ||
readonly j?: boolean; | ||
/** | ||
* Force server to assign _id values instead of driver. Default: false | ||
*/ | ||
readonly forceServerObjectId?: boolean; | ||
/** | ||
* Serialize functions on any object. Default: false | ||
*/ | ||
readonly serializeFunctions?: boolean; | ||
/** | ||
* Specify if the BSON serializer should ignore undefined fields. Default: false | ||
*/ | ||
readonly ignoreUndefined?: boolean; | ||
/** | ||
* Return document results as raw BSON buffers. Default: false | ||
*/ | ||
readonly raw?: boolean; | ||
/** | ||
* Promotes Long values to number if they fit inside the 53 bits resolution. Default: true | ||
*/ | ||
readonly promoteLongs?: boolean; | ||
/** | ||
* Promotes Binary BSON values to native Node Buffers. Default: false | ||
* when deserializing will promote BSON values to their Node.js closest equivalent types. | ||
*/ | ||
readonly promoteBuffers?: boolean; | ||
/** | ||
* Promotes BSON values to native types where possible, set to false to only receive wrapper types. Default: true | ||
*/ | ||
readonly promoteValues?: boolean; | ||
/** | ||
* Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit. Default: false | ||
* Enabling the raw option will return a Node.js Buffer which is allocated using allocUnsafe API | ||
*/ | ||
readonly domainsEnabled?: boolean; | ||
readonly raw?: boolean; | ||
/** | ||
* Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, | ||
* default is -1 which is unlimited. | ||
* Specify a read concern for the collection (only MongoDB 3.2 or higher supported) | ||
*/ | ||
readonly bufferMaxEntries?: number; | ||
readonly readConcern?: any; | ||
/** | ||
* The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, | ||
* ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). | ||
* Specifies the read preferences for this connection | ||
*/ | ||
readonly readPreference?: ReadPreference | string; | ||
/** | ||
* A primary key factory object for generation of custom _id keys. | ||
* Specifies the tags document as a comma-separated list of colon-separated key-value pairs. | ||
*/ | ||
readonly pkFactory?: any; | ||
readonly readPreferenceTags?: any[]; | ||
/** | ||
* A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible. | ||
* Specifies the name of the replica set, if the mongod is a member of a replica set. | ||
*/ | ||
readonly promiseLibrary?: any; | ||
readonly replicaSet?: string; | ||
/** | ||
* Specify a read concern for the collection. (only MongoDB 3.2 or higher supported). | ||
* Enable retryable writes. | ||
*/ | ||
readonly readConcern?: any; | ||
readonly retryWrites?: boolean; | ||
/** | ||
* Specify a maxStalenessSeconds value for secondary reads, minimum is 90 seconds | ||
* serialize the javascript functions | ||
*/ | ||
readonly maxStalenessSeconds?: number; | ||
readonly serializeFunctions?: boolean; | ||
/** | ||
* Specify the log level used by the driver logger (error/warn/info/debug). | ||
* The time in milliseconds to attempt a send or receive on a socket before the attempt times out. | ||
*/ | ||
readonly loggerLevel?: "error" | "warn" | "info" | "debug"; | ||
readonly socketTimeoutMS?: number; | ||
/** | ||
* 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 | ||
* Default: true | ||
* @deprecated A boolean to enable or disables TLS/SSL for the connection. | ||
* (The ssl option is equivalent to the tls option.) | ||
*/ | ||
readonly checkServerIdentity?: boolean | Function; | ||
readonly ssl?: boolean; | ||
/** | ||
* Validate MongoClient passed in options for correctness. Default: false | ||
* @deprecated SSL Root Certificate file path. | ||
* | ||
* Will be removed in the next major version. Please use tlsCAFile instead. | ||
*/ | ||
readonly validateOptions?: boolean | any; | ||
readonly sslCA?: string; | ||
/** | ||
* 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 | ||
* @deprecated SSL Certificate revocation list file path. | ||
* | ||
* Will be removed in the next major version. | ||
*/ | ||
readonly appname?: string; | ||
readonly sslCRL?: string; | ||
/** | ||
* Sets the authentication mechanism that MongoDB will use to authenticate the connection | ||
* @deprecated SSL Certificate file path. | ||
* | ||
* Will be removed in the next major version. Please use tlsCertificateKeyFile instead. | ||
*/ | ||
readonly authMechanism?: string; | ||
readonly sslCert?: string; | ||
/** | ||
* Type of compression to use: snappy or zlib | ||
* @deprecated SSL Key file file path. | ||
* | ||
* Will be removed in the next major version. Please use tlsCertificateKeyFile instead. | ||
*/ | ||
readonly compression?: any; | ||
readonly sslKey?: string; | ||
/** | ||
* Specify a file sync write concern. Default: false | ||
* @deprecated SSL Certificate pass phrase. | ||
* | ||
* Will be removed in the next major version. Please use tlsCertificateKeyFilePassword instead. | ||
*/ | ||
readonly fsync?: boolean; | ||
readonly sslPass?: string; | ||
/** | ||
* Read preference tags | ||
* @deprecated Validate mongod server certificate against Certificate Authority | ||
* | ||
* Will be removed in the next major version. Please use tlsAllowInvalidCertificates instead. | ||
*/ | ||
readonly readPreferenceTags?: any[]; | ||
readonly sslValidate?: boolean; | ||
/** | ||
* The number of retries for a tailable cursor. Default: 5 | ||
* Enables or disables TLS/SSL for the connection. | ||
*/ | ||
readonly numberOfRetries?: number; | ||
readonly tls?: boolean; | ||
/** | ||
* Enable auto reconnecting for single server instances. Default: true | ||
* Bypasses validation of the certificates presented by the mongod/mongos instance | ||
*/ | ||
readonly auto_reconnect?: boolean; | ||
readonly tlsAllowInvalidCertificates?: boolean; | ||
/** | ||
* Enable command monitoring for this client. Default: false | ||
* Specifies the location of a local .pem file that contains the root certificate chain from the Certificate Authority. | ||
*/ | ||
readonly monitorCommands?: boolean; | ||
readonly tlsCAFile?: string; | ||
/** | ||
* If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections | ||
* Specifies the location of a local .pem file that contains the client's TLS/SSL certificate and key. | ||
*/ | ||
readonly minSize?: number; | ||
readonly tlsCertificateKeyFile?: string; | ||
/** | ||
* Determines whether or not to use the new url parser. Default: false | ||
* Specifies the password to de-crypt the tlsCertificateKeyFile. | ||
*/ | ||
readonly useNewUrlParser?: boolean; | ||
readonly tlsCertificateKeyFilePassword?: string; | ||
/** | ||
* Determines whether or not to use the new Server Discovery and Monitoring engine. Default: false | ||
* https://github.com/mongodb/node-mongodb-native/releases/tag/v3.2.1 | ||
* @deprecated The write concern w value | ||
* | ||
* Please use the `writeConcern` option instead | ||
*/ | ||
readonly useUnifiedTopology?: boolean; | ||
readonly w?: string | number; | ||
/** | ||
* Automatic Client-Side Field Level Encryption configuration. | ||
* A MongoDB WriteConcern, which describes the level of acknowledgement | ||
* requested from MongoDB for write operations. | ||
*/ | ||
readonly autoEncryption?: any; | ||
readonly writeConcern?: any; | ||
/** | ||
* Enables or disables the ability to retry writes upon encountering transient network errors. | ||
* @deprecated The write concern timeout | ||
* | ||
* Please use the `writeConcern` option instead | ||
*/ | ||
readonly retryWrites?: boolean; | ||
readonly wtimeoutMS?: number; | ||
} |
@@ -92,9 +92,8 @@ import { Driver } from "../Driver"; | ||
maxAliasLength?: number; | ||
cteCapabilities: CteCapabilities; | ||
/** | ||
* Valid mongo connection options | ||
* NOTE: Keep sync with MongoConnectionOptions | ||
* Sync with http://mongodb.github.io/node-mongodb-native/3.5/api/MongoClient.html | ||
* NOTE: Keep in sync with MongoConnectionOptions | ||
*/ | ||
protected validOptionNames: string[]; | ||
cteCapabilities: CteCapabilities; | ||
constructor(connection: DataSource); | ||
@@ -101,0 +100,0 @@ /** |
@@ -83,2 +83,5 @@ "use strict"; | ||
}; | ||
this.cteCapabilities = { | ||
enabled: false, | ||
}; | ||
// ------------------------------------------------------------------------- | ||
@@ -89,73 +92,59 @@ // Protected Properties | ||
* Valid mongo connection options | ||
* NOTE: Keep sync with MongoConnectionOptions | ||
* Sync with http://mongodb.github.io/node-mongodb-native/3.5/api/MongoClient.html | ||
* NOTE: Keep in sync with MongoConnectionOptions | ||
*/ | ||
this.validOptionNames = [ | ||
"poolSize", | ||
"appName", | ||
"authMechanism", | ||
"authSource", | ||
"autoEncryption", | ||
"checkServerIdentity", | ||
"compressors", | ||
"connectTimeoutMS", | ||
"directConnection", | ||
"family", | ||
"forceServerObjectId", | ||
"ignoreUndefined", | ||
"keepAlive", | ||
"keepAliveInitialDelay", | ||
"localThresholdMS", | ||
"maxStalenessSeconds", | ||
"minPoolSize", | ||
"monitorCommands", | ||
"noDelay", | ||
"pkFactory", | ||
"promoteBuffers", | ||
"promoteLongs", | ||
"promoteValues", | ||
"raw", | ||
"readConcern", | ||
"readPreference", | ||
"readPreferenceTags", | ||
"replicaSet", | ||
"retryWrites", | ||
"serializeFunctions", | ||
"socketTimeoutMS", | ||
"ssl", | ||
"sslValidate", | ||
"sslCA", | ||
"sslCRL", | ||
"sslCert", | ||
"sslKey", | ||
"sslPass", | ||
"sslCRL", | ||
"autoReconnect", | ||
"noDelay", | ||
"keepAlive", | ||
"keepAliveInitialDelay", | ||
"connectTimeoutMS", | ||
"family", | ||
"socketTimeoutMS", | ||
"reconnectTries", | ||
"reconnectInterval", | ||
"ha", | ||
"haInterval", | ||
"replicaSet", | ||
"secondaryAcceptableLatencyMS", | ||
"acceptableLatencyMS", | ||
"connectWithNoPrimary", | ||
"authSource", | ||
"sslValidate", | ||
"tls", | ||
"tlsAllowInvalidCertificates", | ||
"tlsCAFile", | ||
"tlsCertificateKeyFile", | ||
"tlsCertificateKeyFilePassword", | ||
"w", | ||
"wtimeout", | ||
"j", | ||
"writeConcern", | ||
"forceServerObjectId", | ||
"serializeFunctions", | ||
"ignoreUndefined", | ||
"raw", | ||
"bufferMaxEntries", | ||
"readPreference", | ||
"pkFactory", | ||
"promiseLibrary", | ||
"readConcern", | ||
"maxStalenessSeconds", | ||
"loggerLevel", | ||
// Do not overwrite BaseDataSourceOptions.logger | ||
// "logger", | ||
"promoteValues", | ||
"promoteBuffers", | ||
"promoteLongs", | ||
"domainsEnabled", | ||
"checkServerIdentity", | ||
"validateOptions", | ||
"wtimeoutMS", | ||
// Undocumented deprecated options | ||
// todo: remove next major version | ||
"appname", | ||
// omit auth - we are building url from username and password | ||
// "auth" | ||
"authMechanism", | ||
"compression", | ||
"fsync", | ||
"readPreferenceTags", | ||
"numberOfRetries", | ||
"auto_reconnect", | ||
"minSize", | ||
"monitorCommands", | ||
"j", | ||
"useNewUrlParser", | ||
"useUnifiedTopology", | ||
"autoEncryption", | ||
"retryWrites", | ||
"directConnection", | ||
"wtimeout", | ||
]; | ||
this.cteCapabilities = { | ||
enabled: false, | ||
}; | ||
this.options = connection.options; | ||
@@ -388,6 +377,6 @@ // validate options to make sure everything is correct and driver will be able to establish connection | ||
options.host + portUrlPart || | ||
"127.0.0.1" + portUrlPart}/${options.database || ""}?replicaSet=${options.replicaSet}${options.tls ? "&tls=true" : ""}`; | ||
"127.0.0.1" + portUrlPart}/${options.database || ""}`; | ||
} | ||
else { | ||
connectionString = `${schemaUrlPart}://${credentialsUrlPart}${options.host || "127.0.0.1"}${portUrlPart}/${options.database || ""}${options.tls ? "?tls=true" : ""}`; | ||
connectionString = `${schemaUrlPart}://${credentialsUrlPart}${options.host || "127.0.0.1"}${portUrlPart}/${options.database || ""}`; | ||
} | ||
@@ -401,11 +390,14 @@ return connectionString; | ||
const mongoOptions = {}; | ||
for (let index = 0; index < this.validOptionNames.length; index++) { | ||
const optionName = this.validOptionNames[index]; | ||
if (options.extra && optionName in options.extra) { | ||
mongoOptions[optionName] = options.extra[optionName]; | ||
} | ||
else if (optionName in options) { | ||
for (const optionName of this.validOptionNames) { | ||
if (optionName in options) { | ||
mongoOptions[optionName] = options[optionName]; | ||
} | ||
} | ||
mongoOptions.driverInfo = { | ||
name: "TypeORM", | ||
}; | ||
if ("poolSize" in options) { | ||
mongoOptions["maxPoolSize"] = options["poolSize"]; | ||
} | ||
Object.assign(mongoOptions, options.extra); | ||
return mongoOptions; | ||
@@ -412,0 +404,0 @@ } |
@@ -308,3 +308,3 @@ "use strict"; | ||
if (!this.database) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
const queryRunner = this.createQueryRunner("master"); | ||
this.database = await queryRunner.getCurrentDatabase(); | ||
@@ -314,17 +314,15 @@ await queryRunner.release(); | ||
const queryRunner = this.createQueryRunner("master"); | ||
const result = await queryRunner.query(`SELECT VERSION() AS \`version\``); | ||
const dbVersion = result[0].version; | ||
this.version = dbVersion; | ||
this.version = await queryRunner.getVersion(); | ||
await queryRunner.release(); | ||
if (this.options.type === "mariadb") { | ||
if (VersionUtils_1.VersionUtils.isGreaterOrEqual(dbVersion, "10.0.5")) { | ||
if (VersionUtils_1.VersionUtils.isGreaterOrEqual(this.version, "10.0.5")) { | ||
this._isReturningSqlSupported.delete = true; | ||
} | ||
if (VersionUtils_1.VersionUtils.isGreaterOrEqual(dbVersion, "10.5.0")) { | ||
if (VersionUtils_1.VersionUtils.isGreaterOrEqual(this.version, "10.5.0")) { | ||
this._isReturningSqlSupported.insert = true; | ||
} | ||
if (VersionUtils_1.VersionUtils.isGreaterOrEqual(dbVersion, "10.2.0")) { | ||
if (VersionUtils_1.VersionUtils.isGreaterOrEqual(this.version, "10.2.0")) { | ||
this.cteCapabilities.enabled = true; | ||
} | ||
if (VersionUtils_1.VersionUtils.isGreaterOrEqual(dbVersion, "10.7.0")) { | ||
if (VersionUtils_1.VersionUtils.isGreaterOrEqual(this.version, "10.7.0")) { | ||
this.uuidColumnTypeSuported = true; | ||
@@ -334,3 +332,3 @@ } | ||
else if (this.options.type === "mysql") { | ||
if (VersionUtils_1.VersionUtils.isGreaterOrEqual(dbVersion, "8.0.0")) { | ||
if (VersionUtils_1.VersionUtils.isGreaterOrEqual(this.version, "8.0.0")) { | ||
this.cteCapabilities.enabled = true; | ||
@@ -393,3 +391,3 @@ } | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -422,3 +420,3 @@ return value | ||
buildTableName(tableName, schema, database) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (database) { | ||
@@ -587,3 +585,3 @@ tablePath.unshift(database); | ||
this.options.type === "mariadb" && | ||
!VersionUtils_1.VersionUtils.isGreaterOrEqual(this.version ?? "0.0.0", "10.4.3")) { | ||
!VersionUtils_1.VersionUtils.isGreaterOrEqual(this.version, "10.4.3")) { | ||
/* | ||
@@ -590,0 +588,0 @@ * MariaDB implements this as a LONGTEXT rather, as the JSON data type contradicts the SQL standard, |
@@ -327,3 +327,3 @@ import { QueryRunner } from "../../query-runner/QueryRunner"; | ||
protected buildCreateColumnSql(column: TableColumn, skipPrimary: boolean, skipName?: boolean): string; | ||
protected getVersion(): Promise<string>; | ||
getVersion(): Promise<string>; | ||
/** | ||
@@ -330,0 +330,0 @@ * Checks if column display width is by default. |
@@ -235,3 +235,3 @@ "use strict"; | ||
if (!this.database || !this.schema) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
const queryRunner = this.createQueryRunner("master"); | ||
if (!this.database) { | ||
@@ -295,3 +295,3 @@ this.database = await queryRunner.getCurrentDatabase(); | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -328,3 +328,3 @@ return value | ||
buildTableName(tableName, schema, database) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (schema) { | ||
@@ -331,0 +331,0 @@ tablePath.unshift(schema); |
@@ -16,2 +16,3 @@ import { ObjectLiteral } from "../../common/ObjectLiteral"; | ||
import { PostgresConnectionOptions } from "./PostgresConnectionOptions"; | ||
import { PostgresQueryRunner } from "./PostgresQueryRunner"; | ||
import { Table } from "../../schema-builder/table/Table"; | ||
@@ -164,3 +165,3 @@ import { View } from "../../schema-builder/view/View"; | ||
*/ | ||
createQueryRunner(mode: ReplicationMode): QueryRunner; | ||
createQueryRunner(mode: ReplicationMode): PostgresQueryRunner; | ||
/** | ||
@@ -167,0 +168,0 @@ * Prepares given value to a value to be persisted, based on its column type and metadata. |
@@ -101,2 +101,3 @@ "use strict"; | ||
"macaddr", | ||
"macaddr8", | ||
"tsvector", | ||
@@ -262,12 +263,11 @@ "tsquery", | ||
} | ||
if (!this.database || !this.searchSchema) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
if (!this.database) { | ||
this.database = await queryRunner.getCurrentDatabase(); | ||
} | ||
if (!this.searchSchema) { | ||
this.searchSchema = await queryRunner.getCurrentSchema(); | ||
} | ||
await queryRunner.release(); | ||
const queryRunner = this.createQueryRunner("master"); | ||
this.version = await queryRunner.getVersion(); | ||
if (!this.database) { | ||
this.database = await queryRunner.getCurrentDatabase(); | ||
} | ||
if (!this.searchSchema) { | ||
this.searchSchema = await queryRunner.getCurrentSchema(); | ||
} | ||
await queryRunner.release(); | ||
if (!this.schema) { | ||
@@ -288,6 +288,3 @@ this.schema = this.searchSchema; | ||
} | ||
const results = (await this.executeQuery(connection, "SELECT version();")); | ||
const versionString = results.rows[0].version.replace(/^PostgreSQL ([\d.]+) .*$/, "$1"); | ||
this.version = versionString; | ||
this.isGeneratedColumnsSupported = VersionUtils_1.VersionUtils.isGreaterOrEqual(versionString, "12.0"); | ||
this.isGeneratedColumnsSupported = VersionUtils_1.VersionUtils.isGreaterOrEqual(this.version, "12.0"); | ||
await release(); | ||
@@ -567,3 +564,3 @@ } | ||
value = value | ||
.substr(1, value.length - 2) | ||
.slice(1, -1) | ||
.split(",") | ||
@@ -574,6 +571,4 @@ .map((val) => { | ||
val = val.slice(1, -1); | ||
// replace double escaped backslash to single escaped e.g. \\\\ -> \\ | ||
val = val.replace(/(\\\\)/g, "\\"); | ||
// replace escaped double quotes to non-escaped e.g. \"asd\" -> "asd" | ||
return val.replace(/(\\")/g, '"'); | ||
// replace escaped backslash and double quotes | ||
return val.replace(/\\(\\|")/g, "$1"); | ||
}); | ||
@@ -621,3 +616,3 @@ // convert to number if that exists in possible enum options | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -651,3 +646,3 @@ return value | ||
buildTableName(tableName, schema) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (schema) { | ||
@@ -654,0 +649,0 @@ tablePath.unshift(schema); |
@@ -297,3 +297,3 @@ import { ReadStream } from "../../platform/PlatformTools"; | ||
*/ | ||
protected getVersion(): Promise<string>; | ||
getVersion(): Promise<string>; | ||
/** | ||
@@ -300,0 +300,0 @@ * Builds drop table sql. |
@@ -332,3 +332,3 @@ "use strict"; | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -335,0 +335,0 @@ return value |
@@ -63,3 +63,3 @@ "use strict"; | ||
if (raw?.hasOwnProperty("rows")) { | ||
let records = []; | ||
const records = []; | ||
for (let i = 0; i < raw.rows.length; i++) { | ||
@@ -66,0 +66,0 @@ records.push(raw.rows.item(i)); |
@@ -45,2 +45,6 @@ import { ColumnType, DataSource, EntityMetadata, ObjectLiteral, Table, TableColumn, TableForeignKey } from "../.."; | ||
/** | ||
* Version of SAP HANA. Requires a SQL query to the DB, so it is not always set | ||
*/ | ||
version?: string; | ||
/** | ||
* Database name used to perform all write queries. | ||
@@ -68,3 +72,4 @@ */ | ||
* | ||
* @see https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.03/en-US/20a1569875191014b507cf392724b7eb.html | ||
* @see https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/20a1569875191014b507cf392724b7eb.html | ||
* @see https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/data-types | ||
*/ | ||
@@ -71,0 +76,0 @@ supportedDataTypes: ColumnType[]; |
@@ -44,3 +44,4 @@ "use strict"; | ||
* | ||
* @see https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.03/en-US/20a1569875191014b507cf392724b7eb.html | ||
* @see https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/20a1569875191014b507cf392724b7eb.html | ||
* @see https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/data-types | ||
*/ | ||
@@ -50,3 +51,3 @@ this.supportedDataTypes = [ | ||
"smallint", | ||
"int", | ||
"int", // typeorm alias for "integer" | ||
"integer", | ||
@@ -56,6 +57,6 @@ "bigint", | ||
"decimal", | ||
"dec", | ||
"dec", // typeorm alias for "decimal" | ||
"real", | ||
"double", | ||
"float", | ||
"float", // database alias for "real" / "double" | ||
"date", | ||
@@ -66,13 +67,13 @@ "time", | ||
"boolean", | ||
"char", | ||
"nchar", | ||
"varchar", | ||
"char", // not officially supported, in SAP HANA Cloud: alias for "nchar" | ||
"nchar", // not officially supported | ||
"varchar", // in SAP HANA Cloud: alias for "nvarchar" | ||
"nvarchar", | ||
"text", | ||
"alphanum", | ||
"shorttext", | ||
"text", // removed in SAP HANA Cloud | ||
"alphanum", // removed in SAP HANA Cloud | ||
"shorttext", // removed in SAP HANA Cloud | ||
"array", | ||
"varbinary", | ||
"blob", | ||
"clob", | ||
"clob", // in SAP HANA Cloud: alias for "nclob" | ||
"nclob", | ||
@@ -184,2 +185,4 @@ "st_geometry", | ||
dbParams.databaseName = this.options.database; | ||
if (this.options.schema) | ||
dbParams.currentSchema = this.options.schema; | ||
if (this.options.encrypt) | ||
@@ -218,12 +221,10 @@ dbParams.encrypt = this.options.encrypt; | ||
this.master = this.client.createPool(dbParams, options); | ||
if (!this.database || !this.schema) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
if (!this.database) { | ||
this.database = await queryRunner.getCurrentDatabase(); | ||
} | ||
if (!this.schema) { | ||
this.schema = await queryRunner.getCurrentSchema(); | ||
} | ||
await queryRunner.release(); | ||
const queryRunner = this.createQueryRunner("master"); | ||
const { version, database } = await queryRunner.getDatabaseAndVersion(); | ||
this.version = version; | ||
this.database = database; | ||
if (!this.schema) { | ||
this.schema = await queryRunner.getCurrentSchema(); | ||
} | ||
await queryRunner.release(); | ||
} | ||
@@ -272,3 +273,3 @@ /** | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -304,3 +305,3 @@ return value | ||
buildTableName(tableName, schema) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (schema) { | ||
@@ -434,2 +435,15 @@ tablePath.unshift(schema); | ||
} | ||
else if (column.type === "dec") { | ||
return "decimal"; | ||
} | ||
else if (column.type === "float") { | ||
const length = typeof column.length === "string" | ||
? parseInt(column.length) | ||
: column.length; | ||
// https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/4ee2f261e9c44003807d08ccc2e249ac.html | ||
if (length && length < 25) { | ||
return "real"; | ||
} | ||
return "double"; | ||
} | ||
else if (column.type === String) { | ||
@@ -452,3 +466,3 @@ return "nvarchar"; | ||
column.type === "simple-json") { | ||
return "text"; | ||
return "nclob"; | ||
} | ||
@@ -458,5 +472,17 @@ else if (column.type === "simple-enum") { | ||
} | ||
else { | ||
return column.type || ""; | ||
if (DriverUtils_1.DriverUtils.isReleaseVersionOrGreater(this, "4.0")) { | ||
// SAP HANA Cloud deprecated / removed these data types | ||
if (column.type === "varchar" || | ||
column.type === "alphanum" || | ||
column.type === "shorttext") { | ||
return "nvarchar"; | ||
} | ||
else if (column.type === "text" || column.type === "clob") { | ||
return "nclob"; | ||
} | ||
else if (column.type === "char") { | ||
return "nchar"; | ||
} | ||
} | ||
return column.type || ""; | ||
} | ||
@@ -580,20 +606,7 @@ /** | ||
const tableColumn = tableColumns.find((c) => c.name === columnMetadata.databaseName); | ||
if (!tableColumn) | ||
return false; // we don't need new columns, we only need exist and changed | ||
// console.log("table:", columnMetadata.entityMetadata.tableName); | ||
// console.log("name:", tableColumn.name, columnMetadata.databaseName); | ||
// console.log("type:", tableColumn.type, _this.normalizeType(columnMetadata)); | ||
// console.log("length:", tableColumn.length, _this.getColumnLength(columnMetadata)); | ||
// console.log("width:", tableColumn.width, columnMetadata.width); | ||
// console.log("precision:", tableColumn.precision, columnMetadata.precision); | ||
// console.log("scale:", tableColumn.scale, columnMetadata.scale); | ||
// console.log("default:", tableColumn.default, columnMetadata.default); | ||
// console.log("isPrimary:", tableColumn.isPrimary, columnMetadata.isPrimary); | ||
// console.log("isNullable:", tableColumn.isNullable, columnMetadata.isNullable); | ||
// console.log("isUnique:", tableColumn.isUnique, _this.normalizeIsUnique(columnMetadata)); | ||
// console.log("isGenerated:", tableColumn.isGenerated, columnMetadata.isGenerated); | ||
// console.log((columnMetadata.generationStrategy !== "uuid" && tableColumn.isGenerated !== columnMetadata.isGenerated)); | ||
// console.log("=========================================="); | ||
const normalizeDefault = this.normalizeDefault(columnMetadata); | ||
const hanaNullComapatibleDefault = normalizeDefault == null ? undefined : normalizeDefault; | ||
if (!tableColumn) { | ||
// we don't need new columns, we only need exist and changed | ||
return false; | ||
} | ||
const normalizedDefault = this.normalizeDefault(columnMetadata); | ||
return (tableColumn.name !== columnMetadata.databaseName || | ||
@@ -609,3 +622,3 @@ tableColumn.type !== this.normalizeType(columnMetadata) || | ||
(!tableColumn.isGenerated && | ||
hanaNullComapatibleDefault !== tableColumn.default) || // we included check for generated here, because generated columns already can have default values | ||
normalizedDefault !== tableColumn.default) || // we included check for generated here, because generated columns already can have default values | ||
tableColumn.isPrimary !== columnMetadata.isPrimary || | ||
@@ -635,3 +648,3 @@ tableColumn.isNullable !== columnMetadata.isNullable || | ||
isFullTextColumnTypeSupported() { | ||
return true; | ||
return !DriverUtils_1.DriverUtils.isReleaseVersionOrGreater(this, "4.0"); | ||
} | ||
@@ -638,0 +651,0 @@ /** |
@@ -87,2 +87,9 @@ import { ReadStream } from "../../platform/PlatformTools"; | ||
/** | ||
* Returns the database server version. | ||
*/ | ||
getDatabaseAndVersion(): Promise<{ | ||
database: string; | ||
version: string; | ||
}>; | ||
/** | ||
* Checks if schema with the given name exist. | ||
@@ -89,0 +96,0 @@ */ |
@@ -186,3 +186,3 @@ "use strict"; | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (value === null) { | ||
@@ -210,3 +210,3 @@ return full; | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (value === null) { | ||
@@ -230,3 +230,3 @@ return " IS NULL"; | ||
buildTableName(tableName, schema, database) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (database) { | ||
@@ -233,0 +233,0 @@ tablePath.unshift(database); |
@@ -322,3 +322,3 @@ "use strict"; | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -325,0 +325,0 @@ return value |
@@ -185,3 +185,3 @@ "use strict"; | ||
try { | ||
let result = this.databaseConnection.exec(query); | ||
const result = this.databaseConnection.exec(query); | ||
this.connection.logger.logQuery(query); | ||
@@ -188,0 +188,0 @@ return OrmUtils_1.OrmUtils.mergeDeep(map, generatedColumn.createValueMap(result[0].values[0][0])); |
@@ -213,3 +213,3 @@ "use strict"; | ||
if (!this.database || !this.searchSchema) { | ||
const queryRunner = await this.createQueryRunner("master"); | ||
const queryRunner = this.createQueryRunner("master"); | ||
if (!this.database) { | ||
@@ -280,3 +280,3 @@ this.database = await queryRunner.getCurrentDatabase(); | ||
} | ||
let value = parameters[key]; | ||
const value = parameters[key]; | ||
if (isArray) { | ||
@@ -310,3 +310,3 @@ return value | ||
buildTableName(tableName, schema, database) { | ||
let tablePath = [tableName]; | ||
const tablePath = [tableName]; | ||
if (schema) { | ||
@@ -313,0 +313,0 @@ tablePath.unshift(schema); |
@@ -21,3 +21,3 @@ /** | ||
*/ | ||
export type SimpleColumnType = "simple-array" | "simple-json" | "simple-enum" | "int2" | "integer" | "int4" | "int8" | "int64" | "unsigned big int" | "float" | "float4" | "float8" | "float64" | "smallmoney" | "money" | "boolean" | "bool" | "tinyblob" | "tinytext" | "mediumblob" | "mediumtext" | "blob" | "text" | "ntext" | "citext" | "hstore" | "longblob" | "longtext" | "alphanum" | "shorttext" | "bytes" | "bytea" | "long" | "raw" | "long raw" | "bfile" | "clob" | "nclob" | "image" | "timetz" | "timestamptz" | "timestamp with local time zone" | "smalldatetime" | "date" | "interval year to month" | "interval day to second" | "interval" | "year" | "seconddate" | "point" | "line" | "lseg" | "box" | "circle" | "path" | "polygon" | "geography" | "geometry" | "linestring" | "multipoint" | "multilinestring" | "multipolygon" | "geometrycollection" | "st_geometry" | "st_point" | "int4range" | "int8range" | "numrange" | "tsrange" | "tstzrange" | "daterange" | "int4multirange" | "int8multirange" | "nummultirange" | "tsmultirange" | "tstzmultirange" | "datemultirange" | "enum" | "set" | "cidr" | "inet" | "inet4" | "inet6" | "macaddr" | "bit" | "bit varying" | "varbit" | "tsvector" | "tsquery" | "uuid" | "xml" | "json" | "jsonb" | "varbinary" | "hierarchyid" | "sql_variant" | "rowid" | "urowid" | "uniqueidentifier" | "rowversion" | "array" | "cube" | "ltree"; | ||
export type SimpleColumnType = "simple-array" | "simple-json" | "simple-enum" | "int2" | "integer" | "int4" | "int8" | "int64" | "unsigned big int" | "float" | "float4" | "float8" | "float64" | "smallmoney" | "money" | "boolean" | "bool" | "tinyblob" | "tinytext" | "mediumblob" | "mediumtext" | "blob" | "text" | "ntext" | "citext" | "hstore" | "longblob" | "longtext" | "alphanum" | "shorttext" | "bytes" | "bytea" | "long" | "raw" | "long raw" | "bfile" | "clob" | "nclob" | "image" | "timetz" | "timestamptz" | "timestamp with local time zone" | "smalldatetime" | "date" | "interval year to month" | "interval day to second" | "interval" | "year" | "seconddate" | "point" | "line" | "lseg" | "box" | "circle" | "path" | "polygon" | "geography" | "geometry" | "linestring" | "multipoint" | "multilinestring" | "multipolygon" | "geometrycollection" | "st_geometry" | "st_point" | "int4range" | "int8range" | "numrange" | "tsrange" | "tstzrange" | "daterange" | "int4multirange" | "int8multirange" | "nummultirange" | "tsmultirange" | "tstzmultirange" | "datemultirange" | "enum" | "set" | "cidr" | "inet" | "inet4" | "inet6" | "macaddr" | "macaddr8" | "bit" | "bit varying" | "varbit" | "tsvector" | "tsquery" | "uuid" | "xml" | "json" | "jsonb" | "varbinary" | "hierarchyid" | "sql_variant" | "rowid" | "urowid" | "uniqueidentifier" | "rowversion" | "array" | "cube" | "ltree"; | ||
/** | ||
@@ -24,0 +24,0 @@ * Any column type column can be. |
@@ -151,3 +151,3 @@ "use strict"; | ||
Object.keys(result.raw.insertedIds).forEach((key) => { | ||
let insertedId = result.raw.insertedIds[key]; | ||
const insertedId = result.raw.insertedIds[key]; | ||
result.generatedMaps.push(this.connection.driver.createGeneratedMap(this.connection.getMetadata(target), insertedId)); | ||
@@ -154,0 +154,0 @@ result.identifiers.push(this.connection.driver.createGeneratedMap(this.connection.getMetadata(target), insertedId)); |
@@ -5,3 +5,3 @@ import { ObjectId } from "../driver/mongodb/typings"; | ||
*/ | ||
export type FindOptionsSelectProperty<Property> = Property extends Promise<infer I> ? FindOptionsSelectProperty<I> | boolean : Property extends Array<infer I> ? FindOptionsSelectProperty<I> | boolean : Property extends string ? boolean : Property extends number ? boolean : Property extends boolean ? boolean : Property extends Function ? never : Property extends Buffer ? boolean : Property extends Date ? boolean : Property extends ObjectId ? boolean : Property extends object ? FindOptionsSelect<Property> : boolean; | ||
export type FindOptionsSelectProperty<Property> = Property extends Promise<infer I> ? FindOptionsSelectProperty<I> | boolean : Property extends Array<infer I> ? FindOptionsSelectProperty<I> | boolean : Property extends string ? boolean : Property extends number ? boolean : Property extends boolean ? boolean : Property extends Function ? never : Property extends Buffer ? boolean : Property extends Date ? boolean : Property extends ObjectId ? boolean : Property extends object ? FindOptionsSelect<Property> | boolean : boolean; | ||
/** | ||
@@ -8,0 +8,0 @@ * Select find options. |
@@ -262,3 +262,3 @@ "use strict"; | ||
// generate a relation alias | ||
let relationAlias = DriverUtils_1.DriverUtils.buildAlias(qb.connection.driver, { joiner: "__" }, alias, relation.propertyPath); | ||
const relationAlias = DriverUtils_1.DriverUtils.buildAlias(qb.connection.driver, { joiner: "__" }, alias, relation.propertyPath); | ||
// add a join for the found relation | ||
@@ -265,0 +265,0 @@ const selection = alias + "." + relation.propertyPath; |
@@ -132,2 +132,3 @@ /*! | ||
export * from "./driver/sqlserver/MssqlParameter"; | ||
export * from "./subscriber/event/QueryEvent"; | ||
export { ConnectionOptionsReader } from "./connection/ConnectionOptionsReader"; | ||
@@ -134,0 +135,0 @@ export { ConnectionOptions } from "./connection/ConnectionOptions"; |
@@ -139,2 +139,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./driver/sqlserver/MssqlParameter"), exports); | ||
tslib_1.__exportStar(require("./subscriber/event/QueryEvent"), exports); | ||
// export * from "./data-source"; | ||
@@ -141,0 +142,0 @@ var ConnectionOptionsReader_1 = require("./connection/ConnectionOptionsReader"); |
@@ -16,3 +16,3 @@ "use strict"; | ||
const messages = this.prepareLogMessages(logMessage); | ||
for (let message of messages) { | ||
for (const message of messages) { | ||
switch (message.type ?? level) { | ||
@@ -19,0 +19,0 @@ case "log": |
@@ -60,3 +60,3 @@ "use strict"; | ||
}); | ||
for (let message of messages) { | ||
for (const message of messages) { | ||
const messageTypeOrLevel = message.type ?? level; | ||
@@ -63,0 +63,0 @@ if (messageTypeOrLevel in this.logger) { |
@@ -32,3 +32,3 @@ "use strict"; | ||
const strings = []; | ||
for (let message of messages) { | ||
for (const message of messages) { | ||
switch (message.type ?? level) { | ||
@@ -35,0 +35,0 @@ case "log": |
@@ -17,3 +17,3 @@ "use strict"; | ||
}); | ||
for (let message of messages) { | ||
for (const message of messages) { | ||
switch (message.type ?? level) { | ||
@@ -20,0 +20,0 @@ case "log": |
@@ -558,3 +558,3 @@ "use strict"; | ||
const columnValue = this.getEntityValue(entity); | ||
if (ObjectUtils_1.ObjectUtils.isObject(columnValue)) { | ||
if (typeof columnValue?.equals === "function") { | ||
return columnValue.equals(valueToCompareWith); | ||
@@ -561,0 +561,0 @@ } |
@@ -173,3 +173,3 @@ "use strict"; | ||
return this.propertyName; | ||
let prefixes = []; | ||
const prefixes = []; | ||
if (this.parentEmbeddedMetadata) | ||
@@ -176,0 +176,0 @@ prefixes.push(this.parentEmbeddedMetadata.buildPrefix(connection)); |
@@ -138,3 +138,3 @@ "use strict"; | ||
// get the time when last migration was executed | ||
let lastTimeExecutedMigration = this.getLatestTimestampMigration(executedMigrations); | ||
const lastTimeExecutedMigration = this.getLatestTimestampMigration(executedMigrations); | ||
// get all user's migrations in the source code | ||
@@ -245,3 +245,3 @@ const allMigrations = this.getMigrations(); | ||
successMigrations.push(migration); | ||
this.connection.logger.logSchemaBuild(`Migration ${migration.name} has been ${this.fake ? "(fake)" : ""} executed successfully.`); | ||
this.connection.logger.logSchemaBuild(`Migration ${migration.name} has been ${this.fake ? "(fake) " : ""}executed successfully.`); | ||
}); | ||
@@ -288,3 +288,3 @@ } | ||
// get the time when last migration was executed | ||
let lastTimeExecutedMigration = this.getLatestExecutedMigration(executedMigrations); | ||
const lastTimeExecutedMigration = this.getLatestExecutedMigration(executedMigrations); | ||
// if no migrations found in the database then nothing to revert | ||
@@ -319,3 +319,3 @@ if (!lastTimeExecutedMigration) { | ||
await this.deleteExecutedMigration(queryRunner, migrationToRevert); | ||
this.connection.logger.logSchemaBuild(`Migration ${migrationToRevert.name} has been ${this.fake ? "(fake)" : ""} reverted successfully.`); | ||
this.connection.logger.logSchemaBuild(`Migration ${migrationToRevert.name} has been ${this.fake ? "(fake) " : ""}reverted successfully.`); | ||
// commit transaction if we started it | ||
@@ -322,0 +322,0 @@ if (transactionStartedByUs) |
@@ -1,1 +0,1 @@ | ||
{ "name": "typeorm", "private": false, "version": "0.3.22-dev.40cc688", "description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.", "license": "MIT", "readmeFilename": "README.md", "author": { "name": "Umed Khudoiberdiev", "email": "pleerock.me@gmail.com" }, "engines": { "node": ">=16.13.0" }, "exports": { ".": { "types": "./index.d.ts", "node": { "import": "./index.mjs", "require": "./index.js", "types": "./index.d.ts" }, "browser": { "require": "./index.js", "import": "./browser/index.js", "default": "./index.js" } }, "./browser": { "types": "./index.d.ts", "default": "./browser/index.js" }, "./*.js": "./*.js", "./*": { "require": "./*.js", "import": "./*" } }, "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", "browser": { "./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsYmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/driver/aurora-data-api/AuroraDataApiDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/better-sqlite3/BetterSqlite3Driver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/cockroachdb/CockroachDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoQueryRunner.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/bson.typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mysql/MysqlDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/oracle/OracleDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/postgres/PostgresDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sap/SapDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlite/SqliteDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlserver/SqlServerDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/entity-manager/MongoEntityManager.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/logger/FileLogger.js": "./browser/platform/BrowserFileLoggerDummy.js", "./browser/platform/PlatformTools.js": "./browser/platform/BrowserPlatformTools.js", "./browser/repository/MongoRepository.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/util/DirectoryExportedClassesLoader.js": "./browser/platform/BrowserDirectoryExportedClassesLoader.js", "./index.js": "./browser/index.js", "./index.mjs": "./browser/index.js" }, "repository": { "type": "git", "url": "https://github.com/typeorm/typeorm.git" }, "bugs": { "url": "https://github.com/typeorm/typeorm/issues" }, "homepage": "https://typeorm.io", "tags": [ "orm", "typescript", "typescript-orm", "mysql", "mysql-orm", "postgresql", "postgresql-orm", "mariadb", "mariadb-orm", "spanner", "sqlite", "sqlite-orm", "sql-server", "sql-server-orm", "oracle", "oracle-orm", "cloud-spanner", "cloud-spanner-orm" ], "devDependencies": { "@eslint/js": "^9.17.0", "@tsconfig/node16": "^16.1.1", "@types/chai": "^4.3.4", "@types/chai-as-promised": "^7.1.5", "@types/debug": "^4.1.7", "@types/gulp-rename": "^2.0.6", "@types/gulp-sourcemaps": "^0.0.38", "@types/mocha": "^10.0.1", "@types/node": "^18.13.0", "@types/sha.js": "^2.4.0", "@types/sinon": "^10.0.13", "@types/source-map-support": "^0.5.6", "@types/uuid": "^9.0.0", "@types/yargs": "^17.0.22", "better-sqlite3": "^8.1.0", "chai": "^4.3.7", "chai-as-promised": "^7.1.1", "class-transformer": "^0.5.1", "conventional-changelog-angular": "^5.0.13", "conventional-changelog-cli": "^2.2.2", "eslint": "^9.17.0", "globals": "^15.14.0", "gulp": "^4.0.2", "gulp-istanbul": "^1.1.3", "gulp-mocha": "^10.0.0", "gulp-rename": "^2.0.0", "gulp-replace": "^1.1.4", "gulp-shell": "^0.8.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1", "gulpclass": "^0.2.0", "husky": "^8.0.3", "mocha": "^10.8.2", "mongodb": "^6.3.0", "mssql": "^11.0.1", "mysql": "^2.18.1", "mysql2": "^3.9.7", "nyc": "^17.1.0", "pg": "^8.9.0", "pg-query-stream": "^4.3.0", "prettier": "^2.8.8", "redis": "^4.6.4", "remap-istanbul": "^0.13.0", "rimraf": "^6.0.1", "sinon": "^15.0.1", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", "sql.js": "^1.8.0", "sqlite3": "^5.1.4", "ts-node": "^10.9.2", "typeorm-aurora-data-api-driver": "^2.4.4", "typescript": "^5.7.2", "typescript-eslint": "^8.18.1" }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0", "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^5.8.0", "mssql": "^9.1.1 || ^10.0.1 || ^11.0.1", "mysql2": "^2.2.5 || ^3.0.1", "oracledb": "^6.3.0", "pg": "^8.5.1", "pg-native": "^3.0.0", "pg-query-stream": "^4.0.0", "redis": "^3.1.1 || ^4.0.0", "reflect-metadata": "^0.1.14 || ^0.2.0", "sql.js": "^1.4.0", "sqlite3": "^5.0.3", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0" }, "peerDependenciesMeta": { "@google-cloud/spanner": { "optional": true }, "@sap/hana-client": { "optional": true }, "better-sqlite3": { "optional": true }, "hdb-pool": { "optional": true }, "ioredis": { "optional": true }, "mongodb": { "optional": true }, "mssql": { "optional": true }, "mysql2": { "optional": true }, "oracledb": { "optional": true }, "pg": { "optional": true }, "pg-native": { "optional": true }, "pg-query-stream": { "optional": true }, "redis": { "optional": true }, "sql.js": { "optional": true }, "sqlite3": { "optional": true }, "ts-node": { "optional": true }, "typeorm-aurora-data-api-driver": { "optional": true } }, "dependencies": { "@sqltools/formatter": "^1.2.5", "ansis": "^3.9.0", "app-root-path": "^3.1.0", "buffer": "^6.0.3", "dayjs": "^1.11.9", "debug": "^4.3.4", "dotenv": "^16.0.3", "glob": "^10.4.5", "sha.js": "^2.4.11", "sql-highlight": "^6.0.0", "tslib": "^2.5.0", "uuid": "^11.0.5", "yargs": "^17.6.2" }, "scripts": { "test": "rimraf ./build && tsc && mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 90000 ./build/compiled/test", "test-fast": "mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 90000 ./build/compiled/test", "compile": "rimraf ./build && tsc", "watch": "./node_modules/.bin/tsc -w", "package": "gulp package", "pack": "gulp pack", "lint": "eslint .", "format": "prettier --cache --write --end-of-line auto \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1" }, "bin": { "typeorm": "./cli.js", "typeorm-ts-node-commonjs": "./cli-ts-node-commonjs.js", "typeorm-ts-node-esm": "./cli-ts-node-esm.js" }, "funding": "https://opencollective.com/typeorm", "collective": { "type": "opencollective", "url": "https://opencollective.com/typeorm", "logo": "https://opencollective.com/opencollective/logo.txt" } } | ||
{ "name": "typeorm", "version": "0.3.22-dev.460ef02", "private": false, "description": "Data-Mapper ORM for TypeScript and ES2021+. Supports MySQL/MariaDB, PostgreSQL, MS SQL Server, Oracle, SAP HANA, SQLite, MongoDB databases.", "homepage": "https://typeorm.io", "bugs": { "url": "https://github.com/typeorm/typeorm/issues" }, "repository": { "type": "git", "url": "https://github.com/typeorm/typeorm.git" }, "funding": "https://opencollective.com/typeorm", "license": "MIT", "author": { "name": "Umed Khudoiberdiev", "email": "pleerock.me@gmail.com" }, "exports": { ".": { "types": "./index.d.ts", "node": { "import": "./index.mjs", "require": "./index.js", "types": "./index.d.ts" }, "browser": { "require": "./index.js", "import": "./browser/index.js", "default": "./index.js" } }, "./browser": { "types": "./index.d.ts", "default": "./browser/index.js" }, "./*.js": "./*.js", "./*": { "require": "./*.js", "import": "./*" } }, "main": "./index.js", "module": "./index.mjs", "browser": { "./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsYmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/driver/aurora-data-api/AuroraDataApiDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/better-sqlite3/BetterSqlite3Driver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/cockroachdb/CockroachDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoQueryRunner.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/bson.typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mysql/MysqlDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/oracle/OracleDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/postgres/PostgresDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sap/SapDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlite/SqliteDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlserver/SqlServerDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/entity-manager/MongoEntityManager.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/logger/FileLogger.js": "./browser/platform/BrowserFileLoggerDummy.js", "./browser/platform/PlatformTools.js": "./browser/platform/BrowserPlatformTools.js", "./browser/repository/MongoRepository.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/util/DirectoryExportedClassesLoader.js": "./browser/platform/BrowserDirectoryExportedClassesLoader.js", "./index.js": "./browser/index.js", "./index.mjs": "./browser/index.js" }, "types": "./index.d.ts", "bin": { "typeorm": "./cli.js", "typeorm-ts-node-commonjs": "./cli-ts-node-commonjs.js", "typeorm-ts-node-esm": "./cli-ts-node-esm.js" }, "scripts": { "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1", "compile": "rimraf ./build && tsc", "format": "prettier --cache --write \"./**/*.ts\"", "format:ci": "prettier --check \"./**/*.ts\"", "lint": "eslint .", "pack": "gulp pack", "package": "gulp package", "test": "npm run compile && npm run test:fast --", "test:ci": "mocha --bail", "test:fast": "mocha", "watch": "tsc --watch" }, "dependencies": { "@sqltools/formatter": "^1.2.5", "ansis": "^3.17.0", "app-root-path": "^3.1.0", "buffer": "^6.0.3", "dayjs": "^1.11.13", "debug": "^4.4.0", "dotenv": "^16.4.7", "glob": "^10.4.5", "sha.js": "^2.4.11", "sql-highlight": "^6.0.0", "tslib": "^2.8.1", "uuid": "^11.1.0", "yargs": "^17.7.2" }, "devDependencies": { "@eslint/js": "^9.22.0", "@sap/hana-client": "^2.24.21", "@tsconfig/node16": "^16.1.3", "@types/chai": "^4.3.20", "@types/chai-as-promised": "^7.1.8", "@types/debug": "^4.1.12", "@types/gulp-rename": "^2.0.6", "@types/gulp-sourcemaps": "^0.0.38", "@types/mocha": "^10.0.10", "@types/node": "^16.18.126", "@types/sha.js": "^2.4.4", "@types/sinon": "^10.0.20", "@types/sinon-chai": "^4.0.0", "@types/source-map-support": "^0.5.10", "@types/yargs": "^17.0.33", "better-sqlite3": "^8.7.0", "chai": "^4.5.0", "chai-as-promised": "^7.1.2", "class-transformer": "^0.5.1", "conventional-changelog-angular": "^7.0.0", "conventional-changelog-cli": "^5.0.0", "eslint": "^9.22.0", "globals": "^16.0.0", "gulp": "^4.0.2", "gulp-rename": "^2.0.0", "gulp-replace": "^1.1.4", "gulp-shell": "^0.8.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1", "gulpclass": "^0.2.0", "hdb-pool": "^0.1.6", "mocha": "^10.8.2", "mongodb": "^6.15.0", "mssql": "^11.0.1", "mysql": "^2.18.1", "mysql2": "^3.14.0", "nyc": "^17.1.0", "oracledb": "^6.8.0", "pg": "^8.14.1", "pg-query-stream": "^4.8.1", "prettier": "^2.8.8", "redis": "^4.7.0", "remap-istanbul": "^0.13.0", "rimraf": "^5.0.10", "sinon": "^15.2.0", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", "sql.js": "^1.13.0", "sqlite3": "^5.1.7", "ts-node": "^10.9.2", "typescript": "^5.8.2", "typescript-eslint": "^8.27.0" }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0 || ^6.0.0 || ^7.0.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0", "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^5.8.0 || ^6.0.0", "mssql": "^9.1.1 || ^10.0.1 || ^11.0.1", "mysql2": "^2.2.5 || ^3.0.1", "oracledb": "^6.3.0", "pg": "^8.5.1", "pg-native": "^3.0.0", "pg-query-stream": "^4.0.0", "redis": "^3.1.1 || ^4.0.0", "reflect-metadata": "^0.1.14 || ^0.2.0", "sql.js": "^1.4.0", "sqlite3": "^5.0.3", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0 || ^3.0.0" }, "peerDependenciesMeta": { "@google-cloud/spanner": { "optional": true }, "@sap/hana-client": { "optional": true }, "better-sqlite3": { "optional": true }, "hdb-pool": { "optional": true }, "ioredis": { "optional": true }, "mongodb": { "optional": true }, "mssql": { "optional": true }, "mysql2": { "optional": true }, "oracledb": { "optional": true }, "pg": { "optional": true }, "pg-native": { "optional": true }, "pg-query-stream": { "optional": true }, "redis": { "optional": true }, "sql.js": { "optional": true }, "sqlite3": { "optional": true }, "ts-node": { "optional": true }, "typeorm-aurora-data-api-driver": { "optional": true } }, "engines": { "node": ">=16.13.0" }, "collective": { "type": "opencollective", "url": "https://opencollective.com/typeorm", "logo": "https://opencollective.com/opencollective/logo.txt" }, "readmeFilename": "README.md", "tags": [ "orm", "typescript", "typescript-orm", "mariadb", "mariadb-orm", "mysql", "mysql-orm", "oracle", "oracle-orm", "postgresql", "postgresql-orm", "sap-hana", "sap-hana-orm", "spanner", "cloud-spanner", "cloud-spanner-orm", "sqlite", "sqlite-orm", "sql-server", "sql-server-orm" ] } |
@@ -46,3 +46,3 @@ "use strict"; | ||
// with third classes - like subscribers and listener methods | ||
let oldQueryRunnerData = queryRunner.data; | ||
const oldQueryRunnerData = queryRunner.data; | ||
if (this.options && this.options.data) { | ||
@@ -69,3 +69,3 @@ queryRunner.data = this.options.data; | ||
throw new CannotDetermineEntityError_1.CannotDetermineEntityError(this.mode); | ||
let metadata = this.connection | ||
const metadata = this.connection | ||
.getMetadata(entityTarget) | ||
@@ -72,0 +72,0 @@ .findInheritanceMetadata(entity); |
@@ -60,3 +60,3 @@ "use strict"; | ||
// by example: get category from the passed to persist post entity | ||
let relatedEntity = relation.getEntityValue(subject.entity); // by example: relatedEntity is a category here | ||
const relatedEntity = relation.getEntityValue(subject.entity); // by example: relatedEntity is a category here | ||
if (relatedEntity === undefined) | ||
@@ -63,0 +63,0 @@ // if relation is undefined then nothing to update |
@@ -108,3 +108,3 @@ "use strict"; | ||
// this way we tell what subjects we tried to load database entities of | ||
for (let subject of allSubjects) { | ||
for (const subject of allSubjects) { | ||
subject.databaseEntityLoaded = true; | ||
@@ -111,0 +111,0 @@ } |
@@ -381,3 +381,3 @@ "use strict"; | ||
const updateResult = await updateQueryBuilder.execute(); | ||
let updateGeneratedMap = updateResult.generatedMaps[0]; | ||
const updateGeneratedMap = updateResult.generatedMaps[0]; | ||
if (updateGeneratedMap) { | ||
@@ -384,0 +384,0 @@ subject.metadata.columns.forEach((column) => { |
@@ -129,5 +129,5 @@ "use strict"; | ||
function uniqueNodes(arr) { | ||
let res = []; | ||
const res = []; | ||
for (let i = 0, len = arr.length; i < len; i++) { | ||
let edge = arr[i]; | ||
const edge = arr[i]; | ||
if (res.indexOf(edge[0]) < 0) | ||
@@ -158,9 +158,9 @@ res.push(edge[0]); | ||
// outgoing edges | ||
let outgoing = edges.filter(function (edge) { | ||
const outgoing = edges.filter(function (edge) { | ||
return edge[0] === node; | ||
}); | ||
if ((i = outgoing.length)) { | ||
let preds = predecessors.concat(node); | ||
const preds = predecessors.concat(node); | ||
do { | ||
let child = outgoing[--i][1]; | ||
const child = outgoing[--i][1]; | ||
visit(child, nodes.indexOf(child), preds); | ||
@@ -167,0 +167,0 @@ } while (i); |
@@ -180,3 +180,3 @@ "use strict"; | ||
const rightColumnName = escape(metadata.nestedSetRightColumn.databaseName); | ||
let entitiesIds = []; | ||
const entitiesIds = []; | ||
for (const subject of subjects) { | ||
@@ -188,3 +188,3 @@ const entityId = metadata.getEntityIdMap(subject.entity); | ||
} | ||
let entitiesNs = await this.getNestedSetIds(metadata, entitiesIds); | ||
const entitiesNs = await this.getNestedSetIds(metadata, entitiesIds); | ||
for (const entity of entitiesNs) { | ||
@@ -191,0 +191,0 @@ const treeSize = entity.right - entity.left + 1; |
@@ -565,3 +565,4 @@ "use strict"; | ||
else if (value === null && | ||
this.connection.driver.options.type === "spanner") { | ||
(this.connection.driver.options.type === "spanner" || | ||
this.connection.driver.options.type === "oracle")) { | ||
expression += "NULL"; | ||
@@ -568,0 +569,0 @@ // support for SQL expressions in queries |
@@ -39,3 +39,3 @@ "use strict"; | ||
if (!this.isSelectedEvaluated) { | ||
let getValue = () => { | ||
const getValue = () => { | ||
for (const select of this.queryExpressionMap.selects) { | ||
@@ -95,3 +95,3 @@ if (select.selection === this.alias.name) | ||
if (!this.relationEvaluated) { | ||
let getValue = () => { | ||
const getValue = () => { | ||
if (!QueryBuilderUtils_1.QueryBuilderUtils.isAliasProperty(this.entityOrProperty)) | ||
@@ -98,0 +98,0 @@ return undefined; |
@@ -769,3 +769,3 @@ "use strict"; | ||
const cteStrings = this.expressionMap.commonTableExpressions.map((cte) => { | ||
let cteBodyExpression = typeof cte.queryBuilder === 'string' ? cte.queryBuilder : ''; | ||
let cteBodyExpression = typeof cte.queryBuilder === "string" ? cte.queryBuilder : ""; | ||
if (typeof cte.queryBuilder !== "string") { | ||
@@ -1005,3 +1005,3 @@ if (cte.queryBuilder.hasCommonTableExpressions()) { | ||
if (InstanceChecker_1.InstanceChecker.isFindOperator(parameterValue)) { | ||
let parameters = []; | ||
const parameters = []; | ||
if (parameterValue.useParameter) { | ||
@@ -1008,0 +1008,0 @@ if (parameterValue.objectLiteralParameters) { |
@@ -314,5 +314,5 @@ "use strict"; | ||
if (relatedEntities && hasAllJoinColumnsInEntity) { | ||
let relationIdMaps = []; | ||
const relationIdMaps = []; | ||
entities.forEach((entity) => { | ||
let relationIdMap = {}; | ||
const relationIdMap = {}; | ||
relation.entityMetadata.primaryColumns.forEach((primaryColumn) => { | ||
@@ -319,0 +319,0 @@ const key = primaryColumn.entityMetadata.name + |
@@ -354,3 +354,3 @@ "use strict"; | ||
createLimitExpression() { | ||
let limit = this.expressionMap.limit; | ||
const limit = this.expressionMap.limit; | ||
if (limit) { | ||
@@ -357,0 +357,0 @@ if (DriverUtils_1.DriverUtils.isMySQLFamily(this.connection.driver)) { |
@@ -112,3 +112,3 @@ "use strict"; | ||
} | ||
let entity = metadata.create(this.queryRunner, { | ||
const entity = metadata.create(this.queryRunner, { | ||
fromDeserializer: true, | ||
@@ -144,3 +144,3 @@ pojo: this.pojo, | ||
// we don't mark it as has data because if we will have all nulls in our object - we don't need such object | ||
else if (value !== null) | ||
else if (value !== null && !column.isVirtualProperty) | ||
hasData = true; | ||
@@ -147,0 +147,0 @@ column.setEntityValue(entity, this.driver.prepareHydratedValue(value, column)); |
@@ -294,3 +294,3 @@ "use strict"; | ||
const valuesSetNormalized = {}; | ||
for (let key in valuesSet) { | ||
for (const key in valuesSet) { | ||
if (valuesSet[key] !== undefined) { | ||
@@ -410,3 +410,3 @@ valuesSetNormalized[key] = valuesSet[key]; | ||
Object.keys(valuesSetNormalized).map((key) => { | ||
let value = valuesSetNormalized[key]; | ||
const value = valuesSetNormalized[key]; | ||
// todo: duplication zone | ||
@@ -474,3 +474,3 @@ if (typeof value === "function") { | ||
createLimitExpression() { | ||
let limit = this.expressionMap.limit; | ||
const limit = this.expressionMap.limit; | ||
if (limit) { | ||
@@ -477,0 +477,0 @@ if (DriverUtils_1.DriverUtils.isMySQLFamily(this.connection.driver) || |
@@ -39,3 +39,3 @@ import { EntityManager } from "../../entity-manager/EntityManager"; | ||
/** | ||
* The duration of the query execution. | ||
* The duration of the query execution, in milliseconds. | ||
*/ | ||
@@ -42,0 +42,0 @@ executionTime?: number; |
@@ -295,2 +295,5 @@ // this "shim" can be used on the frontend to prevent from errors on undefined | ||
/* export */ function VirtualColumn() { | ||
return noop | ||
} | ||
exports.VirtualColumn = VirtualColumn; |
@@ -24,4 +24,4 @@ "use strict"; | ||
function createDFS(edges, leavesOnly, result) { | ||
let currentPath = []; | ||
let visited = {}; | ||
const currentPath = []; | ||
const visited = {}; | ||
return function DFS(currentNode) { | ||
@@ -161,6 +161,6 @@ visited[currentNode] = true; | ||
if (this.hasNode(node)) { | ||
let result = []; | ||
let DFS = createDFS(this.outgoingEdges, leavesOnly, result); | ||
const result = []; | ||
const DFS = createDFS(this.outgoingEdges, leavesOnly, result); | ||
DFS(node); | ||
let idx = result.indexOf(node); | ||
const idx = result.indexOf(node); | ||
if (idx >= 0) { | ||
@@ -184,6 +184,6 @@ result.splice(idx, 1); | ||
if (this.hasNode(node)) { | ||
let result = []; | ||
let DFS = createDFS(this.incomingEdges, leavesOnly, result); | ||
const result = []; | ||
const DFS = createDFS(this.incomingEdges, leavesOnly, result); | ||
DFS(node); | ||
let idx = result.indexOf(node); | ||
const idx = result.indexOf(node); | ||
if (idx >= 0) { | ||
@@ -206,5 +206,5 @@ result.splice(idx, 1); | ||
overallOrder(leavesOnly) { | ||
let self = this; | ||
let result = []; | ||
let keys = Object.keys(this.nodes); | ||
const self = this; | ||
const result = []; | ||
const keys = Object.keys(this.nodes); | ||
if (keys.length === 0) { | ||
@@ -216,7 +216,7 @@ return result; // Empty graph | ||
// are several disconnected subgraphs inside this dependency graph. | ||
let CycleDFS = createDFS(this.outgoingEdges, false, []); | ||
const CycleDFS = createDFS(this.outgoingEdges, false, []); | ||
keys.forEach(function (n) { | ||
CycleDFS(n); | ||
}); | ||
let DFS = createDFS(this.outgoingEdges, leavesOnly, result); | ||
const DFS = createDFS(this.outgoingEdges, leavesOnly, result); | ||
// Find all potential starting points (nodes with nothing depending on them) an | ||
@@ -223,0 +223,0 @@ // run a DFS starting at these points to get the order |
@@ -24,6 +24,6 @@ "use strict"; | ||
else if (Array.isArray(exported)) { | ||
exported.forEach((i) => loadFileClasses(i, allLoaded)); | ||
exported.forEach((value) => loadFileClasses(value, allLoaded)); | ||
} | ||
else if (ObjectUtils_1.ObjectUtils.isObject(exported)) { | ||
Object.keys(exported).forEach((key) => loadFileClasses(exported[key], allLoaded)); | ||
Object.values(exported).forEach((value) => loadFileClasses(value, allLoaded)); | ||
} | ||
@@ -30,0 +30,0 @@ return allLoaded; |
@@ -1,1 +0,1 @@ | ||
export declare const escapeRegExp: (s: String) => string; | ||
export declare const escapeRegExp: (s: string) => string; |
@@ -8,3 +8,3 @@ import { MixedList } from "../common/MixedList"; | ||
*/ | ||
static isObject(val: any): val is Object; | ||
static isObject(val: any): val is object; | ||
/** | ||
@@ -15,3 +15,3 @@ * Checks if given value is an object. | ||
*/ | ||
static isObjectWithName(val: any): val is Object & { | ||
static isObjectWithName(val: any): val is object & { | ||
name: string; | ||
@@ -18,0 +18,0 @@ }; |
@@ -165,3 +165,3 @@ "use strict"; | ||
static replaceEmptyObjectsWithBooleans(obj) { | ||
for (let key in obj) { | ||
for (const key in obj) { | ||
if (obj[key] && typeof obj[key] === "object") { | ||
@@ -178,4 +178,4 @@ if (Object.keys(obj[key]).length === 0) { | ||
static propertyPathsToTruthyObject(paths) { | ||
let obj = {}; | ||
for (let path of paths) { | ||
const obj = {}; | ||
for (const path of paths) { | ||
const props = path.split("."); | ||
@@ -188,3 +188,3 @@ if (!props.length) | ||
let recursiveChild = obj[props[0]]; | ||
for (let [key, prop] of props.entries()) { | ||
for (const [key, prop] of props.entries()) { | ||
if (key === 0) | ||
@@ -191,0 +191,0 @@ continue; |
@@ -18,7 +18,7 @@ "use strict"; | ||
static sha1(str) { | ||
let _rotLeft = function (n, s) { | ||
let t4 = (n << s) | (n >>> (32 - s)); | ||
const _rotLeft = function (n, s) { | ||
const t4 = (n << s) | (n >>> (32 - s)); | ||
return t4; | ||
}; | ||
let _cvtHex = function (val) { | ||
const _cvtHex = function (val) { | ||
let str = ""; | ||
@@ -35,3 +35,3 @@ let i; | ||
let i, j; | ||
let W = new Array(80); | ||
const W = new Array(80); | ||
let H0 = 0x67452301; | ||
@@ -46,4 +46,4 @@ let H1 = 0xefcdab89; | ||
str = /*unescape*/ encodeURIComponent(str); | ||
let strLen = str.length; | ||
let wordArray = []; | ||
const strLen = str.length; | ||
const wordArray = []; | ||
for (i = 0; i < strLen - 3; i += 4) { | ||
@@ -50,0 +50,0 @@ j = |
@@ -1,4 +0,3 @@ | ||
export type Version = [number, number, number]; | ||
export declare class VersionUtils { | ||
static isGreaterOrEqual(version: string, targetVersion: string): boolean; | ||
static isGreaterOrEqual(version: string | undefined, targetVersion: string): boolean; | ||
} |
@@ -6,16 +6,23 @@ "use strict"; | ||
static isGreaterOrEqual(version, targetVersion) { | ||
if (!version) { | ||
return false; | ||
} | ||
const v1 = parseVersion(version); | ||
const v2 = parseVersion(targetVersion); | ||
return (v1[0] > v2[0] || | ||
(v1[0] === v2[0] && v1[1] > v2[1]) || | ||
(v1[0] === v2[0] && v1[1] === v2[1] && v1[2] >= v2[2])); | ||
for (let i = 0; i < v1.length && i < v2.length; i++) { | ||
if (v1[i] > v2[i]) { | ||
return true; | ||
} | ||
else if (v1[i] < v2[i]) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
} | ||
exports.VersionUtils = VersionUtils; | ||
function parseVersion(version = "") { | ||
const v = [0, 0, 0]; | ||
version.split(".").forEach((value, i) => (v[i] = parseInt(value, 10))); | ||
return v; | ||
function parseVersion(version) { | ||
return version.split(".").map((value) => parseInt(value, 10)); | ||
} | ||
//# sourceMappingURL=VersionUtils.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
52
-1.89%189326
0.01%20427927
-0.02%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated
Updated
Updated