typeorm 0.3.9 → 0.3.10-dev.749809a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cli-ts-node-commonjs.js +0 -0
- package/browser/cli-ts-node-esm.js +0 -0
- package/browser/data-source/BaseDataSourceOptions.d.ts +4 -0
- package/browser/data-source/BaseDataSourceOptions.js.map +1 -1
- package/browser/data-source/DataSource.d.ts +1 -1
- package/browser/data-source/DataSource.js.map +1 -1
- package/browser/driver/aurora-mysql/AuroraMysqlConnectionOptions.d.ts +1 -0
- package/browser/driver/aurora-mysql/AuroraMysqlConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-postgres/AuroraPostgresConnectionOptions.d.ts +1 -0
- package/browser/driver/aurora-postgres/AuroraPostgresConnectionOptions.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +1 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/browser/driver/capacitor/CapacitorConnectionOptions.d.ts +1 -0
- package/browser/driver/capacitor/CapacitorConnectionOptions.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachDriver.js +1 -0
- package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/browser/driver/cordova/CordovaConnectionOptions.d.ts +1 -0
- package/browser/driver/cordova/CordovaConnectionOptions.js.map +1 -1
- package/browser/driver/expo/ExpoConnectionOptions.d.ts +1 -0
- package/browser/driver/expo/ExpoConnectionOptions.js.map +1 -1
- package/browser/driver/mongodb/MongoConnectionOptions.d.ts +0 -4
- package/browser/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/browser/driver/mongodb/typings.d.ts +2 -0
- package/browser/driver/mysql/MysqlDriver.js +1 -1
- package/browser/driver/mysql/MysqlDriver.js.map +1 -1
- package/browser/driver/nativescript/NativescriptConnectionOptions.d.ts +1 -0
- package/browser/driver/nativescript/NativescriptConnectionOptions.js.map +1 -1
- package/browser/driver/oracle/OracleDriver.js +2 -0
- package/browser/driver/oracle/OracleDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresDriver.js +1 -0
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/react-native/ReactNativeConnectionOptions.d.ts +1 -0
- package/browser/driver/react-native/ReactNativeConnectionOptions.js.map +1 -1
- package/browser/driver/sap/SapConnectionOptions.d.ts +1 -0
- package/browser/driver/sap/SapConnectionOptions.js.map +1 -1
- package/browser/driver/spanner/SpannerConnectionOptions.d.ts +1 -0
- package/browser/driver/spanner/SpannerConnectionOptions.js.map +1 -1
- package/browser/driver/sqlite/SqliteConnectionOptions.d.ts +1 -0
- package/browser/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +2 -0
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqljs/SqljsConnectionOptions.d.ts +1 -0
- package/browser/driver/sqljs/SqljsConnectionOptions.js.map +1 -1
- package/browser/driver/sqljs/SqljsDriver.d.ts +1 -0
- package/browser/driver/sqljs/SqljsDriver.js +3 -1
- package/browser/driver/sqljs/SqljsDriver.js.map +1 -1
- package/browser/driver/sqljs/SqljsQueryRunner.js +3 -1
- package/browser/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.d.ts +1 -0
- package/browser/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/browser/entity-manager/EntityManager.d.ts +20 -20
- package/browser/entity-manager/EntityManager.js.map +1 -1
- package/browser/entity-schema/EntitySchemaColumnOptions.d.ts +4 -0
- package/browser/entity-schema/EntitySchemaColumnOptions.js.map +1 -1
- package/browser/entity-schema/EntitySchemaTransformer.js +1 -0
- package/browser/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/browser/find-options/FindOptionsUtils.d.ts +2 -1
- package/browser/find-options/FindOptionsUtils.js.map +1 -1
- package/browser/query-builder/DeleteQueryBuilder.d.ts +2 -2
- package/browser/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/InsertQueryBuilder.d.ts +2 -2
- package/browser/query-builder/InsertQueryBuilder.js.map +1 -1
- package/browser/query-builder/QueryBuilder.d.ts +3 -3
- package/browser/query-builder/QueryBuilder.js.map +1 -1
- package/browser/query-builder/QueryPartialEntity.d.ts +5 -2
- package/browser/query-builder/QueryPartialEntity.js.map +1 -1
- package/browser/query-builder/RelationIdLoader.js +15 -14
- package/browser/query-builder/RelationIdLoader.js.map +1 -1
- package/browser/query-builder/RelationQueryBuilder.d.ts +2 -1
- package/browser/query-builder/RelationQueryBuilder.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.d.ts +5 -5
- package/browser/query-builder/SelectQueryBuilder.js +1 -1
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/repository/BaseEntity.js.map +1 -1
- package/browser/util/OrmUtils.js +2 -0
- package/browser/util/OrmUtils.js.map +1 -1
- package/cli-ts-node-commonjs.js +0 -0
- package/cli-ts-node-esm.js +0 -0
- package/cli.js +0 -0
- package/commands/InitCommand.js +5 -5
- package/commands/InitCommand.js.map +1 -1
- package/data-source/BaseDataSourceOptions.d.ts +4 -0
- package/data-source/BaseDataSourceOptions.js.map +1 -1
- package/data-source/DataSource.d.ts +1 -1
- package/data-source/DataSource.js.map +1 -1
- package/driver/aurora-mysql/AuroraMysqlConnectionOptions.d.ts +1 -0
- package/driver/aurora-mysql/AuroraMysqlConnectionOptions.js.map +1 -1
- package/driver/aurora-postgres/AuroraPostgresConnectionOptions.d.ts +1 -0
- package/driver/aurora-postgres/AuroraPostgresConnectionOptions.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +1 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/driver/capacitor/CapacitorConnectionOptions.d.ts +1 -0
- package/driver/capacitor/CapacitorConnectionOptions.js.map +1 -1
- package/driver/cockroachdb/CockroachDriver.js +1 -0
- package/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/driver/cordova/CordovaConnectionOptions.d.ts +1 -0
- package/driver/cordova/CordovaConnectionOptions.js.map +1 -1
- package/driver/expo/ExpoConnectionOptions.d.ts +1 -0
- package/driver/expo/ExpoConnectionOptions.js.map +1 -1
- package/driver/mongodb/MongoConnectionOptions.d.ts +0 -4
- package/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/driver/mongodb/typings.d.ts +2 -0
- package/driver/mysql/MysqlDriver.js +1 -1
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/nativescript/NativescriptConnectionOptions.d.ts +1 -0
- package/driver/nativescript/NativescriptConnectionOptions.js.map +1 -1
- package/driver/oracle/OracleDriver.js +2 -0
- package/driver/oracle/OracleDriver.js.map +1 -1
- package/driver/postgres/PostgresDriver.js +1 -0
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/react-native/ReactNativeConnectionOptions.d.ts +1 -0
- package/driver/react-native/ReactNativeConnectionOptions.js.map +1 -1
- package/driver/sap/SapConnectionOptions.d.ts +1 -0
- package/driver/sap/SapConnectionOptions.js.map +1 -1
- package/driver/spanner/SpannerConnectionOptions.d.ts +1 -0
- package/driver/spanner/SpannerConnectionOptions.js.map +1 -1
- package/driver/sqlite/SqliteConnectionOptions.d.ts +1 -0
- package/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +2 -0
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqljs/SqljsConnectionOptions.d.ts +1 -0
- package/driver/sqljs/SqljsConnectionOptions.js.map +1 -1
- package/driver/sqljs/SqljsDriver.d.ts +1 -0
- package/driver/sqljs/SqljsDriver.js +3 -1
- package/driver/sqljs/SqljsDriver.js.map +1 -1
- package/driver/sqljs/SqljsQueryRunner.js +3 -1
- package/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/driver/sqlserver/SqlServerConnectionOptions.d.ts +1 -0
- package/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/entity-manager/EntityManager.d.ts +20 -20
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-schema/EntitySchemaColumnOptions.d.ts +4 -0
- package/entity-schema/EntitySchemaColumnOptions.js.map +1 -1
- package/entity-schema/EntitySchemaTransformer.js +1 -0
- package/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/find-options/FindOptionsUtils.d.ts +2 -1
- package/find-options/FindOptionsUtils.js.map +1 -1
- package/package.json +1 -274
- package/query-builder/DeleteQueryBuilder.d.ts +2 -2
- package/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/query-builder/InsertQueryBuilder.d.ts +2 -2
- package/query-builder/InsertQueryBuilder.js.map +1 -1
- package/query-builder/QueryBuilder.d.ts +3 -3
- package/query-builder/QueryBuilder.js.map +1 -1
- package/query-builder/QueryPartialEntity.d.ts +5 -2
- package/query-builder/QueryPartialEntity.js.map +1 -1
- package/query-builder/RelationIdLoader.js +15 -14
- package/query-builder/RelationIdLoader.js.map +1 -1
- package/query-builder/RelationQueryBuilder.d.ts +2 -1
- package/query-builder/RelationQueryBuilder.js.map +1 -1
- package/query-builder/SelectQueryBuilder.d.ts +5 -5
- package/query-builder/SelectQueryBuilder.js +1 -1
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/repository/BaseEntity.js.map +1 -1
- package/util/OrmUtils.js +2 -0
- package/util/OrmUtils.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/driver/cockroachdb/CockroachDriver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAA;AAE7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAA;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAK5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB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C,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE;YAC5B,IAAI,CAAC,OAAO,CAAC,CAAC,GAAQ,EAAE,UAAe,EAAE,OAAiB,EAAE,EAAE;gBAC1D,IAAI,GAAG;oBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;gBACzB,OAAO,EAAE,CAAA;gBACT,EAAE,CAAC,IAAI,CAAC,CAAA;YACZ,CAAC,CAAC,CAAA;QACN,CAAC,CAAC,CAAA;IACN,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,SAAS,CAAC,IAAS;QAC/B,MAAM,OAAO,CAAC,GAAG,CACb,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAC3C,WAAW,CAAC,OAAO,EAAE,CACxB,CACJ,CAAA;QACD,OAAO,IAAI,OAAO,CAAO,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE;YAClC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QACpD,CAAC,CAAC,CAAA;IACN,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,OAAgB;QACpC,IAAI,CAAC,OAAO;YAAE,OAAO,OAAO,CAAA;QAE5B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA,CAAC,wCAAwC;QAErG,OAAO,OAAO,CAAA;IAClB,CAAC;CACJ","file":"CockroachDriver.js","sourcesContent":["import { Driver } from \"../Driver\"\nimport { ConnectionIsNotSetError } from \"../../error/ConnectionIsNotSetError\"\nimport { ObjectLiteral } from \"../../common/ObjectLiteral\"\nimport { DriverPackageNotInstalledError } from \"../../error/DriverPackageNotInstalledError\"\nimport { DriverUtils } from \"../DriverUtils\"\nimport { ColumnMetadata } from \"../../metadata/ColumnMetadata\"\nimport { CteCapabilities } from \"../types/CteCapabilities\"\nimport { CockroachConnectionCredentialsOptions } from \"./CockroachConnectionCredentialsOptions\"\nimport { CockroachConnectionOptions } from \"./CockroachConnectionOptions\"\nimport { DateUtils } from \"../../util/DateUtils\"\nimport { PlatformTools } from \"../../platform/PlatformTools\"\nimport { DataSource } from \"../../data-source/DataSource\"\nimport { RdbmsSchemaBuilder } from \"../../schema-builder/RdbmsSchemaBuilder\"\nimport { MappedColumnTypes } from \"../types/MappedColumnTypes\"\nimport { ColumnType } from \"../types/ColumnTypes\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { DataTypeDefaults } from \"../types/DataTypeDefaults\"\nimport { TableColumn } from \"../../schema-builder/table/TableColumn\"\nimport { EntityMetadata } from \"../../metadata/EntityMetadata\"\nimport { OrmUtils } from \"../../util/OrmUtils\"\nimport { CockroachQueryRunner } from \"./CockroachQueryRunner\"\nimport { ApplyValueTransformers } from \"../../util/ApplyValueTransformers\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { TypeORMError } from \"../../error\"\nimport { Table } from \"../../schema-builder/table/Table\"\nimport { View } from \"../../schema-builder/view/View\"\nimport { TableForeignKey } from \"../../schema-builder/table/TableForeignKey\"\nimport { ObjectUtils } from \"../../util/ObjectUtils\"\nimport { InstanceChecker } from \"../../util/InstanceChecker\"\n\n/**\n * Organizes communication with Cockroach DBMS.\n */\nexport class CockroachDriver implements Driver {\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection used by driver.\n */\n connection: DataSource\n\n /**\n * Cockroach underlying library.\n */\n postgres: any\n\n /**\n * Pool for master database.\n */\n master: any\n\n /**\n * Pool for slave databases.\n * Used in replication.\n */\n slaves: any[] = []\n\n /**\n * We store all created query runners because we need to release them.\n */\n connectedQueryRunners: QueryRunner[] = []\n\n // -------------------------------------------------------------------------\n // Public Implemented Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection options.\n */\n options: CockroachConnectionOptions\n\n /**\n * Database name used to perform all write queries.\n */\n database?: string\n\n /**\n * Schema name used to perform all write queries.\n */\n schema?: string\n\n /**\n * Schema that's used internally by Postgres for object resolution.\n *\n * Because we never set this we have to track it in separately from the `schema` so\n * we know when we have to specify the full schema or not.\n *\n * In most cases this will be `public`.\n */\n searchSchema?: string\n\n /**\n * Indicates if replication is enabled.\n */\n isReplicated: boolean = false\n\n /**\n * Indicates if tree tables are supported by this driver.\n */\n treeSupport = true\n\n /**\n * Represent transaction support by this driver\n */\n transactionSupport = \"nested\" as const\n\n /**\n * Gets list of supported column data types by a driver.\n *\n * @see https://www.cockroachlabs.com/docs/stable/data-types.html\n */\n supportedDataTypes: ColumnType[] = [\n \"array\",\n \"bool\",\n \"boolean\",\n \"bytes\",\n \"bytea\",\n \"blob\",\n \"date\",\n \"numeric\",\n \"decimal\",\n \"dec\",\n \"float\",\n \"float4\",\n \"float8\",\n \"double precision\",\n \"real\",\n \"inet\",\n \"int\",\n \"int4\",\n \"integer\",\n \"int2\",\n \"int8\",\n \"int64\",\n \"smallint\",\n \"bigint\",\n \"interval\",\n \"string\",\n \"character varying\",\n \"character\",\n \"char\",\n \"char varying\",\n \"varchar\",\n \"text\",\n \"time\",\n \"time without time zone\",\n \"timestamp\",\n \"timestamptz\",\n \"timestamp without time zone\",\n \"timestamp with time zone\",\n \"json\",\n \"jsonb\",\n \"uuid\",\n ]\n\n /**\n * Returns type of upsert supported by driver if any\n */\n readonly supportedUpsertType = \"on-conflict-do-update\"\n\n /**\n * Gets list of spatial column data types.\n */\n spatialTypes: ColumnType[] = []\n\n /**\n * Gets list of column data types that support length by a driver.\n */\n withLengthColumnTypes: ColumnType[] = [\n \"character varying\",\n \"char varying\",\n \"varchar\",\n \"character\",\n \"char\",\n \"string\",\n ]\n\n /**\n * Gets list of column data types that support precision by a driver.\n */\n withPrecisionColumnTypes: ColumnType[] = [\"numeric\", \"decimal\", \"dec\"]\n\n /**\n * Gets list of column data types that support scale by a driver.\n */\n withScaleColumnTypes: ColumnType[] = [\"numeric\", \"decimal\", \"dec\"]\n\n /**\n * Orm has special columns and we need to know what database column types should be for those types.\n * Column types are driver dependant.\n */\n mappedDataTypes: MappedColumnTypes = {\n createDate: \"timestamptz\",\n createDateDefault: \"now()\",\n updateDate: \"timestamptz\",\n updateDateDefault: \"now()\",\n deleteDate: \"timestamptz\",\n deleteDateNullable: true,\n version: Number,\n treeLevel: Number,\n migrationId: Number,\n migrationName: \"varchar\",\n migrationTimestamp: \"int8\",\n cacheId: Number,\n cacheIdentifier: \"varchar\",\n cacheTime: \"int8\",\n cacheDuration: Number,\n cacheQuery: \"string\",\n cacheResult: \"string\",\n metadataType: \"varchar\",\n metadataDatabase: \"varchar\",\n metadataSchema: \"varchar\",\n metadataTable: \"varchar\",\n metadataName: \"varchar\",\n metadataValue: \"string\",\n }\n\n /**\n * Default values of length, precision and scale depends on column data type.\n * Used in the cases when length/precision/scale is not specified by user.\n */\n dataTypeDefaults: DataTypeDefaults = {\n char: { length: 1 },\n }\n\n /**\n * No documentation specifying a maximum length for identifiers could be found\n * for CockroarchDb.\n */\n maxAliasLength?: number\n\n cteCapabilities: CteCapabilities = {\n enabled: true,\n writable: true,\n materializedHint: true,\n requiresRecursiveHint: true,\n }\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(connection: DataSource) {\n this.connection = connection\n this.options = connection.options as CockroachConnectionOptions\n this.isReplicated = this.options.replication ? true : false\n\n // load postgres package\n this.loadDependencies()\n\n this.database = DriverUtils.buildDriverOptions(\n this.options.replication\n ? this.options.replication.master\n : this.options,\n ).database\n this.schema = DriverUtils.buildDriverOptions(this.options).schema\n\n // ObjectUtils.assign(this.options, DriverUtils.buildDriverOptions(connection.options)); // todo: do it better way\n // validate options to make sure everything is set\n // todo: revisit validation with replication in mind\n // if (!this.options.host)\n // throw new DriverOptionNotSetError(\"host\");\n // if (!this.options.username)\n // throw new DriverOptionNotSetError(\"username\");\n // if (!this.options.database)\n // throw new DriverOptionNotSetError(\"database\");\n }\n\n // -------------------------------------------------------------------------\n // Public Implemented Methods\n // -------------------------------------------------------------------------\n\n /**\n * Performs connection to the database.\n * Based on pooling options, it can either create connection immediately,\n * either create a pool and create connection when needed.\n */\n async connect(): Promise<void> {\n if (this.options.replication) {\n this.slaves = await Promise.all(\n this.options.replication.slaves.map((slave) => {\n return this.createPool(this.options, slave)\n }),\n )\n this.master = await this.createPool(\n this.options,\n this.options.replication.master,\n )\n } else {\n this.master = await this.createPool(this.options, this.options)\n }\n\n if (!this.database || !this.searchSchema) {\n const queryRunner = await this.createQueryRunner(\"master\")\n\n if (!this.database) {\n this.database = await queryRunner.getCurrentDatabase()\n }\n\n if (!this.searchSchema) {\n this.searchSchema = await queryRunner.getCurrentSchema()\n }\n\n await queryRunner.release()\n }\n\n if (!this.schema) {\n this.schema = this.searchSchema\n }\n }\n\n /**\n * Makes any action after connection (e.g. create extensions in Postgres driver).\n */\n async afterConnect(): Promise<void> {\n return Promise.resolve()\n }\n\n /**\n * Closes connection with database.\n */\n async disconnect(): Promise<void> {\n if (!this.master)\n return Promise.reject(new ConnectionIsNotSetError(\"cockroachdb\"))\n\n await this.closePool(this.master)\n await Promise.all(this.slaves.map((slave) => this.closePool(slave)))\n this.master = undefined\n this.slaves = []\n }\n\n /**\n * Creates a schema builder used to build and sync a schema.\n */\n createSchemaBuilder() {\n return new RdbmsSchemaBuilder(this.connection)\n }\n\n /**\n * Creates a query runner used to execute database queries.\n */\n createQueryRunner(mode: ReplicationMode) {\n return new CockroachQueryRunner(this, mode)\n }\n\n /**\n * Prepares given value to a value to be persisted, based on its column type and metadata.\n */\n preparePersistentValue(value: any, columnMetadata: ColumnMetadata): any {\n if (columnMetadata.transformer)\n value = ApplyValueTransformers.transformTo(\n columnMetadata.transformer,\n value,\n )\n\n if (value === null || value === undefined) return value\n\n if (columnMetadata.type === Boolean) {\n return value === true ? 1 : 0\n } else if (columnMetadata.type === \"date\") {\n return DateUtils.mixedDateToDateString(value)\n } else if (columnMetadata.type === \"time\") {\n return DateUtils.mixedDateToTimeString(value)\n } else if (\n columnMetadata.type === \"datetime\" ||\n columnMetadata.type === Date ||\n columnMetadata.type === \"timestamp\" ||\n columnMetadata.type === \"timestamptz\" ||\n columnMetadata.type === \"timestamp with time zone\" ||\n columnMetadata.type === \"timestamp without time zone\"\n ) {\n return DateUtils.mixedDateToDate(value)\n } else if (\n [\"json\", \"jsonb\", ...this.spatialTypes].indexOf(\n columnMetadata.type,\n ) >= 0\n ) {\n return JSON.stringify(value)\n } else if (columnMetadata.type === \"simple-array\") {\n return DateUtils.simpleArrayToString(value)\n } else if (columnMetadata.type === \"simple-json\") {\n return DateUtils.simpleJsonToString(value)\n }\n\n return value\n }\n\n /**\n * Prepares given value to a value to be persisted, based on its column type or metadata.\n */\n prepareHydratedValue(value: any, columnMetadata: ColumnMetadata): any {\n if (value === null || value === undefined)\n return columnMetadata.transformer\n ? ApplyValueTransformers.transformFrom(\n columnMetadata.transformer,\n value,\n )\n : value\n\n // unique_rowid() generates bigint value and should not be converted to number\n if (\n ([Number, \"int4\", \"smallint\", \"int2\"].some(\n (v) => v === columnMetadata.type,\n ) &&\n !columnMetadata.isArray) ||\n columnMetadata.generationStrategy === \"increment\"\n ) {\n value = parseInt(value)\n } else if (columnMetadata.type === Boolean) {\n value = value ? true : false\n } else if (\n columnMetadata.type === \"datetime\" ||\n columnMetadata.type === Date ||\n columnMetadata.type === \"timestamp\" ||\n columnMetadata.type === \"timestamptz\" ||\n columnMetadata.type === \"timestamp with time zone\" ||\n columnMetadata.type === \"timestamp without time zone\"\n ) {\n value = DateUtils.normalizeHydratedDate(value)\n } else if (columnMetadata.type === \"date\") {\n value = DateUtils.mixedDateToDateString(value)\n } else if (columnMetadata.type === \"time\") {\n value = DateUtils.mixedTimeToString(value)\n } else if (columnMetadata.type === \"simple-array\") {\n value = DateUtils.stringToSimpleArray(value)\n } else if (columnMetadata.type === \"simple-json\") {\n value = DateUtils.stringToSimpleJson(value)\n }\n\n if (columnMetadata.transformer)\n value = ApplyValueTransformers.transformFrom(\n columnMetadata.transformer,\n value,\n )\n\n return value\n }\n\n /**\n * Replaces parameters in the given sql with special escaping character\n * and an array of parameter names to be passed to a query.\n */\n escapeQueryWithParameters(\n sql: string,\n parameters: ObjectLiteral,\n nativeParameters: ObjectLiteral,\n ): [string, any[]] {\n const escapedParameters: any[] = Object.keys(nativeParameters).map(\n (key) => nativeParameters[key],\n )\n if (!parameters || !Object.keys(parameters).length)\n return [sql, escapedParameters]\n\n sql = sql.replace(\n /:(\\.\\.\\.)?([A-Za-z0-9_.]+)/g,\n (full, isArray: string, key: string): string => {\n if (!parameters.hasOwnProperty(key)) {\n return full\n }\n\n let value: any = parameters[key]\n\n if (isArray) {\n return value\n .map((v: any) => {\n escapedParameters.push(v)\n return this.createParameter(\n key,\n escapedParameters.length - 1,\n )\n })\n .join(\", \")\n }\n\n if (typeof value === \"function\") {\n return value()\n }\n\n escapedParameters.push(value)\n return this.createParameter(key, escapedParameters.length - 1)\n },\n ) // todo: make replace only in value statements, otherwise problems\n return [sql, escapedParameters]\n }\n\n /**\n * Escapes a column name.\n */\n escape(columnName: string): string {\n return '\"' + columnName + '\"'\n }\n\n /**\n * Build full table name with schema name and table name.\n * E.g. myDB.mySchema.myTable\n */\n buildTableName(tableName: string, schema?: string): string {\n let tablePath = [tableName]\n\n if (schema) {\n tablePath.unshift(schema)\n }\n\n return tablePath.join(\".\")\n }\n\n /**\n * Parse a target table name or other types and return a normalized table definition.\n */\n parseTableName(\n target: EntityMetadata | Table | View | TableForeignKey | string,\n ): { database?: string; schema?: string; tableName: string } {\n const driverDatabase = this.database\n const driverSchema = this.schema\n\n if (InstanceChecker.isTable(target) || InstanceChecker.isView(target)) {\n // name is sometimes a path\n const parsed = this.parseTableName(target.name)\n\n return {\n database: target.database || parsed.database || driverDatabase,\n schema: target.schema || parsed.schema || driverSchema,\n tableName: parsed.tableName,\n }\n }\n\n if (InstanceChecker.isTableForeignKey(target)) {\n // referencedTableName is sometimes a path\n const parsed = this.parseTableName(target.referencedTableName)\n\n return {\n database:\n target.referencedDatabase ||\n parsed.database ||\n driverDatabase,\n schema:\n target.referencedSchema || parsed.schema || driverSchema,\n tableName: parsed.tableName,\n }\n }\n\n if (InstanceChecker.isEntityMetadata(target)) {\n // EntityMetadata tableName is never a path\n\n return {\n database: target.database || driverDatabase,\n schema: target.schema || driverSchema,\n tableName: target.tableName,\n }\n }\n\n const parts = target.split(\".\")\n\n return {\n database: driverDatabase,\n schema: (parts.length > 1 ? parts[0] : undefined) || driverSchema,\n tableName: parts.length > 1 ? parts[1] : parts[0],\n }\n }\n\n /**\n * Creates a database type from a given column metadata.\n */\n normalizeType(column: {\n type?: ColumnType\n length?: number | string\n precision?: number | null\n scale?: number\n isArray?: boolean\n isGenerated?: boolean\n generationStrategy?: \"increment\" | \"uuid\" | \"rowid\"\n }): string {\n if (\n column.type === Number ||\n column.type === \"integer\" ||\n column.type === \"int\" ||\n column.type === \"bigint\" ||\n column.type === \"int64\"\n ) {\n return \"int8\"\n } else if (\n column.type === String ||\n column.type === \"character varying\" ||\n column.type === \"char varying\"\n ) {\n return \"varchar\"\n } else if (\n column.type === Date ||\n column.type === \"timestamp without time zone\"\n ) {\n return \"timestamp\"\n } else if (column.type === \"timestamp with time zone\") {\n return \"timestamptz\"\n } else if (column.type === \"time without time zone\") {\n return \"time\"\n } else if (column.type === Boolean || column.type === \"boolean\") {\n return \"bool\"\n } else if (\n column.type === \"simple-array\" ||\n column.type === \"simple-json\" ||\n column.type === \"text\"\n ) {\n return \"string\"\n } else if (column.type === \"bytea\" || column.type === \"blob\") {\n return \"bytes\"\n } else if (column.type === \"smallint\") {\n return \"int2\"\n } else if (column.type === \"numeric\" || column.type === \"dec\") {\n return \"decimal\"\n } else if (\n column.type === \"double precision\" ||\n column.type === \"float\"\n ) {\n return \"float8\"\n } else if (column.type === \"real\") {\n return \"float4\"\n } else if (column.type === \"character\") {\n return \"char\"\n } else if (column.type === \"json\") {\n return \"jsonb\"\n } else {\n return (column.type as string) || \"\"\n }\n }\n\n /**\n * Normalizes \"default\" value of the column.\n */\n normalizeDefault(columnMetadata: ColumnMetadata): string | undefined {\n const defaultValue = columnMetadata.default\n const arrayCast = columnMetadata.isArray\n ? `::${columnMetadata.type}[]`\n : \"\"\n\n if (typeof defaultValue === \"number\") {\n return `(${defaultValue})`\n }\n\n if (typeof defaultValue === \"boolean\") {\n return defaultValue ? \"true\" : \"false\"\n }\n\n if (typeof defaultValue === \"function\") {\n const value = defaultValue()\n if (value.toUpperCase() === \"CURRENT_TIMESTAMP\") {\n return \"current_timestamp()\"\n } else if (value.toUpperCase() === \"CURRENT_DATE\") {\n return \"current_date()\"\n }\n return value\n }\n\n if (typeof defaultValue === \"string\") {\n return `'${defaultValue}'${arrayCast}`\n }\n\n if (ObjectUtils.isObject(defaultValue) && defaultValue !== null) {\n return `'${JSON.stringify(defaultValue)}'`\n }\n\n if (defaultValue === undefined || defaultValue === null) {\n return undefined\n }\n\n return `${defaultValue}`\n }\n\n /**\n * Normalizes \"isUnique\" value of the column.\n */\n normalizeIsUnique(column: ColumnMetadata): boolean {\n return column.entityMetadata.uniques.some(\n (uq) => uq.columns.length === 1 && uq.columns[0] === column,\n )\n }\n\n /**\n * Returns default column lengths, which is required on column creation.\n */\n getColumnLength(column: ColumnMetadata): string {\n return column.length ? column.length.toString() : \"\"\n }\n\n /**\n * Creates column type definition including length, precision and scale\n */\n createFullType(column: TableColumn): string {\n let type = column.type\n\n if (column.length) {\n type += \"(\" + column.length + \")\"\n } else if (\n column.precision !== null &&\n column.precision !== undefined &&\n column.scale !== null &&\n column.scale !== undefined\n ) {\n type += \"(\" + column.precision + \",\" + column.scale + \")\"\n } else if (\n column.precision !== null &&\n column.precision !== undefined\n ) {\n type += \"(\" + column.precision + \")\"\n }\n\n if (column.isArray) type += \" array\"\n\n return type\n }\n\n /**\n * Obtains a new database connection to a master server.\n * Used for replication.\n * If replication is not setup then returns default connection's database connection.\n */\n async obtainMasterConnection(): Promise<any> {\n if (!this.master) {\n throw new TypeORMError(\"Driver not Connected\")\n }\n\n return new Promise((ok, fail) => {\n this.master.connect((err: any, connection: any, release: any) => {\n err ? fail(err) : ok([connection, release])\n })\n })\n }\n\n /**\n * Obtains a new database connection to a slave server.\n * Used for replication.\n * If replication is not setup then returns master (default) connection's database connection.\n */\n async obtainSlaveConnection(): Promise<any> {\n if (!this.slaves.length) return this.obtainMasterConnection()\n\n const random = Math.floor(Math.random() * this.slaves.length)\n\n return new Promise((ok, fail) => {\n this.slaves[random].connect(\n (err: any, connection: any, release: any) => {\n err ? fail(err) : ok([connection, release])\n },\n )\n })\n }\n\n /**\n * Creates generated map of values generated or returned by database after INSERT query.\n *\n * todo: slow. optimize Object.keys(), OrmUtils.mergeDeep and column.createValueMap parts\n */\n createGeneratedMap(metadata: EntityMetadata, insertResult: ObjectLiteral) {\n if (!insertResult) return undefined\n\n return Object.keys(insertResult).reduce((map, key) => {\n const column = metadata.findColumnWithDatabaseName(key)\n if (column) {\n OrmUtils.mergeDeep(\n map,\n column.createValueMap(\n this.prepareHydratedValue(insertResult[key], column),\n ),\n )\n }\n return map\n }, {} as ObjectLiteral)\n }\n\n /**\n * Differentiate columns of this table and columns from the given column metadatas columns\n * and returns only changed.\n */\n findChangedColumns(\n tableColumns: TableColumn[],\n columnMetadatas: ColumnMetadata[],\n ): ColumnMetadata[] {\n return columnMetadatas.filter((columnMetadata) => {\n const tableColumn = tableColumns.find(\n (c) => c.name === columnMetadata.databaseName,\n )\n if (!tableColumn) return false // we don't need new columns, we only need exist and changed\n\n // console.log(\"table:\", columnMetadata.entityMetadata.tableName);\n // console.log(\"name:\", tableColumn.name, columnMetadata.databaseName);\n // console.log(\"type:\", tableColumn.type, this.normalizeType(columnMetadata));\n // console.log(\"length:\", tableColumn.length, columnMetadata.length);\n // console.log(\"width:\", tableColumn.width, columnMetadata.width);\n // console.log(\"precision:\", tableColumn.precision, columnMetadata.precision);\n // console.log(\"scale:\", tableColumn.scale, columnMetadata.scale);\n // console.log(\"comment:\", tableColumn.comment, this.escapeComment(columnMetadata.comment));\n // console.log(\"default:\", tableColumn.default, columnMetadata.default);\n // console.log(\"default changed:\", !this.compareDefaultValues(this.normalizeDefault(columnMetadata), tableColumn.default));\n // console.log(\"isPrimary:\", tableColumn.isPrimary, columnMetadata.isPrimary);\n // console.log(\"isNullable:\", tableColumn.isNullable, columnMetadata.isNullable);\n // console.log(\"isUnique:\", tableColumn.isUnique, this.normalizeIsUnique(columnMetadata));\n // console.log(\"isGenerated:\", tableColumn.isGenerated, columnMetadata.isGenerated);\n // console.log(\"==========================================\");\n\n return (\n tableColumn.name !== columnMetadata.databaseName ||\n tableColumn.type !== this.normalizeType(columnMetadata) ||\n tableColumn.length !== columnMetadata.length ||\n tableColumn.precision !== columnMetadata.precision ||\n (columnMetadata.scale !== undefined &&\n tableColumn.scale !== columnMetadata.scale) ||\n tableColumn.comment !==\n this.escapeComment(columnMetadata.comment) ||\n (!tableColumn.isGenerated &&\n this.lowerDefaultValueIfNecessary(\n this.normalizeDefault(columnMetadata),\n ) !== tableColumn.default) || // we included check for generated here, because generated columns already can have default values\n tableColumn.isPrimary !== columnMetadata.isPrimary ||\n tableColumn.isNullable !== columnMetadata.isNullable ||\n tableColumn.isUnique !==\n this.normalizeIsUnique(columnMetadata) ||\n tableColumn.isGenerated !== columnMetadata.isGenerated ||\n tableColumn.generatedType !== columnMetadata.generatedType ||\n (tableColumn.asExpression || \"\").trim() !==\n (columnMetadata.asExpression || \"\").trim()\n )\n })\n }\n\n private lowerDefaultValueIfNecessary(value: string | undefined) {\n if (!value) {\n return value\n }\n return value\n .split(`'`)\n .map((v, i) => {\n return i % 2 === 1 ? v : v.toLowerCase()\n })\n .join(`'`)\n }\n /**\n * Returns true if driver supports RETURNING / OUTPUT statement.\n */\n isReturningSqlSupported(): boolean {\n return true\n }\n\n /**\n * Returns true if driver supports uuid values generation on its own.\n */\n isUUIDGenerationSupported(): boolean {\n return true\n }\n\n /**\n * Returns true if driver supports fulltext indices.\n */\n isFullTextColumnTypeSupported(): boolean {\n return false\n }\n\n /**\n * Creates an escaped parameter.\n */\n createParameter(parameterName: string, index: number): string {\n return \"$\" + (index + 1)\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Loads postgres query stream package.\n */\n loadStreamDependency() {\n try {\n return PlatformTools.load(\"pg-query-stream\")\n } catch (e) {\n // todo: better error for browser env\n throw new TypeORMError(\n `To use streams you should install pg-query-stream package. Please run npm i pg-query-stream --save command.`,\n )\n }\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * If driver dependency is not given explicitly, then try to load it via \"require\".\n */\n protected loadDependencies(): void {\n try {\n const postgres = this.options.driver || PlatformTools.load(\"pg\")\n this.postgres = postgres\n try {\n const pgNative =\n this.options.nativeDriver || PlatformTools.load(\"pg-native\")\n if (pgNative && this.postgres.native)\n this.postgres = this.postgres.native\n } catch (e) {}\n } catch (e) {\n // todo: better error for browser env\n throw new DriverPackageNotInstalledError(\"Postgres\", \"pg\")\n }\n }\n\n /**\n * Creates a new connection pool for a given database credentials.\n */\n protected async createPool(\n options: CockroachConnectionOptions,\n credentials: CockroachConnectionCredentialsOptions,\n ): Promise<any> {\n credentials = Object.assign(\n {},\n credentials,\n DriverUtils.buildDriverOptions(credentials),\n ) // todo: do it better way\n\n // build connection options for the driver\n const connectionOptions = Object.assign(\n {},\n {\n host: credentials.host,\n user: credentials.username,\n password: credentials.password,\n database: credentials.database,\n port: credentials.port,\n ssl: credentials.ssl,\n application_name: options.applicationName,\n },\n options.extra || {},\n )\n\n // create a connection pool\n const pool = new this.postgres.Pool(connectionOptions)\n const { logger } = this.connection\n\n const poolErrorHandler =\n options.poolErrorHandler ||\n ((error: any) =>\n logger.log(\"warn\", `Postgres pool raised an error. ${error}`))\n\n /*\n Attaching an error handler to pool errors is essential, as, otherwise, errors raised will go unhandled and\n cause the hosting app to crash.\n */\n pool.on(\"error\", poolErrorHandler)\n\n return new Promise((ok, fail) => {\n pool.connect((err: any, connection: any, release: Function) => {\n if (err) return fail(err)\n release()\n ok(pool)\n })\n })\n }\n\n /**\n * Closes connection pool.\n */\n protected async closePool(pool: any): Promise<void> {\n await Promise.all(\n this.connectedQueryRunners.map((queryRunner) =>\n queryRunner.release(),\n ),\n )\n return new Promise<void>((ok, fail) => {\n pool.end((err: any) => (err ? fail(err) : ok()))\n })\n }\n\n /**\n * Escapes a given comment.\n */\n protected escapeComment(comment?: string) {\n if (!comment) return comment\n\n comment = comment.replace(/'/g, \"''\").replace(/\\u0000/g, \"\") // Null bytes aren't allowed in comments\n\n return comment\n }\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/driver/cockroachdb/CockroachDriver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAA;AAE7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAA;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAK5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAO5E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI1C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D;;GAEG;AACH,MAAM,OAAO,eAAe;IA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C,WAAW,EAAE,EAAE,CAC3C,WAAW,CAAC,OAAO,EAAE,CACxB,CACJ,CAAA;QACD,OAAO,IAAI,OAAO,CAAO,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE;YAClC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QACpD,CAAC,CAAC,CAAA;IACN,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,OAAgB;QACpC,IAAI,CAAC,OAAO;YAAE,OAAO,OAAO,CAAA;QAE5B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA,CAAC,wCAAwC;QAErG,OAAO,OAAO,CAAA;IAClB,CAAC;CACJ","file":"CockroachDriver.js","sourcesContent":["import { Driver } from \"../Driver\"\nimport { ConnectionIsNotSetError } from \"../../error/ConnectionIsNotSetError\"\nimport { ObjectLiteral } from \"../../common/ObjectLiteral\"\nimport { DriverPackageNotInstalledError } from \"../../error/DriverPackageNotInstalledError\"\nimport { DriverUtils } from \"../DriverUtils\"\nimport { ColumnMetadata } from \"../../metadata/ColumnMetadata\"\nimport { CteCapabilities } from \"../types/CteCapabilities\"\nimport { CockroachConnectionCredentialsOptions } from \"./CockroachConnectionCredentialsOptions\"\nimport { CockroachConnectionOptions } from \"./CockroachConnectionOptions\"\nimport { DateUtils } from \"../../util/DateUtils\"\nimport { PlatformTools } from \"../../platform/PlatformTools\"\nimport { DataSource } from \"../../data-source/DataSource\"\nimport { RdbmsSchemaBuilder } from \"../../schema-builder/RdbmsSchemaBuilder\"\nimport { MappedColumnTypes } from \"../types/MappedColumnTypes\"\nimport { ColumnType } from \"../types/ColumnTypes\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { DataTypeDefaults } from \"../types/DataTypeDefaults\"\nimport { TableColumn } from \"../../schema-builder/table/TableColumn\"\nimport { EntityMetadata } from \"../../metadata/EntityMetadata\"\nimport { OrmUtils } from \"../../util/OrmUtils\"\nimport { CockroachQueryRunner } from \"./CockroachQueryRunner\"\nimport { ApplyValueTransformers } from \"../../util/ApplyValueTransformers\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { TypeORMError } from \"../../error\"\nimport { Table } from \"../../schema-builder/table/Table\"\nimport { View } from \"../../schema-builder/view/View\"\nimport { TableForeignKey } from \"../../schema-builder/table/TableForeignKey\"\nimport { ObjectUtils } from \"../../util/ObjectUtils\"\nimport { InstanceChecker } from \"../../util/InstanceChecker\"\n\n/**\n * Organizes communication with Cockroach DBMS.\n */\nexport class CockroachDriver implements Driver {\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection used by driver.\n */\n connection: DataSource\n\n /**\n * Cockroach underlying library.\n */\n postgres: any\n\n /**\n * Pool for master database.\n */\n master: any\n\n /**\n * Pool for slave databases.\n * Used in replication.\n */\n slaves: any[] = []\n\n /**\n * We store all created query runners because we need to release them.\n */\n connectedQueryRunners: QueryRunner[] = []\n\n // -------------------------------------------------------------------------\n // Public Implemented Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection options.\n */\n options: CockroachConnectionOptions\n\n /**\n * Database name used to perform all write queries.\n */\n database?: string\n\n /**\n * Schema name used to perform all write queries.\n */\n schema?: string\n\n /**\n * Schema that's used internally by Postgres for object resolution.\n *\n * Because we never set this we have to track it in separately from the `schema` so\n * we know when we have to specify the full schema or not.\n *\n * In most cases this will be `public`.\n */\n searchSchema?: string\n\n /**\n * Indicates if replication is enabled.\n */\n isReplicated: boolean = false\n\n /**\n * Indicates if tree tables are supported by this driver.\n */\n treeSupport = true\n\n /**\n * Represent transaction support by this driver\n */\n transactionSupport = \"nested\" as const\n\n /**\n * Gets list of supported column data types by a driver.\n *\n * @see https://www.cockroachlabs.com/docs/stable/data-types.html\n */\n supportedDataTypes: ColumnType[] = [\n \"array\",\n \"bool\",\n \"boolean\",\n \"bytes\",\n \"bytea\",\n \"blob\",\n \"date\",\n \"numeric\",\n \"decimal\",\n \"dec\",\n \"float\",\n \"float4\",\n \"float8\",\n \"double precision\",\n \"real\",\n \"inet\",\n \"int\",\n \"int4\",\n \"integer\",\n \"int2\",\n \"int8\",\n \"int64\",\n \"smallint\",\n \"bigint\",\n \"interval\",\n \"string\",\n \"character varying\",\n \"character\",\n \"char\",\n \"char varying\",\n \"varchar\",\n \"text\",\n \"time\",\n \"time without time zone\",\n \"timestamp\",\n \"timestamptz\",\n \"timestamp without time zone\",\n \"timestamp with time zone\",\n \"json\",\n \"jsonb\",\n \"uuid\",\n ]\n\n /**\n * Returns type of upsert supported by driver if any\n */\n readonly supportedUpsertType = \"on-conflict-do-update\"\n\n /**\n * Gets list of spatial column data types.\n */\n spatialTypes: ColumnType[] = []\n\n /**\n * Gets list of column data types that support length by a driver.\n */\n withLengthColumnTypes: ColumnType[] = [\n \"character varying\",\n \"char varying\",\n \"varchar\",\n \"character\",\n \"char\",\n \"string\",\n ]\n\n /**\n * Gets list of column data types that support precision by a driver.\n */\n withPrecisionColumnTypes: ColumnType[] = [\"numeric\", \"decimal\", \"dec\"]\n\n /**\n * Gets list of column data types that support scale by a driver.\n */\n withScaleColumnTypes: ColumnType[] = [\"numeric\", \"decimal\", \"dec\"]\n\n /**\n * Orm has special columns and we need to know what database column types should be for those types.\n * Column types are driver dependant.\n */\n mappedDataTypes: MappedColumnTypes = {\n createDate: \"timestamptz\",\n createDateDefault: \"now()\",\n updateDate: \"timestamptz\",\n updateDateDefault: \"now()\",\n deleteDate: \"timestamptz\",\n deleteDateNullable: true,\n version: Number,\n treeLevel: Number,\n migrationId: Number,\n migrationName: \"varchar\",\n migrationTimestamp: \"int8\",\n cacheId: Number,\n cacheIdentifier: \"varchar\",\n cacheTime: \"int8\",\n cacheDuration: Number,\n cacheQuery: \"string\",\n cacheResult: \"string\",\n metadataType: \"varchar\",\n metadataDatabase: \"varchar\",\n metadataSchema: \"varchar\",\n metadataTable: \"varchar\",\n metadataName: \"varchar\",\n metadataValue: \"string\",\n }\n\n /**\n * Default values of length, precision and scale depends on column data type.\n * Used in the cases when length/precision/scale is not specified by user.\n */\n dataTypeDefaults: DataTypeDefaults = {\n char: { length: 1 },\n }\n\n /**\n * No documentation specifying a maximum length for identifiers could be found\n * for CockroarchDb.\n */\n maxAliasLength?: number\n\n cteCapabilities: CteCapabilities = {\n enabled: true,\n writable: true,\n materializedHint: true,\n requiresRecursiveHint: true,\n }\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(connection: DataSource) {\n this.connection = connection\n this.options = connection.options as CockroachConnectionOptions\n this.isReplicated = this.options.replication ? true : false\n\n // load postgres package\n this.loadDependencies()\n\n this.database = DriverUtils.buildDriverOptions(\n this.options.replication\n ? this.options.replication.master\n : this.options,\n ).database\n this.schema = DriverUtils.buildDriverOptions(this.options).schema\n\n // ObjectUtils.assign(this.options, DriverUtils.buildDriverOptions(connection.options)); // todo: do it better way\n // validate options to make sure everything is set\n // todo: revisit validation with replication in mind\n // if (!this.options.host)\n // throw new DriverOptionNotSetError(\"host\");\n // if (!this.options.username)\n // throw new DriverOptionNotSetError(\"username\");\n // if (!this.options.database)\n // throw new DriverOptionNotSetError(\"database\");\n }\n\n // -------------------------------------------------------------------------\n // Public Implemented Methods\n // -------------------------------------------------------------------------\n\n /**\n * Performs connection to the database.\n * Based on pooling options, it can either create connection immediately,\n * either create a pool and create connection when needed.\n */\n async connect(): Promise<void> {\n if (this.options.replication) {\n this.slaves = await Promise.all(\n this.options.replication.slaves.map((slave) => {\n return this.createPool(this.options, slave)\n }),\n )\n this.master = await this.createPool(\n this.options,\n this.options.replication.master,\n )\n } else {\n this.master = await this.createPool(this.options, this.options)\n }\n\n if (!this.database || !this.searchSchema) {\n const queryRunner = await this.createQueryRunner(\"master\")\n\n if (!this.database) {\n this.database = await queryRunner.getCurrentDatabase()\n }\n\n if (!this.searchSchema) {\n this.searchSchema = await queryRunner.getCurrentSchema()\n }\n\n await queryRunner.release()\n }\n\n if (!this.schema) {\n this.schema = this.searchSchema\n }\n }\n\n /**\n * Makes any action after connection (e.g. create extensions in Postgres driver).\n */\n async afterConnect(): Promise<void> {\n return Promise.resolve()\n }\n\n /**\n * Closes connection with database.\n */\n async disconnect(): Promise<void> {\n if (!this.master)\n return Promise.reject(new ConnectionIsNotSetError(\"cockroachdb\"))\n\n await this.closePool(this.master)\n await Promise.all(this.slaves.map((slave) => this.closePool(slave)))\n this.master = undefined\n this.slaves = []\n }\n\n /**\n * Creates a schema builder used to build and sync a schema.\n */\n createSchemaBuilder() {\n return new RdbmsSchemaBuilder(this.connection)\n }\n\n /**\n * Creates a query runner used to execute database queries.\n */\n createQueryRunner(mode: ReplicationMode) {\n return new CockroachQueryRunner(this, mode)\n }\n\n /**\n * Prepares given value to a value to be persisted, based on its column type and metadata.\n */\n preparePersistentValue(value: any, columnMetadata: ColumnMetadata): any {\n if (columnMetadata.transformer)\n value = ApplyValueTransformers.transformTo(\n columnMetadata.transformer,\n value,\n )\n\n if (value === null || value === undefined) return value\n\n if (columnMetadata.type === Boolean) {\n return value === true ? 1 : 0\n } else if (columnMetadata.type === \"date\") {\n return DateUtils.mixedDateToDateString(value)\n } else if (columnMetadata.type === \"time\") {\n return DateUtils.mixedDateToTimeString(value)\n } else if (\n columnMetadata.type === \"datetime\" ||\n columnMetadata.type === Date ||\n columnMetadata.type === \"timestamp\" ||\n columnMetadata.type === \"timestamptz\" ||\n columnMetadata.type === \"timestamp with time zone\" ||\n columnMetadata.type === \"timestamp without time zone\"\n ) {\n return DateUtils.mixedDateToDate(value)\n } else if (\n [\"json\", \"jsonb\", ...this.spatialTypes].indexOf(\n columnMetadata.type,\n ) >= 0\n ) {\n return JSON.stringify(value)\n } else if (columnMetadata.type === \"simple-array\") {\n return DateUtils.simpleArrayToString(value)\n } else if (columnMetadata.type === \"simple-json\") {\n return DateUtils.simpleJsonToString(value)\n }\n\n return value\n }\n\n /**\n * Prepares given value to a value to be persisted, based on its column type or metadata.\n */\n prepareHydratedValue(value: any, columnMetadata: ColumnMetadata): any {\n if (value === null || value === undefined)\n return columnMetadata.transformer\n ? ApplyValueTransformers.transformFrom(\n columnMetadata.transformer,\n value,\n )\n : value\n\n // unique_rowid() generates bigint value and should not be converted to number\n if (\n ([Number, \"int4\", \"smallint\", \"int2\"].some(\n (v) => v === columnMetadata.type,\n ) &&\n !columnMetadata.isArray) ||\n columnMetadata.generationStrategy === \"increment\"\n ) {\n value = parseInt(value)\n } else if (columnMetadata.type === Boolean) {\n value = value ? true : false\n } else if (\n columnMetadata.type === \"datetime\" ||\n columnMetadata.type === Date ||\n columnMetadata.type === \"timestamp\" ||\n columnMetadata.type === \"timestamptz\" ||\n columnMetadata.type === \"timestamp with time zone\" ||\n columnMetadata.type === \"timestamp without time zone\"\n ) {\n value = DateUtils.normalizeHydratedDate(value)\n } else if (columnMetadata.type === \"date\") {\n value = DateUtils.mixedDateToDateString(value)\n } else if (columnMetadata.type === \"time\") {\n value = DateUtils.mixedTimeToString(value)\n } else if (columnMetadata.type === \"simple-array\") {\n value = DateUtils.stringToSimpleArray(value)\n } else if (columnMetadata.type === \"simple-json\") {\n value = DateUtils.stringToSimpleJson(value)\n }\n\n if (columnMetadata.transformer)\n value = ApplyValueTransformers.transformFrom(\n columnMetadata.transformer,\n value,\n )\n\n return value\n }\n\n /**\n * Replaces parameters in the given sql with special escaping character\n * and an array of parameter names to be passed to a query.\n */\n escapeQueryWithParameters(\n sql: string,\n parameters: ObjectLiteral,\n nativeParameters: ObjectLiteral,\n ): [string, any[]] {\n const escapedParameters: any[] = Object.keys(nativeParameters).map(\n (key) => nativeParameters[key],\n )\n if (!parameters || !Object.keys(parameters).length)\n return [sql, escapedParameters]\n\n sql = sql.replace(\n /:(\\.\\.\\.)?([A-Za-z0-9_.]+)/g,\n (full, isArray: string, key: string): string => {\n if (!parameters.hasOwnProperty(key)) {\n return full\n }\n\n let value: any = parameters[key]\n\n if (isArray) {\n return value\n .map((v: any) => {\n escapedParameters.push(v)\n return this.createParameter(\n key,\n escapedParameters.length - 1,\n )\n })\n .join(\", \")\n }\n\n if (typeof value === \"function\") {\n return value()\n }\n\n escapedParameters.push(value)\n return this.createParameter(key, escapedParameters.length - 1)\n },\n ) // todo: make replace only in value statements, otherwise problems\n return [sql, escapedParameters]\n }\n\n /**\n * Escapes a column name.\n */\n escape(columnName: string): string {\n return '\"' + columnName + '\"'\n }\n\n /**\n * Build full table name with schema name and table name.\n * E.g. myDB.mySchema.myTable\n */\n buildTableName(tableName: string, schema?: string): string {\n let tablePath = [tableName]\n\n if (schema) {\n tablePath.unshift(schema)\n }\n\n return tablePath.join(\".\")\n }\n\n /**\n * Parse a target table name or other types and return a normalized table definition.\n */\n parseTableName(\n target: EntityMetadata | Table | View | TableForeignKey | string,\n ): { database?: string; schema?: string; tableName: string } {\n const driverDatabase = this.database\n const driverSchema = this.schema\n\n if (InstanceChecker.isTable(target) || InstanceChecker.isView(target)) {\n // name is sometimes a path\n const parsed = this.parseTableName(target.name)\n\n return {\n database: target.database || parsed.database || driverDatabase,\n schema: target.schema || parsed.schema || driverSchema,\n tableName: parsed.tableName,\n }\n }\n\n if (InstanceChecker.isTableForeignKey(target)) {\n // referencedTableName is sometimes a path\n const parsed = this.parseTableName(target.referencedTableName)\n\n return {\n database:\n target.referencedDatabase ||\n parsed.database ||\n driverDatabase,\n schema:\n target.referencedSchema || parsed.schema || driverSchema,\n tableName: parsed.tableName,\n }\n }\n\n if (InstanceChecker.isEntityMetadata(target)) {\n // EntityMetadata tableName is never a path\n\n return {\n database: target.database || driverDatabase,\n schema: target.schema || driverSchema,\n tableName: target.tableName,\n }\n }\n\n const parts = target.split(\".\")\n\n return {\n database: driverDatabase,\n schema: (parts.length > 1 ? parts[0] : undefined) || driverSchema,\n tableName: parts.length > 1 ? parts[1] : parts[0],\n }\n }\n\n /**\n * Creates a database type from a given column metadata.\n */\n normalizeType(column: {\n type?: ColumnType\n length?: number | string\n precision?: number | null\n scale?: number\n isArray?: boolean\n isGenerated?: boolean\n generationStrategy?: \"increment\" | \"uuid\" | \"rowid\"\n }): string {\n if (\n column.type === Number ||\n column.type === \"integer\" ||\n column.type === \"int\" ||\n column.type === \"bigint\" ||\n column.type === \"int64\"\n ) {\n return \"int8\"\n } else if (\n column.type === String ||\n column.type === \"character varying\" ||\n column.type === \"char varying\"\n ) {\n return \"varchar\"\n } else if (\n column.type === Date ||\n column.type === \"timestamp without time zone\"\n ) {\n return \"timestamp\"\n } else if (column.type === \"timestamp with time zone\") {\n return \"timestamptz\"\n } else if (column.type === \"time without time zone\") {\n return \"time\"\n } else if (column.type === Boolean || column.type === \"boolean\") {\n return \"bool\"\n } else if (\n column.type === \"simple-array\" ||\n column.type === \"simple-json\" ||\n column.type === \"text\"\n ) {\n return \"string\"\n } else if (column.type === \"bytea\" || column.type === \"blob\") {\n return \"bytes\"\n } else if (column.type === \"smallint\") {\n return \"int2\"\n } else if (column.type === \"numeric\" || column.type === \"dec\") {\n return \"decimal\"\n } else if (\n column.type === \"double precision\" ||\n column.type === \"float\"\n ) {\n return \"float8\"\n } else if (column.type === \"real\") {\n return \"float4\"\n } else if (column.type === \"character\") {\n return \"char\"\n } else if (column.type === \"json\") {\n return \"jsonb\"\n } else {\n return (column.type as string) || \"\"\n }\n }\n\n /**\n * Normalizes \"default\" value of the column.\n */\n normalizeDefault(columnMetadata: ColumnMetadata): string | undefined {\n const defaultValue = columnMetadata.default\n const arrayCast = columnMetadata.isArray\n ? `::${columnMetadata.type}[]`\n : \"\"\n\n if (typeof defaultValue === \"number\") {\n return `(${defaultValue})`\n }\n\n if (typeof defaultValue === \"boolean\") {\n return defaultValue ? \"true\" : \"false\"\n }\n\n if (typeof defaultValue === \"function\") {\n const value = defaultValue()\n if (value.toUpperCase() === \"CURRENT_TIMESTAMP\") {\n return \"current_timestamp()\"\n } else if (value.toUpperCase() === \"CURRENT_DATE\") {\n return \"current_date()\"\n }\n return value\n }\n\n if (typeof defaultValue === \"string\") {\n return `'${defaultValue}'${arrayCast}`\n }\n\n if (ObjectUtils.isObject(defaultValue) && defaultValue !== null) {\n return `'${JSON.stringify(defaultValue)}'`\n }\n\n if (defaultValue === undefined || defaultValue === null) {\n return undefined\n }\n\n return `${defaultValue}`\n }\n\n /**\n * Normalizes \"isUnique\" value of the column.\n */\n normalizeIsUnique(column: ColumnMetadata): boolean {\n return column.entityMetadata.uniques.some(\n (uq) => uq.columns.length === 1 && uq.columns[0] === column,\n )\n }\n\n /**\n * Returns default column lengths, which is required on column creation.\n */\n getColumnLength(column: ColumnMetadata): string {\n return column.length ? column.length.toString() : \"\"\n }\n\n /**\n * Creates column type definition including length, precision and scale\n */\n createFullType(column: TableColumn): string {\n let type = column.type\n\n if (column.length) {\n type += \"(\" + column.length + \")\"\n } else if (\n column.precision !== null &&\n column.precision !== undefined &&\n column.scale !== null &&\n column.scale !== undefined\n ) {\n type += \"(\" + column.precision + \",\" + column.scale + \")\"\n } else if (\n column.precision !== null &&\n column.precision !== undefined\n ) {\n type += \"(\" + column.precision + \")\"\n }\n\n if (column.isArray) type += \" array\"\n\n return type\n }\n\n /**\n * Obtains a new database connection to a master server.\n * Used for replication.\n * If replication is not setup then returns default connection's database connection.\n */\n async obtainMasterConnection(): Promise<any> {\n if (!this.master) {\n throw new TypeORMError(\"Driver not Connected\")\n }\n\n return new Promise((ok, fail) => {\n this.master.connect((err: any, connection: any, release: any) => {\n err ? fail(err) : ok([connection, release])\n })\n })\n }\n\n /**\n * Obtains a new database connection to a slave server.\n * Used for replication.\n * If replication is not setup then returns master (default) connection's database connection.\n */\n async obtainSlaveConnection(): Promise<any> {\n if (!this.slaves.length) return this.obtainMasterConnection()\n\n const random = Math.floor(Math.random() * this.slaves.length)\n\n return new Promise((ok, fail) => {\n this.slaves[random].connect(\n (err: any, connection: any, release: any) => {\n err ? fail(err) : ok([connection, release])\n },\n )\n })\n }\n\n /**\n * Creates generated map of values generated or returned by database after INSERT query.\n *\n * todo: slow. optimize Object.keys(), OrmUtils.mergeDeep and column.createValueMap parts\n */\n createGeneratedMap(metadata: EntityMetadata, insertResult: ObjectLiteral) {\n if (!insertResult) return undefined\n\n return Object.keys(insertResult).reduce((map, key) => {\n const column = metadata.findColumnWithDatabaseName(key)\n if (column) {\n OrmUtils.mergeDeep(\n map,\n column.createValueMap(\n this.prepareHydratedValue(insertResult[key], column),\n ),\n )\n }\n return map\n }, {} as ObjectLiteral)\n }\n\n /**\n * Differentiate columns of this table and columns from the given column metadatas columns\n * and returns only changed.\n */\n findChangedColumns(\n tableColumns: TableColumn[],\n columnMetadatas: ColumnMetadata[],\n ): ColumnMetadata[] {\n return columnMetadatas.filter((columnMetadata) => {\n const tableColumn = tableColumns.find(\n (c) => c.name === columnMetadata.databaseName,\n )\n if (!tableColumn) return false // we don't need new columns, we only need exist and changed\n\n // console.log(\"table:\", columnMetadata.entityMetadata.tableName);\n // console.log(\"name:\", tableColumn.name, columnMetadata.databaseName);\n // console.log(\"type:\", tableColumn.type, this.normalizeType(columnMetadata));\n // console.log(\"length:\", tableColumn.length, columnMetadata.length);\n // console.log(\"width:\", tableColumn.width, columnMetadata.width);\n // console.log(\"precision:\", tableColumn.precision, columnMetadata.precision);\n // console.log(\"scale:\", tableColumn.scale, columnMetadata.scale);\n // console.log(\"comment:\", tableColumn.comment, this.escapeComment(columnMetadata.comment));\n // console.log(\"default:\", tableColumn.default, columnMetadata.default);\n // console.log(\"default changed:\", !this.compareDefaultValues(this.normalizeDefault(columnMetadata), tableColumn.default));\n // console.log(\"isPrimary:\", tableColumn.isPrimary, columnMetadata.isPrimary);\n // console.log(\"isNullable:\", tableColumn.isNullable, columnMetadata.isNullable);\n // console.log(\"isUnique:\", tableColumn.isUnique, this.normalizeIsUnique(columnMetadata));\n // console.log(\"isGenerated:\", tableColumn.isGenerated, columnMetadata.isGenerated);\n // console.log(\"==========================================\");\n\n return (\n tableColumn.name !== columnMetadata.databaseName ||\n tableColumn.type !== this.normalizeType(columnMetadata) ||\n tableColumn.length !== columnMetadata.length ||\n tableColumn.precision !== columnMetadata.precision ||\n (columnMetadata.scale !== undefined &&\n tableColumn.scale !== columnMetadata.scale) ||\n tableColumn.comment !==\n this.escapeComment(columnMetadata.comment) ||\n (!tableColumn.isGenerated &&\n this.lowerDefaultValueIfNecessary(\n this.normalizeDefault(columnMetadata),\n ) !== tableColumn.default) || // we included check for generated here, because generated columns already can have default values\n tableColumn.isPrimary !== columnMetadata.isPrimary ||\n tableColumn.isNullable !== columnMetadata.isNullable ||\n tableColumn.isUnique !==\n this.normalizeIsUnique(columnMetadata) ||\n tableColumn.isGenerated !== columnMetadata.isGenerated ||\n tableColumn.generatedType !== columnMetadata.generatedType ||\n (tableColumn.asExpression || \"\").trim() !==\n (columnMetadata.asExpression || \"\").trim()\n )\n })\n }\n\n private lowerDefaultValueIfNecessary(value: string | undefined) {\n if (!value) {\n return value\n }\n return value\n .split(`'`)\n .map((v, i) => {\n return i % 2 === 1 ? v : v.toLowerCase()\n })\n .join(`'`)\n }\n /**\n * Returns true if driver supports RETURNING / OUTPUT statement.\n */\n isReturningSqlSupported(): boolean {\n return true\n }\n\n /**\n * Returns true if driver supports uuid values generation on its own.\n */\n isUUIDGenerationSupported(): boolean {\n return true\n }\n\n /**\n * Returns true if driver supports fulltext indices.\n */\n isFullTextColumnTypeSupported(): boolean {\n return false\n }\n\n /**\n * Creates an escaped parameter.\n */\n createParameter(parameterName: string, index: number): string {\n return \"$\" + (index + 1)\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Loads postgres query stream package.\n */\n loadStreamDependency() {\n try {\n return PlatformTools.load(\"pg-query-stream\")\n } catch (e) {\n // todo: better error for browser env\n throw new TypeORMError(\n `To use streams you should install pg-query-stream package. Please run npm i pg-query-stream --save command.`,\n )\n }\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * If driver dependency is not given explicitly, then try to load it via \"require\".\n */\n protected loadDependencies(): void {\n try {\n const postgres = this.options.driver || PlatformTools.load(\"pg\")\n this.postgres = postgres\n try {\n const pgNative =\n this.options.nativeDriver || PlatformTools.load(\"pg-native\")\n if (pgNative && this.postgres.native)\n this.postgres = this.postgres.native\n } catch (e) {}\n } catch (e) {\n // todo: better error for browser env\n throw new DriverPackageNotInstalledError(\"Postgres\", \"pg\")\n }\n }\n\n /**\n * Creates a new connection pool for a given database credentials.\n */\n protected async createPool(\n options: CockroachConnectionOptions,\n credentials: CockroachConnectionCredentialsOptions,\n ): Promise<any> {\n credentials = Object.assign(\n {},\n credentials,\n DriverUtils.buildDriverOptions(credentials),\n ) // todo: do it better way\n\n // build connection options for the driver\n const connectionOptions = Object.assign(\n {},\n {\n host: credentials.host,\n user: credentials.username,\n password: credentials.password,\n database: credentials.database,\n port: credentials.port,\n ssl: credentials.ssl,\n application_name: options.applicationName,\n max: options.poolSize,\n },\n options.extra || {},\n )\n\n // create a connection pool\n const pool = new this.postgres.Pool(connectionOptions)\n const { logger } = this.connection\n\n const poolErrorHandler =\n options.poolErrorHandler ||\n ((error: any) =>\n logger.log(\"warn\", `Postgres pool raised an error. ${error}`))\n\n /*\n Attaching an error handler to pool errors is essential, as, otherwise, errors raised will go unhandled and\n cause the hosting app to crash.\n */\n pool.on(\"error\", poolErrorHandler)\n\n return new Promise((ok, fail) => {\n pool.connect((err: any, connection: any, release: Function) => {\n if (err) return fail(err)\n release()\n ok(pool)\n })\n })\n }\n\n /**\n * Closes connection pool.\n */\n protected async closePool(pool: any): Promise<void> {\n await Promise.all(\n this.connectedQueryRunners.map((queryRunner) =>\n queryRunner.release(),\n ),\n )\n return new Promise<void>((ok, fail) => {\n pool.end((err: any) => (err ? fail(err) : ok()))\n })\n }\n\n /**\n * Escapes a given comment.\n */\n protected escapeComment(comment?: string) {\n if (!comment) return comment\n\n comment = comment.replace(/'/g, \"''\").replace(/\\u0000/g, \"\") // Null bytes aren't allowed in comments\n\n return comment\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/driver/cordova/CordovaConnectionOptions.ts"],"names":[],"mappings":"","file":"CordovaConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\n\n/**\n * Sqlite-specific connection options.\n */\nexport interface CordovaConnectionOptions extends BaseDataSourceOptions {\n /**\n * Database type.\n */\n readonly type: \"cordova\"\n\n /**\n * Database name.\n */\n readonly database: string\n\n /**\n * The driver object\n * This defaults to `window.sqlitePlugin`\n */\n readonly driver?: any\n\n /**\n * Storage Location\n */\n readonly location: string\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/driver/cordova/CordovaConnectionOptions.ts"],"names":[],"mappings":"","file":"CordovaConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\n\n/**\n * Sqlite-specific connection options.\n */\nexport interface CordovaConnectionOptions extends BaseDataSourceOptions {\n /**\n * Database type.\n */\n readonly type: \"cordova\"\n\n /**\n * Database name.\n */\n readonly database: string\n\n /**\n * The driver object\n * This defaults to `window.sqlitePlugin`\n */\n readonly driver?: any\n\n /**\n * Storage Location\n */\n readonly location: string\n\n readonly poolSize?: never\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/driver/expo/ExpoConnectionOptions.ts"],"names":[],"mappings":"","file":"ExpoConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\n\n/**\n * Sqlite-specific connection options.\n */\nexport interface ExpoConnectionOptions extends BaseDataSourceOptions {\n /**\n * Database type.\n */\n readonly type: \"expo\"\n\n /**\n * Database name.\n */\n readonly database: string\n\n /**\n * Driver module\n */\n readonly driver: any\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/driver/expo/ExpoConnectionOptions.ts"],"names":[],"mappings":"","file":"ExpoConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\n\n/**\n * Sqlite-specific connection options.\n */\nexport interface ExpoConnectionOptions extends BaseDataSourceOptions {\n /**\n * Database type.\n */\n readonly type: \"expo\"\n\n /**\n * Database name.\n */\n readonly database: string\n\n /**\n * Driver module\n */\n readonly driver: any\n\n readonly poolSize?: never\n}\n"],"sourceRoot":"../.."}
|
|
@@ -43,10 +43,6 @@ export interface MongoConnectionOptions extends BaseDataSourceOptions {
|
|
|
43
43
|
* This defaults to require("mongodb")
|
|
44
44
|
*/
|
|
45
45
|
readonly driver?: any;
|
|
46
|
-
/**
|
|
47
|
-
* Set the maximum poolSize for each individual server or proxy connection.
|
|
48
|
-
*/
|
|
49
|
-
readonly poolSize?: number;
|
|
50
46
|
/**
|
|
51
47
|
* Use ssl connection (needs to have a mongod server with ssl support). Default: false
|
|
52
48
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/driver/mongodb/MongoConnectionOptions.ts"],"names":[],"mappings":"","file":"MongoConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { ReadPreference } from \"./typings\"\n\n/**\n * MongoDB specific connection options.\n * Synced with http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html\n */\nexport interface MongoConnectionOptions extends BaseDataSourceOptions {\n /**\n * Database type.\n */\n readonly type: \"mongodb\"\n\n /**\n * Connection url where perform connection to.\n */\n readonly url?: string\n\n /**\n * Database host.\n */\n readonly host?: string\n\n /**\n * Database host replica set.\n */\n readonly hostReplicaSet?: string\n\n /**\n * Database host port.\n */\n readonly port?: number\n\n /**\n * Database username.\n */\n readonly username?: string\n\n /**\n * Database password.\n */\n readonly password?: string\n\n /**\n * Database name to connect to.\n */\n readonly database?: string\n\n /**\n * The driver object\n * This defaults to require(\"mongodb\")\n */\n readonly driver?: any\n\n /**\n * Set the maximum poolSize for each individual server or proxy connection.\n */\n readonly poolSize?: number\n\n /**\n * Use ssl connection (needs to have a mongod server with ssl support). Default: false\n */\n readonly ssl?: boolean\n\n /**\n * Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher).\n * Default: true\n */\n readonly sslValidate?: boolean\n\n /**\n * Array of valid certificates either as Buffers or Strings\n * (needs to have a mongod server with ssl support, 2.4 or higher).\n */\n readonly sslCA?: string | Buffer\n\n /**\n * String or buffer containing the certificate we wish to present\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslCert?: string | Buffer\n\n /**\n * String or buffer containing the certificate private key we wish to present\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslKey?: string\n\n /**\n * String or buffer containing the certificate password\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslPass?: string | Buffer\n\n /**\n * SSL Certificate revocation list binary buffer\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslCRL?: string | Buffer\n\n /**\n * Reconnect on error. Default: true\n */\n readonly autoReconnect?: boolean\n\n /**\n * TCP Socket NoDelay option. Default: true\n */\n readonly noDelay?: boolean\n\n /**\n * The number of milliseconds to wait before initiating keepAlive on the TCP socket. Default: 30000\n */\n readonly keepAlive?: number\n\n /**\n * TCP Connection timeout setting. Default: 30000\n */\n readonly connectTimeoutMS?: number\n\n /**\n * Version of IP stack. Can be 4, 6.\n * If undefined, will attempt to connect with IPv6, and will fall back to IPv4 on failure\n */\n readonly family?: number\n\n /**\n * TCP Socket timeout setting. Default: 360000\n */\n readonly socketTimeoutMS?: number\n\n /**\n * Server attempt to reconnect #times. Default 30\n */\n readonly reconnectTries?: number\n\n /**\n * Server will wait #milliseconds between retries. Default 1000\n */\n readonly reconnectInterval?: number\n\n /**\n * Control if high availability monitoring runs for Replicaset or Mongos proxies. Default true\n */\n readonly ha?: boolean\n\n /**\n * The High availability period for replicaset inquiry. Default: 10000\n */\n readonly haInterval?: number\n\n /**\n * The name of the replicaset to connect to\n */\n readonly replicaSet?: string\n\n /**\n * Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms).\n * Default: 15\n */\n readonly acceptableLatencyMS?: number\n\n /**\n * Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms).\n * Default: 15\n */\n readonly secondaryAcceptableLatencyMS?: number\n\n /**\n * Sets if the driver should connect even if no primary is available. Default: false\n */\n readonly connectWithNoPrimary?: boolean\n\n /**\n * If the database authentication is dependent on another databaseName.\n */\n readonly authSource?: string\n\n /**\n * The write concern.\n */\n readonly w?: string | number\n\n /**\n * The write concern timeout value.\n */\n readonly wtimeout?: number\n\n /**\n * Specify a journal write concern. Default: false\n */\n readonly j?: boolean\n\n /**\n * Force server to assign _id values instead of driver. Default: false\n */\n readonly forceServerObjectId?: boolean\n\n /**\n * Serialize functions on any object. Default: false\n */\n readonly serializeFunctions?: boolean\n\n /**\n * Specify if the BSON serializer should ignore undefined fields. Default: false\n */\n readonly ignoreUndefined?: boolean\n\n /**\n * Return document results as raw BSON buffers. Default: false\n */\n readonly raw?: boolean\n\n /**\n * Promotes Long values to number if they fit inside the 53 bits resolution. Default: true\n */\n readonly promoteLongs?: boolean\n\n /**\n * Promotes Binary BSON values to native Node Buffers. Default: false\n */\n readonly promoteBuffers?: boolean\n\n /**\n * Promotes BSON values to native types where possible, set to false to only receive wrapper types. Default: true\n */\n readonly promoteValues?: boolean\n\n /**\n * Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit. Default: false\n */\n readonly domainsEnabled?: boolean\n\n /**\n * Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection,\n * default is -1 which is unlimited.\n */\n readonly bufferMaxEntries?: number\n\n /**\n * The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY,\n * ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).\n */\n readonly readPreference?: ReadPreference | string\n\n /**\n * A primary key factory object for generation of custom _id keys.\n */\n readonly pkFactory?: any\n\n /**\n * A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible.\n */\n readonly promiseLibrary?: any\n\n /**\n * Specify a read concern for the collection. (only MongoDB 3.2 or higher supported).\n */\n readonly readConcern?: any\n\n /**\n * Specify a maxStalenessSeconds value for secondary reads, minimum is 90 seconds\n */\n readonly maxStalenessSeconds?: number\n\n /**\n * Specify the log level used by the driver logger (error/warn/info/debug).\n */\n readonly loggerLevel?: \"error\" | \"warn\" | \"info\" | \"debug\"\n\n // Do not overwrite BaseDataSourceOptions.logger\n // readonly logger?: any;\n\n /**\n * Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function\n * Default: true\n */\n readonly checkServerIdentity?: boolean | Function\n\n /**\n * Validate MongoClient passed in options for correctness. Default: false\n */\n readonly validateOptions?: boolean | any\n\n /**\n * The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections\n */\n readonly appname?: string\n\n /**\n * Sets the authentication mechanism that MongoDB will use to authenticate the connection\n */\n readonly authMechanism?: string\n\n /**\n * Type of compression to use: snappy or zlib\n */\n readonly compression?: any\n\n /**\n * Specify a file sync write concern. Default: false\n */\n readonly fsync?: boolean\n\n /**\n * Read preference tags\n */\n readonly readPreferenceTags?: any[]\n\n /**\n * The number of retries for a tailable cursor. Default: 5\n */\n readonly numberOfRetries?: number\n\n /**\n * Enable auto reconnecting for single server instances. Default: true\n */\n readonly auto_reconnect?: boolean\n\n /**\n * Enable command monitoring for this client. Default: false\n */\n readonly monitorCommands?: boolean\n\n /**\n * If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections\n */\n readonly minSize?: number\n\n /**\n * Determines whether or not to use the new url parser. Default: false\n */\n readonly useNewUrlParser?: boolean\n\n /**\n * Determines whether or not to use the new Server Discovery and Monitoring engine. Default: false\n * https://github.com/mongodb/node-mongodb-native/releases/tag/v3.2.1\n */\n readonly useUnifiedTopology?: boolean\n\n /**\n * Automatic Client-Side Field Level Encryption configuration.\n */\n readonly autoEncryption?: any\n\n /**\n * Enables or disables the ability to retry writes upon encountering transient network errors.\n */\n readonly retryWrites?: boolean\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/driver/mongodb/MongoConnectionOptions.ts"],"names":[],"mappings":"","file":"MongoConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { ReadPreference } from \"./typings\"\n\n/**\n * MongoDB specific connection options.\n * Synced with http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html\n */\nexport interface MongoConnectionOptions extends BaseDataSourceOptions {\n /**\n * Database type.\n */\n readonly type: \"mongodb\"\n\n /**\n * Connection url where perform connection to.\n */\n readonly url?: string\n\n /**\n * Database host.\n */\n readonly host?: string\n\n /**\n * Database host replica set.\n */\n readonly hostReplicaSet?: string\n\n /**\n * Database host port.\n */\n readonly port?: number\n\n /**\n * Database username.\n */\n readonly username?: string\n\n /**\n * Database password.\n */\n readonly password?: string\n\n /**\n * Database name to connect to.\n */\n readonly database?: string\n\n /**\n * The driver object\n * This defaults to require(\"mongodb\")\n */\n readonly driver?: any\n\n /**\n * Use ssl connection (needs to have a mongod server with ssl support). Default: false\n */\n readonly ssl?: boolean\n\n /**\n * Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher).\n * Default: true\n */\n readonly sslValidate?: boolean\n\n /**\n * Array of valid certificates either as Buffers or Strings\n * (needs to have a mongod server with ssl support, 2.4 or higher).\n */\n readonly sslCA?: string | Buffer\n\n /**\n * String or buffer containing the certificate we wish to present\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslCert?: string | Buffer\n\n /**\n * String or buffer containing the certificate private key we wish to present\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslKey?: string\n\n /**\n * String or buffer containing the certificate password\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslPass?: string | Buffer\n\n /**\n * SSL Certificate revocation list binary buffer\n * (needs to have a mongod server with ssl support, 2.4 or higher)\n */\n readonly sslCRL?: string | Buffer\n\n /**\n * Reconnect on error. Default: true\n */\n readonly autoReconnect?: boolean\n\n /**\n * TCP Socket NoDelay option. Default: true\n */\n readonly noDelay?: boolean\n\n /**\n * The number of milliseconds to wait before initiating keepAlive on the TCP socket. Default: 30000\n */\n readonly keepAlive?: number\n\n /**\n * TCP Connection timeout setting. Default: 30000\n */\n readonly connectTimeoutMS?: number\n\n /**\n * Version of IP stack. Can be 4, 6.\n * If undefined, will attempt to connect with IPv6, and will fall back to IPv4 on failure\n */\n readonly family?: number\n\n /**\n * TCP Socket timeout setting. Default: 360000\n */\n readonly socketTimeoutMS?: number\n\n /**\n * Server attempt to reconnect #times. Default 30\n */\n readonly reconnectTries?: number\n\n /**\n * Server will wait #milliseconds between retries. Default 1000\n */\n readonly reconnectInterval?: number\n\n /**\n * Control if high availability monitoring runs for Replicaset or Mongos proxies. Default true\n */\n readonly ha?: boolean\n\n /**\n * The High availability period for replicaset inquiry. Default: 10000\n */\n readonly haInterval?: number\n\n /**\n * The name of the replicaset to connect to\n */\n readonly replicaSet?: string\n\n /**\n * Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms).\n * Default: 15\n */\n readonly acceptableLatencyMS?: number\n\n /**\n * Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms).\n * Default: 15\n */\n readonly secondaryAcceptableLatencyMS?: number\n\n /**\n * Sets if the driver should connect even if no primary is available. Default: false\n */\n readonly connectWithNoPrimary?: boolean\n\n /**\n * If the database authentication is dependent on another databaseName.\n */\n readonly authSource?: string\n\n /**\n * The write concern.\n */\n readonly w?: string | number\n\n /**\n * The write concern timeout value.\n */\n readonly wtimeout?: number\n\n /**\n * Specify a journal write concern. Default: false\n */\n readonly j?: boolean\n\n /**\n * Force server to assign _id values instead of driver. Default: false\n */\n readonly forceServerObjectId?: boolean\n\n /**\n * Serialize functions on any object. Default: false\n */\n readonly serializeFunctions?: boolean\n\n /**\n * Specify if the BSON serializer should ignore undefined fields. Default: false\n */\n readonly ignoreUndefined?: boolean\n\n /**\n * Return document results as raw BSON buffers. Default: false\n */\n readonly raw?: boolean\n\n /**\n * Promotes Long values to number if they fit inside the 53 bits resolution. Default: true\n */\n readonly promoteLongs?: boolean\n\n /**\n * Promotes Binary BSON values to native Node Buffers. Default: false\n */\n readonly promoteBuffers?: boolean\n\n /**\n * Promotes BSON values to native types where possible, set to false to only receive wrapper types. Default: true\n */\n readonly promoteValues?: boolean\n\n /**\n * Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit. Default: false\n */\n readonly domainsEnabled?: boolean\n\n /**\n * Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection,\n * default is -1 which is unlimited.\n */\n readonly bufferMaxEntries?: number\n\n /**\n * The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY,\n * ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).\n */\n readonly readPreference?: ReadPreference | string\n\n /**\n * A primary key factory object for generation of custom _id keys.\n */\n readonly pkFactory?: any\n\n /**\n * A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible.\n */\n readonly promiseLibrary?: any\n\n /**\n * Specify a read concern for the collection. (only MongoDB 3.2 or higher supported).\n */\n readonly readConcern?: any\n\n /**\n * Specify a maxStalenessSeconds value for secondary reads, minimum is 90 seconds\n */\n readonly maxStalenessSeconds?: number\n\n /**\n * Specify the log level used by the driver logger (error/warn/info/debug).\n */\n readonly loggerLevel?: \"error\" | \"warn\" | \"info\" | \"debug\"\n\n // Do not overwrite BaseDataSourceOptions.logger\n // readonly logger?: any;\n\n /**\n * Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function\n * Default: true\n */\n readonly checkServerIdentity?: boolean | Function\n\n /**\n * Validate MongoClient passed in options for correctness. Default: false\n */\n readonly validateOptions?: boolean | any\n\n /**\n * The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections\n */\n readonly appname?: string\n\n /**\n * Sets the authentication mechanism that MongoDB will use to authenticate the connection\n */\n readonly authMechanism?: string\n\n /**\n * Type of compression to use: snappy or zlib\n */\n readonly compression?: any\n\n /**\n * Specify a file sync write concern. Default: false\n */\n readonly fsync?: boolean\n\n /**\n * Read preference tags\n */\n readonly readPreferenceTags?: any[]\n\n /**\n * The number of retries for a tailable cursor. Default: 5\n */\n readonly numberOfRetries?: number\n\n /**\n * Enable auto reconnecting for single server instances. Default: true\n */\n readonly auto_reconnect?: boolean\n\n /**\n * Enable command monitoring for this client. Default: false\n */\n readonly monitorCommands?: boolean\n\n /**\n * If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections\n */\n readonly minSize?: number\n\n /**\n * Determines whether or not to use the new url parser. Default: false\n */\n readonly useNewUrlParser?: boolean\n\n /**\n * Determines whether or not to use the new Server Discovery and Monitoring engine. Default: false\n * https://github.com/mongodb/node-mongodb-native/releases/tag/v3.2.1\n */\n readonly useUnifiedTopology?: boolean\n\n /**\n * Automatic Client-Side Field Level Encryption configuration.\n */\n readonly autoEncryption?: any\n\n /**\n * Enables or disables the ability to retry writes upon encountering transient network errors.\n */\n readonly retryWrites?: boolean\n}\n"],"sourceRoot":"../.."}
|
|
@@ -973,7 +973,7 @@ export class MysqlDriver {
|
|
|
973
973
|
socketPath: credentials.socketPath,
|
|
974
974
|
}, options.acquireTimeout === undefined
|
|
975
975
|
? {}
|
|
976
|
-
: { acquireTimeout: options.acquireTimeout }, options.extra || {});
|
|
976
|
+
: { acquireTimeout: options.acquireTimeout }, { connectionLimit: options.poolSize }, options.extra || {});
|
|
977
977
|
}
|
|
978
978
|
/**
|
|
979
979
|
* Creates a new connection pool for a given database credentials.
|