typeorm 0.3.21-dev.30f801f → 0.3.21-dev.4d31902
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/README.md +1 -7
- package/browser/data-source/DataSource.d.ts +2 -0
- package/browser/data-source/DataSource.js +2 -0
- package/browser/data-source/DataSource.js.map +1 -1
- package/browser/decorator/relations/OneToOne.d.ts +4 -4
- package/browser/decorator/relations/OneToOne.js +2 -2
- package/browser/decorator/relations/OneToOne.js.map +1 -1
- package/browser/driver/aurora-mysql/AuroraMysqlConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/aurora-mysql/AuroraMysqlConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js +2 -2
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/cockroachdb/CockroachConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachConnectionOptions.d.ts +1 -1
- package/browser/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/browser/driver/mongodb/MongoConnectionOptions.d.ts +1 -1
- package/browser/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/browser/driver/mysql/MysqlConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/mysql/MysqlConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/mysql/MysqlConnectionOptions.d.ts +1 -1
- package/browser/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/browser/driver/oracle/OracleConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/oracle/OracleConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/oracle/OracleConnectionOptions.d.ts +1 -1
- package/browser/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/postgres/PostgresConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.d.ts +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/browser/driver/spanner/SpannerConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/spanner/SpannerConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/spanner/SpannerConnectionOptions.d.ts +1 -1
- package/browser/driver/spanner/SpannerConnectionOptions.js.map +1 -1
- package/browser/driver/sqlite/SqliteDriver.js +2 -2
- package/browser/driver/sqlite/SqliteDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.d.ts +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/browser/entity-manager/EntityManager.d.ts +2 -0
- package/browser/entity-manager/EntityManager.js +4 -2
- package/browser/entity-manager/EntityManager.js.map +1 -1
- package/browser/platform/PlatformTools.js +3 -9
- package/browser/platform/PlatformTools.js.map +1 -1
- package/browser/repository/Repository.d.ts +2 -0
- package/browser/repository/Repository.js +2 -0
- package/browser/repository/Repository.js.map +1 -1
- package/browser/util/ImportUtils.js +22 -34
- package/browser/util/ImportUtils.js.map +1 -1
- package/commands/CommandUtils.d.ts +1 -1
- package/commands/CommandUtils.js +18 -16
- package/commands/CommandUtils.js.map +1 -1
- package/data-source/DataSource.d.ts +2 -0
- package/data-source/DataSource.js +2 -0
- package/data-source/DataSource.js.map +1 -1
- package/decorator/relations/OneToOne.d.ts +4 -4
- package/decorator/relations/OneToOne.js +2 -2
- package/decorator/relations/OneToOne.js.map +1 -1
- package/driver/aurora-mysql/AuroraMysqlConnectionCredentialsOptions.d.ts +1 -1
- package/driver/aurora-mysql/AuroraMysqlConnectionCredentialsOptions.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3Driver.js +2 -2
- package/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/driver/cockroachdb/CockroachConnectionCredentialsOptions.d.ts +1 -1
- package/driver/cockroachdb/CockroachConnectionCredentialsOptions.js.map +1 -1
- package/driver/cockroachdb/CockroachConnectionOptions.d.ts +1 -1
- package/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/driver/mongodb/MongoConnectionOptions.d.ts +1 -1
- package/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/driver/mysql/MysqlConnectionCredentialsOptions.d.ts +1 -1
- package/driver/mysql/MysqlConnectionCredentialsOptions.js.map +1 -1
- package/driver/mysql/MysqlConnectionOptions.d.ts +1 -1
- package/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/driver/oracle/OracleConnectionCredentialsOptions.d.ts +1 -1
- package/driver/oracle/OracleConnectionCredentialsOptions.js.map +1 -1
- package/driver/oracle/OracleConnectionOptions.d.ts +1 -1
- package/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/driver/postgres/PostgresConnectionCredentialsOptions.d.ts +1 -1
- package/driver/postgres/PostgresConnectionCredentialsOptions.js.map +1 -1
- package/driver/postgres/PostgresConnectionOptions.d.ts +1 -1
- package/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/driver/spanner/SpannerConnectionCredentialsOptions.d.ts +1 -1
- package/driver/spanner/SpannerConnectionCredentialsOptions.js.map +1 -1
- package/driver/spanner/SpannerConnectionOptions.d.ts +1 -1
- package/driver/spanner/SpannerConnectionOptions.js.map +1 -1
- package/driver/sqlite/SqliteDriver.js +2 -2
- package/driver/sqlite/SqliteDriver.js.map +1 -1
- package/driver/sqlserver/SqlServerConnectionCredentialsOptions.d.ts +1 -1
- package/driver/sqlserver/SqlServerConnectionCredentialsOptions.js.map +1 -1
- package/driver/sqlserver/SqlServerConnectionOptions.d.ts +1 -1
- package/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/entity-manager/EntityManager.d.ts +2 -0
- package/entity-manager/EntityManager.js +4 -2
- package/entity-manager/EntityManager.js.map +1 -1
- package/package.json +1 -1
- package/platform/PlatformTools.js +12 -18
- package/platform/PlatformTools.js.map +1 -1
- package/repository/Repository.d.ts +2 -0
- package/repository/Repository.js +2 -0
- package/repository/Repository.js.map +1 -1
- package/util/ImportUtils.js +22 -34
- package/util/ImportUtils.js.map +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ObjectType } from "../../common/ObjectType";
|
|
2
2
|
import { RelationOptions } from "../options/RelationOptions";
|
|
3
3
|
/**
|
|
4
|
-
* One-to-one relation allows
|
|
5
|
-
* Entity1 is
|
|
4
|
+
* One-to-one relation allows the creation of a direct relation between two entities. Entity1 has only one Entity2.
|
|
5
|
+
* Entity1 is the owner of the relationship, and stores Entity2 id on its own side.
|
|
6
6
|
*/
|
|
7
7
|
export declare function OneToOne<T>(typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>), options?: RelationOptions): PropertyDecorator;
|
|
8
8
|
/**
|
|
9
|
-
* One-to-one relation allows
|
|
10
|
-
* Entity1 is
|
|
9
|
+
* One-to-one relation allows the creation of a direct relation between two entities. Entity1 has only one Entity2.
|
|
10
|
+
* Entity1 is the owner of the relationship, and stores Entity2 id on its own side.
|
|
11
11
|
*/
|
|
12
12
|
export declare function OneToOne<T>(typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>), inverseSide?: string | ((object: T) => any), options?: RelationOptions): PropertyDecorator;
|
|
@@ -4,8 +4,8 @@ exports.OneToOne = OneToOne;
|
|
|
4
4
|
const globals_1 = require("../../globals");
|
|
5
5
|
const ObjectUtils_1 = require("../../util/ObjectUtils");
|
|
6
6
|
/**
|
|
7
|
-
* One-to-one relation allows
|
|
8
|
-
* Entity1 is
|
|
7
|
+
* One-to-one relation allows the creation of a direct relation between two entities. Entity1 has only one Entity2.
|
|
8
|
+
* Entity1 is the owner of the relationship, and stores Entity2 id on its own side.
|
|
9
9
|
*/
|
|
10
10
|
function OneToOne(typeFunctionOrTarget, inverseSideOrOptions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BAAmB,EAAE,mBAAmB;YACxC,OAAO,EAAE,OAAO;SACK,CAAC,CAAA;IAC9B,CAAC,CAAA;AACL,CAAC","file":"OneToOne.js","sourcesContent":["import { getMetadataArgsStorage } from \"../../globals\"\nimport { RelationMetadataArgs } from \"../../metadata-args/RelationMetadataArgs\"\nimport { ObjectType } from \"../../common/ObjectType\"\nimport { RelationOptions } from \"../options/RelationOptions\"\nimport { ObjectUtils } from \"../../util/ObjectUtils\"\n\n/**\n * One-to-one relation allows
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/relations/OneToOne.ts"],"names":[],"mappings":";;AA6BA,4BA4CC;AAzED,2CAAsD;AAItD,wDAAoD;AAqBpD;;;GAGG;AACH,SAAgB,QAAQ,CACpB,oBAA8D,EAC9D,oBAAsE,EACtE,OAAyB;IAEzB,uBAAuB;IACvB,IAAI,mBAAkD,CAAA;IACtD,IAAI,yBAAW,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC7C,OAAO,GAAoB,oBAAoB,CAAA;IACnD,CAAC;SAAM,CAAC;QACJ,mBAAmB,GAAG,oBAA2B,CAAA;IACrD,CAAC;IAED,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,IAAI,CAAC,OAAO;YAAE,OAAO,GAAG,EAAqB,CAAA;QAE7C,4CAA4C;QAC5C,IAAI,MAAM,GAAG,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAA;QAC5D,IAAI,CAAC,MAAM,IAAI,OAAO,IAAK,OAAe,CAAC,WAAW,EAAE,CAAC;YACrD,0BAA0B;YAC1B,MAAM,aAAa,GAAI,OAAe,CAAC,WAAW,CAC9C,aAAa,EACb,MAAM,EACN,YAAY,CACf,CAAA;YACD,IACI,aAAa;gBACb,OAAO,aAAa,CAAC,IAAI,KAAK,QAAQ;gBACtC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,SAAS;gBAE9C,MAAM,GAAG,IAAI,CAAA;QACrB,CAAC;QAED,IAAA,gCAAsB,GAAE,CAAC,SAAS,CAAC,IAAI,CAAC;YACpC,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,+BAA+B;YAC/B,MAAM,EAAE,MAAM;YACd,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,oBAAoB;YAC1B,mBAAmB,EAAE,mBAAmB;YACxC,OAAO,EAAE,OAAO;SACK,CAAC,CAAA;IAC9B,CAAC,CAAA;AACL,CAAC","file":"OneToOne.js","sourcesContent":["import { getMetadataArgsStorage } from \"../../globals\"\nimport { RelationMetadataArgs } from \"../../metadata-args/RelationMetadataArgs\"\nimport { ObjectType } from \"../../common/ObjectType\"\nimport { RelationOptions } from \"../options/RelationOptions\"\nimport { ObjectUtils } from \"../../util/ObjectUtils\"\n\n/**\n * One-to-one relation allows the creation of a direct relation between two entities. Entity1 has only one Entity2.\n * Entity1 is the owner of the relationship, and stores Entity2 id on its own side.\n */\nexport function OneToOne<T>(\n typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>),\n options?: RelationOptions,\n): PropertyDecorator\n\n/**\n * One-to-one relation allows the creation of a direct relation between two entities. Entity1 has only one Entity2.\n * Entity1 is the owner of the relationship, and stores Entity2 id on its own side.\n */\nexport function OneToOne<T>(\n typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>),\n inverseSide?: string | ((object: T) => any),\n options?: RelationOptions,\n): PropertyDecorator\n\n/**\n * One-to-one relation allows the creation of a direct relation between two entities. Entity1 has only one Entity2.\n * Entity1 is the owner of the relationship, and stores Entity2 id on its own side.\n */\nexport function OneToOne<T>(\n typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>),\n inverseSideOrOptions?: string | ((object: T) => any) | RelationOptions,\n options?: RelationOptions,\n): PropertyDecorator {\n // normalize parameters\n let inverseSideProperty: string | ((object: T) => any)\n if (ObjectUtils.isObject(inverseSideOrOptions)) {\n options = <RelationOptions>inverseSideOrOptions\n } else {\n inverseSideProperty = inverseSideOrOptions as any\n }\n\n return function (object: Object, propertyName: string) {\n if (!options) options = {} as RelationOptions\n\n // now try to determine it its lazy relation\n let isLazy = options && options.lazy === true ? true : false\n if (!isLazy && Reflect && (Reflect as any).getMetadata) {\n // automatic determination\n const reflectedType = (Reflect as any).getMetadata(\n \"design:type\",\n object,\n propertyName,\n )\n if (\n reflectedType &&\n typeof reflectedType.name === \"string\" &&\n reflectedType.name.toLowerCase() === \"promise\"\n )\n isLazy = true\n }\n\n getMetadataArgsStorage().relations.push({\n target: object.constructor,\n propertyName: propertyName,\n // propertyType: reflectedType,\n isLazy: isLazy,\n relationType: \"one-to-one\",\n type: typeFunctionOrTarget,\n inverseSideProperty: inverseSideProperty,\n options: options,\n } as RelationMetadataArgs)\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/aurora-mysql/AuroraMysqlConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"AuroraMysqlConnectionCredentialsOptions.js","sourcesContent":["/**\n * MySQL specific connection credential options.\n *\n * @see https://github.com/mysqljs/mysql#connection-options\n */\nexport interface AuroraMysqlConnectionCredentialsOptions {\n /**\n * Connection url where
|
|
1
|
+
{"version":3,"sources":["../../src/driver/aurora-mysql/AuroraMysqlConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"AuroraMysqlConnectionCredentialsOptions.js","sourcesContent":["/**\n * MySQL specific connection credential options.\n *\n * @see https://github.com/mysqljs/mysql#connection-options\n */\nexport interface AuroraMysqlConnectionCredentialsOptions {\n /**\n * Connection url where the connection is performed.\n */\n readonly url?: string\n\n /**\n * Database host.\n */\n readonly host?: 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 * Object with ssl parameters or a string containing name of ssl profile.\n */\n readonly ssl?: any\n}\n"],"sourceRoot":"../.."}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BetterSqlite3Driver = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const promises_1 = tslib_1.__importDefault(require("fs/promises"));
|
|
6
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
7
|
const error_1 = require("../../error");
|
|
8
8
|
const PlatformTools_1 = require("../../platform/PlatformTools");
|
|
@@ -126,7 +126,7 @@ class BetterSqlite3Driver extends AbstractSqliteDriver_1.AbstractSqliteDriver {
|
|
|
126
126
|
* Auto creates database directory if it does not exist.
|
|
127
127
|
*/
|
|
128
128
|
async createDatabaseDirectory(dbPath) {
|
|
129
|
-
await
|
|
129
|
+
await promises_1.default.mkdir(dbPath, { recursive: true });
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
132
|
* Performs the attaching of the database files. The attachedDatabase should have been populated during calls to #buildTableName
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/better-sqlite3/BetterSqlite3Driver.ts"],"names":[],"mappings":";;;;AAAA,4DAA2B;AAC3B,wDAAuB;AACvB,uCAA4D;AAC5D,gEAA4D;AAI5D,kFAA8E;AAE9E,yEAAqE;AAErE,oDAAiE;AAEjE;;GAEG;AACH,MAAa,mBAAoB,SAAQ,2CAAoB;IAezD,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,YAAY,UAAsB;QAC9B,KAAK,CAAC,UAAU,CAAC,CAAA;QAEjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAyC,CAAA;QACnE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAA;QAErC,sBAAsB;QACtB,IAAI,CAAC,gBAAgB,EAAE,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AC,CAC1D,CAAA;IACL,CAAC;CACJ;AA7MD,kDA6MC","file":"BetterSqlite3Driver.js","sourcesContent":["import mkdirp from \"mkdirp\"\nimport path from \"path\"\nimport { DriverPackageNotInstalledError } from \"../../error\"\nimport { PlatformTools } from \"../../platform/PlatformTools\"\nimport { DataSource } from \"../../data-source\"\nimport { ColumnType } from \"../types/ColumnTypes\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { AbstractSqliteDriver } from \"../sqlite-abstract/AbstractSqliteDriver\"\nimport { BetterSqlite3ConnectionOptions } from \"./BetterSqlite3ConnectionOptions\"\nimport { BetterSqlite3QueryRunner } from \"./BetterSqlite3QueryRunner\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { filepathToName, isAbsolute } from \"../../util/PathUtils\"\n\n/**\n * Organizes communication with sqlite DBMS.\n */\nexport class BetterSqlite3Driver extends AbstractSqliteDriver {\n // -------------------------------------------------------------------------\n // Public Implemented Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection options.\n */\n options: BetterSqlite3ConnectionOptions\n\n /**\n * SQLite underlying library.\n */\n sqlite: any\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(connection: DataSource) {\n super(connection)\n\n this.connection = connection\n this.options = connection.options as BetterSqlite3ConnectionOptions\n this.database = this.options.database\n\n // load sqlite package\n this.loadDependencies()\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Closes connection with database.\n */\n async disconnect(): Promise<void> {\n this.queryRunner = undefined\n this.databaseConnection.close()\n }\n\n /**\n * Creates a query runner used to execute database queries.\n */\n createQueryRunner(mode: ReplicationMode): QueryRunner {\n if (!this.queryRunner)\n this.queryRunner = new BetterSqlite3QueryRunner(this)\n\n return this.queryRunner\n }\n\n normalizeType(column: {\n type?: ColumnType\n length?: number | string\n precision?: number | null\n scale?: number\n }): string {\n if ((column.type as any) === Buffer) {\n return \"blob\"\n }\n\n return super.normalizeType(column)\n }\n\n async afterConnect(): Promise<void> {\n return this.attachDatabases()\n }\n\n /**\n * For SQLite, the database may be added in the decorator metadata. It will be a filepath to a database file.\n */\n buildTableName(\n tableName: string,\n _schema?: string,\n database?: string,\n ): string {\n if (!database) return tableName\n if (this.getAttachedDatabaseHandleByRelativePath(database))\n return `${this.getAttachedDatabaseHandleByRelativePath(\n database,\n )}.${tableName}`\n\n if (database === this.options.database) return tableName\n\n // we use the decorated name as supplied when deriving attach handle (ideally without non-portable absolute path)\n const identifierHash = filepathToName(database)\n // decorated name will be assumed relative to main database file when non absolute. Paths supplied as absolute won't be portable\n const absFilepath = isAbsolute(database)\n ? database\n : path.join(this.getMainDatabasePath(), database)\n\n this.attachedDatabases[database] = {\n attachFilepathAbsolute: absFilepath,\n attachFilepathRelative: database,\n attachHandle: identifierHash,\n }\n\n return `${identifierHash}.${tableName}`\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates connection with the database.\n */\n protected async createDatabaseConnection() {\n // not to create database directory if is in memory\n if (this.options.database !== \":memory:\")\n await this.createDatabaseDirectory(\n path.dirname(this.options.database),\n )\n\n const {\n database,\n readonly = false,\n fileMustExist = false,\n timeout = 5000,\n verbose = null,\n nativeBinding = null,\n prepareDatabase,\n } = this.options\n const databaseConnection = this.sqlite(database, {\n readonly,\n fileMustExist,\n timeout,\n verbose,\n nativeBinding,\n })\n // in the options, if encryption key for SQLCipher is setted.\n // Must invoke key pragma before trying to do any other interaction with the database.\n if (this.options.key) {\n databaseConnection.exec(\n `PRAGMA key = ${JSON.stringify(this.options.key)}`,\n )\n }\n\n // function to run before a database is used in typeorm.\n if (typeof prepareDatabase === \"function\") {\n prepareDatabase(databaseConnection)\n }\n\n // we need to enable foreign keys in sqlite to make sure all foreign key related features\n // working properly. this also makes onDelete to work with sqlite.\n databaseConnection.exec(`PRAGMA foreign_keys = ON`)\n\n // turn on WAL mode to enhance performance\n if (this.options.enableWAL) {\n databaseConnection.exec(`PRAGMA journal_mode = WAL`)\n }\n\n return databaseConnection\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 sqlite =\n this.options.driver || PlatformTools.load(\"better-sqlite3\")\n this.sqlite = sqlite\n } catch (e) {\n throw new DriverPackageNotInstalledError(\"SQLite\", \"better-sqlite3\")\n }\n }\n\n /**\n * Auto creates database directory if it does not exist.\n */\n protected async createDatabaseDirectory(dbPath: string): Promise<void> {\n await mkdirp(dbPath)\n }\n\n /**\n * Performs the attaching of the database files. The attachedDatabase should have been populated during calls to #buildTableName\n * during EntityMetadata production (see EntityMetadata#buildTablePath)\n *\n * https://sqlite.org/lang_attach.html\n */\n protected async attachDatabases() {\n // @todo - possibly check number of databases (but unqueriable at runtime sadly) - https://www.sqlite.org/limits.html#max_attached\n for await (const {\n attachHandle,\n attachFilepathAbsolute,\n } of Object.values(this.attachedDatabases)) {\n await this.createDatabaseDirectory(\n path.dirname(attachFilepathAbsolute),\n )\n await this.connection.query(\n `ATTACH \"${attachFilepathAbsolute}\" AS \"${attachHandle}\"`,\n )\n }\n }\n\n protected getMainDatabasePath(): string {\n const optionsDb = this.options.database\n return path.dirname(\n isAbsolute(optionsDb)\n ? optionsDb\n : path.join(this.options.baseDirectory!, optionsDb),\n )\n }\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../src/driver/better-sqlite3/BetterSqlite3Driver.ts"],"names":[],"mappings":";;;;AAAA,mEAA4B;AAC5B,wDAAuB;AACvB,uCAA4D;AAC5D,gEAA4D;AAI5D,kFAA8E;AAE9E,yEAAqE;AAErE,oDAAiE;AAEjE;;GAEG;AACH,MAAa,mBAAoB,SAAQ,2CAAoB;IAezD,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,YAAY,UAAsB;QAC9B,KAAK,CAAC,UAAU,CAAC,CAAA;QAEjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5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AI,CAAC,OAAO,CAAC,QAAQ,CAAA;QACvC,OAAO,cAAI,CAAC,OAAO,CACf,IAAA,sBAAU,EAAC,SAAS,CAAC;YACjB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAc,EAAE,SAAS,CAAC,CAC1D,CAAA;IACL,CAAC;CACJ;AA7MD,kDA6MC","file":"BetterSqlite3Driver.js","sourcesContent":["import fs from \"fs/promises\"\nimport path from \"path\"\nimport { DriverPackageNotInstalledError } from \"../../error\"\nimport { PlatformTools } from \"../../platform/PlatformTools\"\nimport { DataSource } from \"../../data-source\"\nimport { ColumnType } from \"../types/ColumnTypes\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { AbstractSqliteDriver } from \"../sqlite-abstract/AbstractSqliteDriver\"\nimport { BetterSqlite3ConnectionOptions } from \"./BetterSqlite3ConnectionOptions\"\nimport { BetterSqlite3QueryRunner } from \"./BetterSqlite3QueryRunner\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { filepathToName, isAbsolute } from \"../../util/PathUtils\"\n\n/**\n * Organizes communication with sqlite DBMS.\n */\nexport class BetterSqlite3Driver extends AbstractSqliteDriver {\n // -------------------------------------------------------------------------\n // Public Implemented Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection options.\n */\n options: BetterSqlite3ConnectionOptions\n\n /**\n * SQLite underlying library.\n */\n sqlite: any\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(connection: DataSource) {\n super(connection)\n\n this.connection = connection\n this.options = connection.options as BetterSqlite3ConnectionOptions\n this.database = this.options.database\n\n // load sqlite package\n this.loadDependencies()\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Closes connection with database.\n */\n async disconnect(): Promise<void> {\n this.queryRunner = undefined\n this.databaseConnection.close()\n }\n\n /**\n * Creates a query runner used to execute database queries.\n */\n createQueryRunner(mode: ReplicationMode): QueryRunner {\n if (!this.queryRunner)\n this.queryRunner = new BetterSqlite3QueryRunner(this)\n\n return this.queryRunner\n }\n\n normalizeType(column: {\n type?: ColumnType\n length?: number | string\n precision?: number | null\n scale?: number\n }): string {\n if ((column.type as any) === Buffer) {\n return \"blob\"\n }\n\n return super.normalizeType(column)\n }\n\n async afterConnect(): Promise<void> {\n return this.attachDatabases()\n }\n\n /**\n * For SQLite, the database may be added in the decorator metadata. It will be a filepath to a database file.\n */\n buildTableName(\n tableName: string,\n _schema?: string,\n database?: string,\n ): string {\n if (!database) return tableName\n if (this.getAttachedDatabaseHandleByRelativePath(database))\n return `${this.getAttachedDatabaseHandleByRelativePath(\n database,\n )}.${tableName}`\n\n if (database === this.options.database) return tableName\n\n // we use the decorated name as supplied when deriving attach handle (ideally without non-portable absolute path)\n const identifierHash = filepathToName(database)\n // decorated name will be assumed relative to main database file when non absolute. Paths supplied as absolute won't be portable\n const absFilepath = isAbsolute(database)\n ? database\n : path.join(this.getMainDatabasePath(), database)\n\n this.attachedDatabases[database] = {\n attachFilepathAbsolute: absFilepath,\n attachFilepathRelative: database,\n attachHandle: identifierHash,\n }\n\n return `${identifierHash}.${tableName}`\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates connection with the database.\n */\n protected async createDatabaseConnection() {\n // not to create database directory if is in memory\n if (this.options.database !== \":memory:\")\n await this.createDatabaseDirectory(\n path.dirname(this.options.database),\n )\n\n const {\n database,\n readonly = false,\n fileMustExist = false,\n timeout = 5000,\n verbose = null,\n nativeBinding = null,\n prepareDatabase,\n } = this.options\n const databaseConnection = this.sqlite(database, {\n readonly,\n fileMustExist,\n timeout,\n verbose,\n nativeBinding,\n })\n // in the options, if encryption key for SQLCipher is setted.\n // Must invoke key pragma before trying to do any other interaction with the database.\n if (this.options.key) {\n databaseConnection.exec(\n `PRAGMA key = ${JSON.stringify(this.options.key)}`,\n )\n }\n\n // function to run before a database is used in typeorm.\n if (typeof prepareDatabase === \"function\") {\n prepareDatabase(databaseConnection)\n }\n\n // we need to enable foreign keys in sqlite to make sure all foreign key related features\n // working properly. this also makes onDelete to work with sqlite.\n databaseConnection.exec(`PRAGMA foreign_keys = ON`)\n\n // turn on WAL mode to enhance performance\n if (this.options.enableWAL) {\n databaseConnection.exec(`PRAGMA journal_mode = WAL`)\n }\n\n return databaseConnection\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 sqlite =\n this.options.driver || PlatformTools.load(\"better-sqlite3\")\n this.sqlite = sqlite\n } catch (e) {\n throw new DriverPackageNotInstalledError(\"SQLite\", \"better-sqlite3\")\n }\n }\n\n /**\n * Auto creates database directory if it does not exist.\n */\n protected async createDatabaseDirectory(dbPath: string): Promise<void> {\n await fs.mkdir(dbPath, { recursive: true })\n }\n\n /**\n * Performs the attaching of the database files. The attachedDatabase should have been populated during calls to #buildTableName\n * during EntityMetadata production (see EntityMetadata#buildTablePath)\n *\n * https://sqlite.org/lang_attach.html\n */\n protected async attachDatabases() {\n // @todo - possibly check number of databases (but unqueriable at runtime sadly) - https://www.sqlite.org/limits.html#max_attached\n for await (const {\n attachHandle,\n attachFilepathAbsolute,\n } of Object.values(this.attachedDatabases)) {\n await this.createDatabaseDirectory(\n path.dirname(attachFilepathAbsolute),\n )\n await this.connection.query(\n `ATTACH \"${attachFilepathAbsolute}\" AS \"${attachHandle}\"`,\n )\n }\n }\n\n protected getMainDatabasePath(): string {\n const optionsDb = this.options.database\n return path.dirname(\n isAbsolute(optionsDb)\n ? optionsDb\n : path.join(this.options.baseDirectory!, optionsDb),\n )\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/cockroachdb/CockroachConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"CockroachConnectionCredentialsOptions.js","sourcesContent":["import { TlsOptions } from \"tls\"\n\n/**\n * Cockroachdb specific connection credential options.\n */\nexport interface CockroachConnectionCredentialsOptions {\n /**\n * Connection url where
|
|
1
|
+
{"version":3,"sources":["../../src/driver/cockroachdb/CockroachConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"CockroachConnectionCredentialsOptions.js","sourcesContent":["import { TlsOptions } from \"tls\"\n\n/**\n * Cockroachdb specific connection credential options.\n */\nexport interface CockroachConnectionCredentialsOptions {\n /**\n * Connection url where the connection is performed.\n */\n readonly url?: string\n\n /**\n * Database host.\n */\n readonly host?: 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 * Object with ssl parameters\n */\n readonly ssl?: boolean | TlsOptions\n}\n"],"sourceRoot":"../.."}
|
|
@@ -37,7 +37,7 @@ export interface CockroachConnectionOptions extends BaseDataSourceOptions, Cockr
|
|
|
37
37
|
*/
|
|
38
38
|
readonly master: CockroachConnectionCredentialsOptions;
|
|
39
39
|
/**
|
|
40
|
-
* List of read-from
|
|
40
|
+
* List of read-from servers (slaves).
|
|
41
41
|
*/
|
|
42
42
|
readonly slaves: CockroachConnectionCredentialsOptions[];
|
|
43
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/cockroachdb/CockroachConnectionOptions.ts"],"names":[],"mappings":"","file":"CockroachConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { CockroachConnectionCredentialsOptions } from \"./CockroachConnectionCredentialsOptions\"\n\n/**\n * Cockroachdb-specific connection options.\n */\nexport interface CockroachConnectionOptions\n extends BaseDataSourceOptions,\n CockroachConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"cockroachdb\"\n\n /**\n * Enable time travel queries on cockroachdb.\n * https://www.cockroachlabs.com/docs/stable/as-of-system-time.html\n */\n readonly timeTravelQueries: boolean\n\n /**\n * Schema name.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"pg\")`.\n */\n readonly driver?: any\n\n /**\n * The driver object\n * This defaults to `require(\"pg-native\")`.\n */\n readonly nativeDriver?: any\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: CockroachConnectionCredentialsOptions\n\n /**\n * List of read-from
|
|
1
|
+
{"version":3,"sources":["../../src/driver/cockroachdb/CockroachConnectionOptions.ts"],"names":[],"mappings":"","file":"CockroachConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { CockroachConnectionCredentialsOptions } from \"./CockroachConnectionCredentialsOptions\"\n\n/**\n * Cockroachdb-specific connection options.\n */\nexport interface CockroachConnectionOptions\n extends BaseDataSourceOptions,\n CockroachConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"cockroachdb\"\n\n /**\n * Enable time travel queries on cockroachdb.\n * https://www.cockroachlabs.com/docs/stable/as-of-system-time.html\n */\n readonly timeTravelQueries: boolean\n\n /**\n * Schema name.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"pg\")`.\n */\n readonly driver?: any\n\n /**\n * The driver object\n * This defaults to `require(\"pg-native\")`.\n */\n readonly nativeDriver?: any\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: CockroachConnectionCredentialsOptions\n\n /**\n * List of read-from servers (slaves).\n */\n readonly slaves: CockroachConnectionCredentialsOptions[]\n\n /**\n * Default connection pool to use for SELECT queries\n * @default \"slave\"\n */\n readonly defaultMode?: ReplicationMode\n }\n\n /**\n * sets the application_name var to help db administrators identify\n * the service using this connection. Defaults to 'undefined'\n */\n readonly applicationName?: string\n\n /**\n * Function handling errors thrown by drivers pool.\n * Defaults to logging error with `warn` level.\n */\n readonly poolErrorHandler?: (err: any) => any\n\n /**\n * Max number of transaction retries in case of 40001 error.\n */\n readonly maxTransactionRetries?: number\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../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 * Specifies whether to force dispatch all operations to the specified host. Default: false\n */\n readonly directConnection?: boolean\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":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../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 the connection is performed.\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 * Specifies whether to force dispatch all operations to the specified host. Default: false\n */\n readonly directConnection?: boolean\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":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/mysql/MysqlConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"MysqlConnectionCredentialsOptions.js","sourcesContent":["/**\n * MySQL specific connection credential options.\n *\n * @see https://github.com/mysqljs/mysql#connection-options\n */\nexport interface MysqlConnectionCredentialsOptions {\n /**\n * Connection url where
|
|
1
|
+
{"version":3,"sources":["../../src/driver/mysql/MysqlConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"MysqlConnectionCredentialsOptions.js","sourcesContent":["/**\n * MySQL specific connection credential options.\n *\n * @see https://github.com/mysqljs/mysql#connection-options\n */\nexport interface MysqlConnectionCredentialsOptions {\n /**\n * Connection url where the connection is performed.\n */\n readonly url?: string\n\n /**\n * Database host.\n */\n readonly host?: 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 * Object with ssl parameters or a string containing name of ssl profile.\n */\n readonly ssl?: any\n\n /**\n * Database socket path\n */\n readonly socketPath?: string\n}\n"],"sourceRoot":"../.."}
|
|
@@ -99,7 +99,7 @@ export interface MysqlConnectionOptions extends BaseDataSourceOptions, MysqlConn
|
|
|
99
99
|
*/
|
|
100
100
|
readonly master: MysqlConnectionCredentialsOptions;
|
|
101
101
|
/**
|
|
102
|
-
* List of read-from
|
|
102
|
+
* List of read-from servers (slaves).
|
|
103
103
|
*/
|
|
104
104
|
readonly slaves: MysqlConnectionCredentialsOptions[];
|
|
105
105
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/mysql/MysqlConnectionOptions.ts"],"names":[],"mappings":"","file":"MysqlConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { MysqlConnectionCredentialsOptions } from \"./MysqlConnectionCredentialsOptions\"\n\n/**\n * MySQL specific connection options.\n *\n * @see https://github.com/mysqljs/mysql#connection-options\n */\nexport interface MysqlConnectionOptions\n extends BaseDataSourceOptions,\n MysqlConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"mysql\" | \"mariadb\"\n\n /**\n * The driver object\n * This defaults to require(\"mysql\").\n * Falls back to require(\"mysql2\")\n */\n readonly driver?: any\n\n /**\n * The charset for the connection. This is called \"collation\" in the SQL-level of MySQL (like utf8_general_ci).\n * If a SQL-level charset is specified (like utf8mb4) then the default collation for that charset is used.\n * Default: 'UTF8_GENERAL_CI'\n */\n readonly charset?: string\n\n /**\n * The timezone configured on the MySQL server.\n * This is used to type cast server date/time values to JavaScript Date object and vice versa.\n * This can be 'local', 'Z', or an offset in the form +HH:MM or -HH:MM. (Default: 'local')\n */\n readonly timezone?: string\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10000)\n */\n readonly connectTimeout?: number\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10000)\n * This difference between connectTimeout and acquireTimeout is subtle and is described in the mysqljs/mysql docs\n * https://github.com/mysqljs/mysql/tree/master#pool-options\n */\n readonly acquireTimeout?: number\n\n /**\n * Allow connecting to MySQL instances that ask for the old (insecure) authentication method. (Default: false)\n */\n readonly insecureAuth?: boolean\n\n /**\n * When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option (Default: false)\n */\n readonly supportBigNumbers?: boolean\n\n /**\n * Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be always\n * returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving bigNumberStrings\n * disabled will return big numbers as String objects only when they cannot be accurately represented with\n * [JavaScript Number objects](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5) (which happens when they exceed the [-2^53, +2^53] range),\n * otherwise they will be returned as Number objects. This option is ignored if supportBigNumbers is disabled.\n */\n readonly bigNumberStrings?: boolean\n\n /**\n * Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript Date objects.\n * Can be true/false or an array of type names to keep as strings.\n */\n readonly dateStrings?: boolean | string[]\n\n /**\n * Prints protocol details to stdout. Can be true/false or an array of packet type names that should be printed.\n * (Default: false)\n */\n readonly debug?: boolean | string[]\n\n /**\n * Generates stack traces on Error to include call site of library entrance (\"long stack traces\").\n * Slight performance penalty for most calls. (Default: true)\n */\n readonly trace?: boolean\n\n /**\n * Allow multiple mysql statements per query. Be careful with this, it could increase the scope of SQL injection attacks.\n * (Default: false)\n */\n readonly multipleStatements?: boolean\n\n /**\n * Use spatial functions like GeomFromText and AsText which are removed in MySQL 8.\n * (Default: true)\n */\n readonly legacySpatialSupport?: boolean\n\n /**\n * List of connection flags to use other than the default ones. It is also possible to blacklist default ones.\n * For more information, check https://github.com/mysqljs/mysql#connection-flags.\n */\n readonly flags?: string[]\n\n /**\n * TypeORM will automatically use package found in your node_modules, prioritizing mysql over mysql2,\n * but you can specify it manually\n */\n readonly connectorPackage?: \"mysql\" | \"mysql2\"\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: MysqlConnectionCredentialsOptions\n\n /**\n * List of read-from
|
|
1
|
+
{"version":3,"sources":["../../src/driver/mysql/MysqlConnectionOptions.ts"],"names":[],"mappings":"","file":"MysqlConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { MysqlConnectionCredentialsOptions } from \"./MysqlConnectionCredentialsOptions\"\n\n/**\n * MySQL specific connection options.\n *\n * @see https://github.com/mysqljs/mysql#connection-options\n */\nexport interface MysqlConnectionOptions\n extends BaseDataSourceOptions,\n MysqlConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"mysql\" | \"mariadb\"\n\n /**\n * The driver object\n * This defaults to require(\"mysql\").\n * Falls back to require(\"mysql2\")\n */\n readonly driver?: any\n\n /**\n * The charset for the connection. This is called \"collation\" in the SQL-level of MySQL (like utf8_general_ci).\n * If a SQL-level charset is specified (like utf8mb4) then the default collation for that charset is used.\n * Default: 'UTF8_GENERAL_CI'\n */\n readonly charset?: string\n\n /**\n * The timezone configured on the MySQL server.\n * This is used to type cast server date/time values to JavaScript Date object and vice versa.\n * This can be 'local', 'Z', or an offset in the form +HH:MM or -HH:MM. (Default: 'local')\n */\n readonly timezone?: string\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10000)\n */\n readonly connectTimeout?: number\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10000)\n * This difference between connectTimeout and acquireTimeout is subtle and is described in the mysqljs/mysql docs\n * https://github.com/mysqljs/mysql/tree/master#pool-options\n */\n readonly acquireTimeout?: number\n\n /**\n * Allow connecting to MySQL instances that ask for the old (insecure) authentication method. (Default: false)\n */\n readonly insecureAuth?: boolean\n\n /**\n * When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option (Default: false)\n */\n readonly supportBigNumbers?: boolean\n\n /**\n * Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be always\n * returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving bigNumberStrings\n * disabled will return big numbers as String objects only when they cannot be accurately represented with\n * [JavaScript Number objects](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5) (which happens when they exceed the [-2^53, +2^53] range),\n * otherwise they will be returned as Number objects. This option is ignored if supportBigNumbers is disabled.\n */\n readonly bigNumberStrings?: boolean\n\n /**\n * Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript Date objects.\n * Can be true/false or an array of type names to keep as strings.\n */\n readonly dateStrings?: boolean | string[]\n\n /**\n * Prints protocol details to stdout. Can be true/false or an array of packet type names that should be printed.\n * (Default: false)\n */\n readonly debug?: boolean | string[]\n\n /**\n * Generates stack traces on Error to include call site of library entrance (\"long stack traces\").\n * Slight performance penalty for most calls. (Default: true)\n */\n readonly trace?: boolean\n\n /**\n * Allow multiple mysql statements per query. Be careful with this, it could increase the scope of SQL injection attacks.\n * (Default: false)\n */\n readonly multipleStatements?: boolean\n\n /**\n * Use spatial functions like GeomFromText and AsText which are removed in MySQL 8.\n * (Default: true)\n */\n readonly legacySpatialSupport?: boolean\n\n /**\n * List of connection flags to use other than the default ones. It is also possible to blacklist default ones.\n * For more information, check https://github.com/mysqljs/mysql#connection-flags.\n */\n readonly flags?: string[]\n\n /**\n * TypeORM will automatically use package found in your node_modules, prioritizing mysql over mysql2,\n * but you can specify it manually\n */\n readonly connectorPackage?: \"mysql\" | \"mysql2\"\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: MysqlConnectionCredentialsOptions\n\n /**\n * List of read-from servers (slaves).\n */\n readonly slaves: MysqlConnectionCredentialsOptions[]\n\n /**\n * If true, PoolCluster will attempt to reconnect when connection fails. (Default: true)\n */\n readonly canRetry?: boolean\n\n /**\n * If connection fails, node's errorCount increases.\n * When errorCount is greater than removeNodeErrorCount, remove a node in the PoolCluster. (Default: 5)\n */\n readonly removeNodeErrorCount?: number\n\n /**\n * If connection fails, specifies the number of milliseconds before another connection attempt will be made.\n * If set to 0, then node will be removed instead and never re-used. (Default: 0)\n */\n readonly restoreNodeTimeout?: number\n\n /**\n * Determines how slaves are selected:\n * RR: Select one alternately (Round-Robin).\n * RANDOM: Select the node by random function.\n * ORDER: Select the first node available unconditionally.\n */\n readonly selector?: \"RR\" | \"RANDOM\" | \"ORDER\"\n\n /**\n * Default connection pool to use for SELECT queries\n * @default \"slave\"\n */\n readonly defaultMode?: ReplicationMode\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/oracle/OracleConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"OracleConnectionCredentialsOptions.js","sourcesContent":["/**\n * Oracle specific connection credential options.\n */\nexport interface OracleConnectionCredentialsOptions {\n /**\n * Connection url where
|
|
1
|
+
{"version":3,"sources":["../../src/driver/oracle/OracleConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"OracleConnectionCredentialsOptions.js","sourcesContent":["/**\n * Oracle specific connection credential options.\n */\nexport interface OracleConnectionCredentialsOptions {\n /**\n * Connection url where the connection is performed.\n */\n readonly url?: string\n\n /**\n * Database host.\n */\n readonly host?: 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 * Connection SID.\n */\n readonly sid?: string\n\n /**\n * Connection Service Name.\n */\n readonly serviceName?: string\n\n /**\n * Embedded TNS Connection String\n */\n readonly connectString?: string\n}\n"],"sourceRoot":"../.."}
|
|
@@ -44,7 +44,7 @@ export interface OracleConnectionOptions extends BaseDataSourceOptions, OracleCo
|
|
|
44
44
|
*/
|
|
45
45
|
readonly master: OracleConnectionCredentialsOptions;
|
|
46
46
|
/**
|
|
47
|
-
* List of read-from
|
|
47
|
+
* List of read-from servers (slaves).
|
|
48
48
|
*/
|
|
49
49
|
readonly slaves: OracleConnectionCredentialsOptions[];
|
|
50
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/oracle/OracleConnectionOptions.ts"],"names":[],"mappings":"","file":"OracleConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { OracleConnectionCredentialsOptions } from \"./OracleConnectionCredentialsOptions\"\n\nexport interface OracleThickModeOptions {\n binaryDir?: string\n configDir?: string\n driverName?: string\n errorUrl?: string\n libDir?: string\n}\n\n/**\n * Oracle-specific connection options.\n */\nexport interface OracleConnectionOptions\n extends BaseDataSourceOptions,\n OracleConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"oracle\"\n\n /**\n * Schema name. By default is \"public\".\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to require(\"oracledb\")\n */\n readonly driver?: any\n\n /**\n * Utilize the thick driver. Starting from oracledb version 6, it's necessary to set this to true when opting for the thick client usage.\n * Alternatively, an 'OracleThickModeOptions' object can be configured, which is used for the thick mode configuration by passing it to the 'node-oracledb' driver.\n * For additional information, refer to the details provided in the following link:\n * (https://node-oracledb.readthedocs.io/en/latest/api_manual/oracledb.html#oracledb.initOracleClient)\n */\n readonly thickMode?: boolean | OracleThickModeOptions\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: false).\n */\n readonly useUTC?: boolean\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: OracleConnectionCredentialsOptions\n\n /**\n * List of read-from
|
|
1
|
+
{"version":3,"sources":["../../src/driver/oracle/OracleConnectionOptions.ts"],"names":[],"mappings":"","file":"OracleConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { OracleConnectionCredentialsOptions } from \"./OracleConnectionCredentialsOptions\"\n\nexport interface OracleThickModeOptions {\n binaryDir?: string\n configDir?: string\n driverName?: string\n errorUrl?: string\n libDir?: string\n}\n\n/**\n * Oracle-specific connection options.\n */\nexport interface OracleConnectionOptions\n extends BaseDataSourceOptions,\n OracleConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"oracle\"\n\n /**\n * Schema name. By default is \"public\".\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to require(\"oracledb\")\n */\n readonly driver?: any\n\n /**\n * Utilize the thick driver. Starting from oracledb version 6, it's necessary to set this to true when opting for the thick client usage.\n * Alternatively, an 'OracleThickModeOptions' object can be configured, which is used for the thick mode configuration by passing it to the 'node-oracledb' driver.\n * For additional information, refer to the details provided in the following link:\n * (https://node-oracledb.readthedocs.io/en/latest/api_manual/oracledb.html#oracledb.initOracleClient)\n */\n readonly thickMode?: boolean | OracleThickModeOptions\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: false).\n */\n readonly useUTC?: boolean\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: OracleConnectionCredentialsOptions\n\n /**\n * List of read-from servers (slaves).\n */\n readonly slaves: OracleConnectionCredentialsOptions[]\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/postgres/PostgresConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"PostgresConnectionCredentialsOptions.js","sourcesContent":["import { TlsOptions } from \"tls\"\n\n/**\n * Postgres specific connection credential options.\n */\nexport interface PostgresConnectionCredentialsOptions {\n /**\n * Connection url where
|
|
1
|
+
{"version":3,"sources":["../../src/driver/postgres/PostgresConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"PostgresConnectionCredentialsOptions.js","sourcesContent":["import { TlsOptions } from \"tls\"\n\n/**\n * Postgres specific connection credential options.\n */\nexport interface PostgresConnectionCredentialsOptions {\n /**\n * Connection url where the connection is performed.\n */\n readonly url?: string\n\n /**\n * Database host.\n */\n readonly host?: 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 | (() => string) | (() => Promise<string>)\n\n /**\n * Database name to connect to.\n */\n readonly database?: string\n\n /**\n * Object with ssl parameters\n */\n readonly ssl?: boolean | TlsOptions\n\n /**\n * sets the application_name var to help db administrators identify\n * the service using this connection. Defaults to 'undefined'\n */\n readonly applicationName?: string\n}\n"],"sourceRoot":"../.."}
|
|
@@ -36,7 +36,7 @@ export interface PostgresConnectionOptions extends BaseDataSourceOptions, Postgr
|
|
|
36
36
|
*/
|
|
37
37
|
readonly master: PostgresConnectionCredentialsOptions;
|
|
38
38
|
/**
|
|
39
|
-
* List of read-from
|
|
39
|
+
* List of read-from servers (slaves).
|
|
40
40
|
*/
|
|
41
41
|
readonly slaves: PostgresConnectionCredentialsOptions[];
|
|
42
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/postgres/PostgresConnectionOptions.ts"],"names":[],"mappings":"","file":"PostgresConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { PostgresConnectionCredentialsOptions } from \"./PostgresConnectionCredentialsOptions\"\n\n/**\n * Postgres-specific connection options.\n */\nexport interface PostgresConnectionOptions\n extends BaseDataSourceOptions,\n PostgresConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"postgres\"\n\n /**\n * Schema name.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"pg\")`.\n */\n readonly driver?: any\n\n /**\n * The driver object\n * This defaults to `require(\"pg-native\")`.\n */\n readonly nativeDriver?: any\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: false).\n */\n readonly useUTC?: boolean\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: PostgresConnectionCredentialsOptions\n\n /**\n * List of read-from
|
|
1
|
+
{"version":3,"sources":["../../src/driver/postgres/PostgresConnectionOptions.ts"],"names":[],"mappings":"","file":"PostgresConnectionOptions.js","sourcesContent":["import { BaseDataSourceOptions } from \"../../data-source/BaseDataSourceOptions\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { PostgresConnectionCredentialsOptions } from \"./PostgresConnectionCredentialsOptions\"\n\n/**\n * Postgres-specific connection options.\n */\nexport interface PostgresConnectionOptions\n extends BaseDataSourceOptions,\n PostgresConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"postgres\"\n\n /**\n * Schema name.\n */\n readonly schema?: string\n\n /**\n * The driver object\n * This defaults to `require(\"pg\")`.\n */\n readonly driver?: any\n\n /**\n * The driver object\n * This defaults to `require(\"pg-native\")`.\n */\n readonly nativeDriver?: any\n\n /**\n * A boolean determining whether to pass time values in UTC or local time. (default: false).\n */\n readonly useUTC?: boolean\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: PostgresConnectionCredentialsOptions\n\n /**\n * List of read-from servers (slaves).\n */\n readonly slaves: PostgresConnectionCredentialsOptions[]\n\n /**\n * Default connection pool to use for SELECT queries\n * @default \"slave\"\n */\n readonly defaultMode?: ReplicationMode\n }\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the postgres\n * server. If undefined, or set to 0, there is no timeout. Defaults to undefined.\n */\n readonly connectTimeoutMS?: number\n\n /**\n * The Postgres extension to use to generate UUID columns. Defaults to uuid-ossp.\n * If pgcrypto is selected, TypeORM will use the gen_random_uuid() function from this extension.\n * If uuid-ossp is selected, TypeORM will use the uuid_generate_v4() function from this extension.\n */\n readonly uuidExtension?: \"pgcrypto\" | \"uuid-ossp\"\n\n /*\n * Function handling errors thrown by drivers pool.\n * Defaults to logging error with `warn` level.\n */\n readonly poolErrorHandler?: (err: any) => any\n\n /**\n * Include notification messages from Postgres server in client logs\n */\n readonly logNotifications?: boolean\n\n /**\n * Automatically install postgres extensions\n */\n readonly installExtensions?: boolean\n\n /**\n * Return 64-bit integers (int8) as JavaScript integers.\n *\n * Because JavaScript doesn't have support for 64-bit integers node-postgres cannot confidently\n * parse int8 data type results as numbers because if you have a huge number it will overflow\n * and the result you'd get back from node-postgres would not be the result in the database.\n * That would be a very bad thing so node-postgres just returns int8 results as strings and leaves the parsing up to you.\n *\n * Enabling parseInt8 will cause node-postgres to parse int8 results as numbers.\n * Note: the maximum safe integer in js is: Number.MAX_SAFE_INTEGER (`+2^53`)\n *\n * @see [JavaScript Number objects](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5)\n * @see [node-postgres int8 explanation](https://github.com/brianc/node-pg-types#:~:text=on%20projects%3A%20return-,64%2Dbit%20integers,-(int8)%20as)\n * @see [node-postgres defaults.parseInt8 implementation](https://github.com/brianc/node-postgres/blob/pg%408.8.0/packages/pg/lib/defaults.js#L80)\n */\n readonly parseInt8?: boolean\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/spanner/SpannerConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"SpannerConnectionCredentialsOptions.js","sourcesContent":["/**\n * Spanner specific connection credential options.\n */\nexport interface SpannerConnectionCredentialsOptions {\n /**\n * Connection url where
|
|
1
|
+
{"version":3,"sources":["../../src/driver/spanner/SpannerConnectionCredentialsOptions.ts"],"names":[],"mappings":"","file":"SpannerConnectionCredentialsOptions.js","sourcesContent":["/**\n * Spanner specific connection credential options.\n */\nexport interface SpannerConnectionCredentialsOptions {\n /**\n * Connection url where the connection is performed.\n */\n readonly instanceId?: string\n\n /**\n * Database host.\n */\n readonly projectId?: string\n\n /**\n * Database host port.\n */\n readonly databaseId?: string\n}\n"],"sourceRoot":"../.."}
|
|
@@ -93,7 +93,7 @@ export interface SpannerConnectionOptions extends BaseConnectionOptions, Spanner
|
|
|
93
93
|
*/
|
|
94
94
|
readonly master: SpannerConnectionCredentialsOptions;
|
|
95
95
|
/**
|
|
96
|
-
* List of read-from
|
|
96
|
+
* List of read-from servers (slaves).
|
|
97
97
|
*/
|
|
98
98
|
readonly slaves: SpannerConnectionCredentialsOptions[];
|
|
99
99
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/spanner/SpannerConnectionOptions.ts"],"names":[],"mappings":"","file":"SpannerConnectionOptions.js","sourcesContent":["import { BaseConnectionOptions } from \"../../connection/BaseConnectionOptions\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { SpannerConnectionCredentialsOptions } from \"./SpannerConnectionCredentialsOptions\"\n\n/**\n * Spanner specific connection options.\n */\nexport interface SpannerConnectionOptions\n extends BaseConnectionOptions,\n SpannerConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"spanner\"\n\n /**\n * The driver object\n * This defaults to require(\"@google-cloud/spanner\").\n */\n readonly driver?: any\n\n // todo\n readonly database?: string\n\n // todo\n readonly schema?: string\n\n /**\n * The charset for the connection. This is called \"collation\" in the SQL-level of MySQL (like utf8_general_ci).\n * If a SQL-level charset is specified (like utf8mb4) then the default collation for that charset is used.\n * Default: 'UTF8_GENERAL_CI'\n */\n readonly charset?: string\n\n /**\n * The timezone configured on the MySQL server.\n * This is used to type cast server date/time values to JavaScript Date object and vice versa.\n * This can be 'local', 'Z', or an offset in the form +HH:MM or -HH:MM. (Default: 'local')\n */\n readonly timezone?: string\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10000)\n */\n readonly connectTimeout?: number\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10000)\n * This difference between connectTimeout and acquireTimeout is subtle and is described in the mysqljs/mysql docs\n * https://github.com/mysqljs/mysql/tree/master#pool-options\n */\n readonly acquireTimeout?: number\n\n /**\n * Allow connecting to MySQL instances that ask for the old (insecure) authentication method. (Default: false)\n */\n readonly insecureAuth?: boolean\n\n /**\n * When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option (Default: false)\n */\n readonly supportBigNumbers?: boolean\n\n /**\n * Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be always\n * returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving bigNumberStrings\n * disabled will return big numbers as String objects only when they cannot be accurately represented with\n * [JavaScript Number objects](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5) (which happens when they exceed the [-2^53, +2^53] range),\n * otherwise they will be returned as Number objects. This option is ignored if supportBigNumbers is disabled.\n */\n readonly bigNumberStrings?: boolean\n\n /**\n * Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript Date objects.\n * Can be true/false or an array of type names to keep as strings.\n */\n readonly dateStrings?: boolean | string[]\n\n /**\n * Prints protocol details to stdout. Can be true/false or an array of packet type names that should be printed.\n * (Default: false)\n */\n readonly debug?: boolean | string[]\n\n /**\n * Generates stack traces on Error to include call site of library entrance (\"long stack traces\").\n * Slight performance penalty for most calls. (Default: true)\n */\n readonly trace?: boolean\n\n /**\n * Allow multiple mysql statements per query. Be careful with this, it could increase the scope of SQL injection attacks.\n * (Default: false)\n */\n readonly multipleStatements?: boolean\n\n /**\n * Use spatial functions like GeomFromText and AsText which are removed in MySQL 8.\n * (Default: true)\n */\n readonly legacySpatialSupport?: boolean\n\n /**\n * List of connection flags to use other than the default ones. It is also possible to blacklist default ones.\n * For more information, check https://github.com/mysqljs/mysql#connection-flags.\n */\n readonly flags?: string[]\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: SpannerConnectionCredentialsOptions\n\n /**\n * List of read-from
|
|
1
|
+
{"version":3,"sources":["../../src/driver/spanner/SpannerConnectionOptions.ts"],"names":[],"mappings":"","file":"SpannerConnectionOptions.js","sourcesContent":["import { BaseConnectionOptions } from \"../../connection/BaseConnectionOptions\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { SpannerConnectionCredentialsOptions } from \"./SpannerConnectionCredentialsOptions\"\n\n/**\n * Spanner specific connection options.\n */\nexport interface SpannerConnectionOptions\n extends BaseConnectionOptions,\n SpannerConnectionCredentialsOptions {\n /**\n * Database type.\n */\n readonly type: \"spanner\"\n\n /**\n * The driver object\n * This defaults to require(\"@google-cloud/spanner\").\n */\n readonly driver?: any\n\n // todo\n readonly database?: string\n\n // todo\n readonly schema?: string\n\n /**\n * The charset for the connection. This is called \"collation\" in the SQL-level of MySQL (like utf8_general_ci).\n * If a SQL-level charset is specified (like utf8mb4) then the default collation for that charset is used.\n * Default: 'UTF8_GENERAL_CI'\n */\n readonly charset?: string\n\n /**\n * The timezone configured on the MySQL server.\n * This is used to type cast server date/time values to JavaScript Date object and vice versa.\n * This can be 'local', 'Z', or an offset in the form +HH:MM or -HH:MM. (Default: 'local')\n */\n readonly timezone?: string\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10000)\n */\n readonly connectTimeout?: number\n\n /**\n * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10000)\n * This difference between connectTimeout and acquireTimeout is subtle and is described in the mysqljs/mysql docs\n * https://github.com/mysqljs/mysql/tree/master#pool-options\n */\n readonly acquireTimeout?: number\n\n /**\n * Allow connecting to MySQL instances that ask for the old (insecure) authentication method. (Default: false)\n */\n readonly insecureAuth?: boolean\n\n /**\n * When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option (Default: false)\n */\n readonly supportBigNumbers?: boolean\n\n /**\n * Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be always\n * returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving bigNumberStrings\n * disabled will return big numbers as String objects only when they cannot be accurately represented with\n * [JavaScript Number objects](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5) (which happens when they exceed the [-2^53, +2^53] range),\n * otherwise they will be returned as Number objects. This option is ignored if supportBigNumbers is disabled.\n */\n readonly bigNumberStrings?: boolean\n\n /**\n * Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript Date objects.\n * Can be true/false or an array of type names to keep as strings.\n */\n readonly dateStrings?: boolean | string[]\n\n /**\n * Prints protocol details to stdout. Can be true/false or an array of packet type names that should be printed.\n * (Default: false)\n */\n readonly debug?: boolean | string[]\n\n /**\n * Generates stack traces on Error to include call site of library entrance (\"long stack traces\").\n * Slight performance penalty for most calls. (Default: true)\n */\n readonly trace?: boolean\n\n /**\n * Allow multiple mysql statements per query. Be careful with this, it could increase the scope of SQL injection attacks.\n * (Default: false)\n */\n readonly multipleStatements?: boolean\n\n /**\n * Use spatial functions like GeomFromText and AsText which are removed in MySQL 8.\n * (Default: true)\n */\n readonly legacySpatialSupport?: boolean\n\n /**\n * List of connection flags to use other than the default ones. It is also possible to blacklist default ones.\n * For more information, check https://github.com/mysqljs/mysql#connection-flags.\n */\n readonly flags?: string[]\n\n /**\n * Replication setup.\n */\n readonly replication?: {\n /**\n * Master server used by orm to perform writes.\n */\n readonly master: SpannerConnectionCredentialsOptions\n\n /**\n * List of read-from servers (slaves).\n */\n readonly slaves: SpannerConnectionCredentialsOptions[]\n\n /**\n * If true, PoolCluster will attempt to reconnect when connection fails. (Default: true)\n */\n readonly canRetry?: boolean\n\n /**\n * If connection fails, node's errorCount increases.\n * When errorCount is greater than removeNodeErrorCount, remove a node in the PoolCluster. (Default: 5)\n */\n readonly removeNodeErrorCount?: number\n\n /**\n * If connection fails, specifies the number of milliseconds before another connection attempt will be made.\n * If set to 0, then node will be removed instead and never re-used. (Default: 0)\n */\n readonly restoreNodeTimeout?: number\n\n /**\n * Determines how slaves are selected:\n * RR: Select one alternately (Round-Robin).\n * RANDOM: Select the node by random function.\n * ORDER: Select the first node available unconditionally.\n */\n readonly selector?: \"RR\" | \"RANDOM\" | \"ORDER\"\n\n /**\n * Default connection pool to use for SELECT queries\n * @default \"slave\"\n */\n readonly defaultMode?: ReplicationMode\n }\n\n readonly poolSize?: never\n}\n"],"sourceRoot":"../.."}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SqliteDriver = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const promises_1 = tslib_1.__importDefault(require("fs/promises"));
|
|
6
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
7
|
const DriverPackageNotInstalledError_1 = require("../../error/DriverPackageNotInstalledError");
|
|
8
8
|
const SqliteQueryRunner_1 = require("./SqliteQueryRunner");
|
|
@@ -147,7 +147,7 @@ class SqliteDriver extends AbstractSqliteDriver_1.AbstractSqliteDriver {
|
|
|
147
147
|
* Auto creates database directory if it does not exist.
|
|
148
148
|
*/
|
|
149
149
|
async createDatabaseDirectory(fullPath) {
|
|
150
|
-
await
|
|
150
|
+
await promises_1.default.mkdir(path_1.default.dirname(fullPath), { recursive: true });
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
153
|
* Performs the attaching of the database files. The attachedDatabase should have been populated during calls to #buildTableName
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/driver/sqlite/SqliteDriver.ts"],"names":[],"mappings":";;;;AAAA,4DAA2B;AAC3B,wDAAuB;AACvB,+FAA2F;AAC3F,2DAAuD;AACvD,gEAA4D;AAK5D,kFAA8E;AAE9E,oDAAiE;AAEjE;;GAEG;AACH,MAAa,YAAa,SAAQ,2CAAoB;IAelD,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,YAAY,UAAsB;QAC9B,KAAK,CAAC,UAAU,CAAC,CAAA;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,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,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAC5C,CAAA;IACL,CAAC;CACJ;AA3ND,oCA2NC","file":"SqliteDriver.js","sourcesContent":["import mkdirp from \"mkdirp\"\nimport path from \"path\"\nimport { DriverPackageNotInstalledError } from \"../../error/DriverPackageNotInstalledError\"\nimport { SqliteQueryRunner } from \"./SqliteQueryRunner\"\nimport { PlatformTools } from \"../../platform/PlatformTools\"\nimport { DataSource } from \"../../data-source/DataSource\"\nimport { SqliteConnectionOptions } from \"./SqliteConnectionOptions\"\nimport { ColumnType } from \"../types/ColumnTypes\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { AbstractSqliteDriver } from \"../sqlite-abstract/AbstractSqliteDriver\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { filepathToName, isAbsolute } from \"../../util/PathUtils\"\n\n/**\n * Organizes communication with sqlite DBMS.\n */\nexport class SqliteDriver extends AbstractSqliteDriver {\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection options.\n */\n options: SqliteConnectionOptions\n\n /**\n * SQLite underlying library.\n */\n sqlite: any\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(connection: DataSource) {\n super(connection)\n this.connection = connection\n this.options = connection.options as SqliteConnectionOptions\n this.database = this.options.database\n\n // load sqlite package\n this.loadDependencies()\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Closes connection with database.\n */\n async disconnect(): Promise<void> {\n return new Promise<void>((ok, fail) => {\n this.queryRunner = undefined\n this.databaseConnection.close((err: any) =>\n err ? fail(err) : ok(),\n )\n })\n }\n\n /**\n * Creates a query runner used to execute database queries.\n */\n createQueryRunner(mode: ReplicationMode): QueryRunner {\n if (!this.queryRunner) this.queryRunner = new SqliteQueryRunner(this)\n\n return this.queryRunner\n }\n\n normalizeType(column: {\n type?: ColumnType\n length?: number | string\n precision?: number | null\n scale?: number\n }): string {\n if ((column.type as any) === Buffer) {\n return \"blob\"\n }\n\n return super.normalizeType(column)\n }\n\n async afterConnect(): Promise<void> {\n return this.attachDatabases()\n }\n\n /**\n * For SQLite, the database may be added in the decorator metadata. It will be a filepath to a database file.\n */\n buildTableName(\n tableName: string,\n _schema?: string,\n database?: string,\n ): string {\n if (!database) return tableName\n if (this.getAttachedDatabaseHandleByRelativePath(database))\n return `${this.getAttachedDatabaseHandleByRelativePath(\n database,\n )}.${tableName}`\n\n if (database === this.options.database) return tableName\n\n // we use the decorated name as supplied when deriving attach handle (ideally without non-portable absolute path)\n const identifierHash = filepathToName(database)\n // decorated name will be assumed relative to main database file when non absolute. Paths supplied as absolute won't be portable\n const absFilepath = isAbsolute(database)\n ? database\n : path.join(this.getMainDatabasePath(), database)\n\n this.attachedDatabases[database] = {\n attachFilepathAbsolute: absFilepath,\n attachFilepathRelative: database,\n attachHandle: identifierHash,\n }\n\n return `${identifierHash}.${tableName}`\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates connection with the database.\n */\n protected async createDatabaseConnection() {\n if (\n this.options.flags === undefined ||\n !(this.options.flags & this.sqlite.OPEN_URI)\n ) {\n await this.createDatabaseDirectory(this.options.database)\n }\n\n const databaseConnection: any = await new Promise((ok, fail) => {\n if (this.options.flags === undefined) {\n const connection = new this.sqlite.Database(\n this.options.database,\n (err: any) => {\n if (err) return fail(err)\n ok(connection)\n },\n )\n } else {\n const connection = new this.sqlite.Database(\n this.options.database,\n this.options.flags,\n (err: any) => {\n if (err) return fail(err)\n ok(connection)\n },\n )\n }\n })\n\n // Internal function to run a command on the connection and fail if an error occured.\n function run(line: string): Promise<void> {\n return new Promise((ok, fail) => {\n databaseConnection.run(line, (err: any) => {\n if (err) return fail(err)\n ok()\n })\n })\n }\n // in the options, if encryption key for SQLCipher is setted.\n // Must invoke key pragma before trying to do any other interaction with the database.\n if (this.options.key) {\n await run(`PRAGMA key = ${JSON.stringify(this.options.key)}`)\n }\n\n if (this.options.enableWAL) {\n await run(`PRAGMA journal_mode = WAL`)\n }\n\n if (\n this.options.busyTimeout &&\n typeof this.options.busyTimeout === \"number\" &&\n this.options.busyTimeout > 0\n ) {\n await run(`PRAGMA busy_timeout = ${this.options.busyTimeout}`)\n }\n\n // we need to enable foreign keys in sqlite to make sure all foreign key related features\n // working properly. this also makes onDelete to work with sqlite.\n await run(`PRAGMA foreign_keys = ON`)\n\n return databaseConnection\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 sqlite = this.options.driver || PlatformTools.load(\"sqlite3\")\n this.sqlite = sqlite.verbose()\n } catch (e) {\n throw new DriverPackageNotInstalledError(\"SQLite\", \"sqlite3\")\n }\n }\n\n /**\n * Auto creates database directory if it does not exist.\n */\n protected async createDatabaseDirectory(fullPath: string): Promise<void> {\n await mkdirp(path.dirname(fullPath))\n }\n\n /**\n * Performs the attaching of the database files. The attachedDatabase should have been populated during calls to #buildTableName\n * during EntityMetadata production (see EntityMetadata#buildTablePath)\n *\n * https://sqlite.org/lang_attach.html\n */\n protected async attachDatabases() {\n // @todo - possibly check number of databases (but unqueriable at runtime sadly) - https://www.sqlite.org/limits.html#max_attached\n for await (const {\n attachHandle,\n attachFilepathAbsolute,\n } of Object.values(this.attachedDatabases)) {\n await this.createDatabaseDirectory(attachFilepathAbsolute)\n await this.connection.query(\n `ATTACH \"${attachFilepathAbsolute}\" AS \"${attachHandle}\"`,\n )\n }\n }\n\n protected getMainDatabasePath(): string {\n const optionsDb = this.options.database\n return path.dirname(\n isAbsolute(optionsDb)\n ? optionsDb\n : path.join(process.cwd(), optionsDb),\n )\n }\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../src/driver/sqlite/SqliteDriver.ts"],"names":[],"mappings":";;;;AAAA,mEAA4B;AAC5B,wDAAuB;AACvB,+FAA2F;AAC3F,2DAAuD;AACvD,gEAA4D;AA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,UAAU,CAAC,KAAK,CACvB,WAAW,sBAAsB,SAAS,YAAY,GAAG,CAC5D,CAAA;QACL,CAAC;IACL,CAAC;IAES,mBAAmB;QACzB,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAA;QACvC,OAAO,cAAI,CAAC,OAAO,CACf,IAAA,sBAAU,EAAC,SAAS,CAAC;YACjB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAC5C,CAAA;IACL,CAAC;CACJ;AA3ND,oCA2NC","file":"SqliteDriver.js","sourcesContent":["import fs from \"fs/promises\"\nimport path from \"path\"\nimport { DriverPackageNotInstalledError } from \"../../error/DriverPackageNotInstalledError\"\nimport { SqliteQueryRunner } from \"./SqliteQueryRunner\"\nimport { PlatformTools } from \"../../platform/PlatformTools\"\nimport { DataSource } from \"../../data-source/DataSource\"\nimport { SqliteConnectionOptions } from \"./SqliteConnectionOptions\"\nimport { ColumnType } from \"../types/ColumnTypes\"\nimport { QueryRunner } from \"../../query-runner/QueryRunner\"\nimport { AbstractSqliteDriver } from \"../sqlite-abstract/AbstractSqliteDriver\"\nimport { ReplicationMode } from \"../types/ReplicationMode\"\nimport { filepathToName, isAbsolute } from \"../../util/PathUtils\"\n\n/**\n * Organizes communication with sqlite DBMS.\n */\nexport class SqliteDriver extends AbstractSqliteDriver {\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection options.\n */\n options: SqliteConnectionOptions\n\n /**\n * SQLite underlying library.\n */\n sqlite: any\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(connection: DataSource) {\n super(connection)\n this.connection = connection\n this.options = connection.options as SqliteConnectionOptions\n this.database = this.options.database\n\n // load sqlite package\n this.loadDependencies()\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Closes connection with database.\n */\n async disconnect(): Promise<void> {\n return new Promise<void>((ok, fail) => {\n this.queryRunner = undefined\n this.databaseConnection.close((err: any) =>\n err ? fail(err) : ok(),\n )\n })\n }\n\n /**\n * Creates a query runner used to execute database queries.\n */\n createQueryRunner(mode: ReplicationMode): QueryRunner {\n if (!this.queryRunner) this.queryRunner = new SqliteQueryRunner(this)\n\n return this.queryRunner\n }\n\n normalizeType(column: {\n type?: ColumnType\n length?: number | string\n precision?: number | null\n scale?: number\n }): string {\n if ((column.type as any) === Buffer) {\n return \"blob\"\n }\n\n return super.normalizeType(column)\n }\n\n async afterConnect(): Promise<void> {\n return this.attachDatabases()\n }\n\n /**\n * For SQLite, the database may be added in the decorator metadata. It will be a filepath to a database file.\n */\n buildTableName(\n tableName: string,\n _schema?: string,\n database?: string,\n ): string {\n if (!database) return tableName\n if (this.getAttachedDatabaseHandleByRelativePath(database))\n return `${this.getAttachedDatabaseHandleByRelativePath(\n database,\n )}.${tableName}`\n\n if (database === this.options.database) return tableName\n\n // we use the decorated name as supplied when deriving attach handle (ideally without non-portable absolute path)\n const identifierHash = filepathToName(database)\n // decorated name will be assumed relative to main database file when non absolute. Paths supplied as absolute won't be portable\n const absFilepath = isAbsolute(database)\n ? database\n : path.join(this.getMainDatabasePath(), database)\n\n this.attachedDatabases[database] = {\n attachFilepathAbsolute: absFilepath,\n attachFilepathRelative: database,\n attachHandle: identifierHash,\n }\n\n return `${identifierHash}.${tableName}`\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates connection with the database.\n */\n protected async createDatabaseConnection() {\n if (\n this.options.flags === undefined ||\n !(this.options.flags & this.sqlite.OPEN_URI)\n ) {\n await this.createDatabaseDirectory(this.options.database)\n }\n\n const databaseConnection: any = await new Promise((ok, fail) => {\n if (this.options.flags === undefined) {\n const connection = new this.sqlite.Database(\n this.options.database,\n (err: any) => {\n if (err) return fail(err)\n ok(connection)\n },\n )\n } else {\n const connection = new this.sqlite.Database(\n this.options.database,\n this.options.flags,\n (err: any) => {\n if (err) return fail(err)\n ok(connection)\n },\n )\n }\n })\n\n // Internal function to run a command on the connection and fail if an error occured.\n function run(line: string): Promise<void> {\n return new Promise((ok, fail) => {\n databaseConnection.run(line, (err: any) => {\n if (err) return fail(err)\n ok()\n })\n })\n }\n // in the options, if encryption key for SQLCipher is setted.\n // Must invoke key pragma before trying to do any other interaction with the database.\n if (this.options.key) {\n await run(`PRAGMA key = ${JSON.stringify(this.options.key)}`)\n }\n\n if (this.options.enableWAL) {\n await run(`PRAGMA journal_mode = WAL`)\n }\n\n if (\n this.options.busyTimeout &&\n typeof this.options.busyTimeout === \"number\" &&\n this.options.busyTimeout > 0\n ) {\n await run(`PRAGMA busy_timeout = ${this.options.busyTimeout}`)\n }\n\n // we need to enable foreign keys in sqlite to make sure all foreign key related features\n // working properly. this also makes onDelete to work with sqlite.\n await run(`PRAGMA foreign_keys = ON`)\n\n return databaseConnection\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 sqlite = this.options.driver || PlatformTools.load(\"sqlite3\")\n this.sqlite = sqlite.verbose()\n } catch (e) {\n throw new DriverPackageNotInstalledError(\"SQLite\", \"sqlite3\")\n }\n }\n\n /**\n * Auto creates database directory if it does not exist.\n */\n protected async createDatabaseDirectory(fullPath: string): Promise<void> {\n await fs.mkdir(path.dirname(fullPath), { recursive: true })\n }\n\n /**\n * Performs the attaching of the database files. The attachedDatabase should have been populated during calls to #buildTableName\n * during EntityMetadata production (see EntityMetadata#buildTablePath)\n *\n * https://sqlite.org/lang_attach.html\n */\n protected async attachDatabases() {\n // @todo - possibly check number of databases (but unqueriable at runtime sadly) - https://www.sqlite.org/limits.html#max_attached\n for await (const {\n attachHandle,\n attachFilepathAbsolute,\n } of Object.values(this.attachedDatabases)) {\n await this.createDatabaseDirectory(attachFilepathAbsolute)\n await this.connection.query(\n `ATTACH \"${attachFilepathAbsolute}\" AS \"${attachHandle}\"`,\n )\n }\n }\n\n protected getMainDatabasePath(): string {\n const optionsDb = this.options.database\n return path.dirname(\n isAbsolute(optionsDb)\n ? optionsDb\n : path.join(process.cwd(), optionsDb),\n )\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -12,7 +12,7 @@ export type SqlServerConnectionCredentialsAuthenticationOptions = DefaultAuthent
|
|
|
12
12
|
*/
|
|
13
13
|
export interface SqlServerConnectionCredentialsOptions {
|
|
14
14
|
/**
|
|
15
|
-
* Connection url where
|
|
15
|
+
* Connection url where the connection is performed.
|
|
16
16
|
*/
|
|
17
17
|
readonly url?: string;
|
|
18
18
|
/**
|