typeorm 0.2.40-dev.41ee95c → 0.2.40-dev.969af95
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 +0 -3
- package/browser/decorator/columns/PrimaryGeneratedColumn.d.ts +1 -0
- package/browser/decorator/columns/PrimaryGeneratedColumn.js +1 -1
- package/browser/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/browser/decorator/options/ColumnCommonOptions.d.ts +1 -1
- package/browser/decorator/options/ColumnCommonOptions.js.map +1 -1
- package/browser/driver/mysql/MysqlDriver.js +6 -3
- package/browser/driver/mysql/MysqlDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +19 -8
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/schema-builder/options/TableColumnOptions.d.ts +1 -1
- package/browser/schema-builder/options/TableColumnOptions.js.map +1 -1
- package/browser/schema-builder/table/TableColumn.d.ts +1 -1
- package/browser/schema-builder/table/TableColumn.js.map +1 -1
- package/decorator/columns/PrimaryGeneratedColumn.d.ts +1 -0
- package/decorator/columns/PrimaryGeneratedColumn.js +1 -1
- package/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/decorator/options/ColumnCommonOptions.d.ts +1 -1
- package/decorator/options/ColumnCommonOptions.js.map +1 -1
- package/driver/mysql/MysqlDriver.js +6 -3
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.js +19 -8
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/package.json +1 -1
- package/schema-builder/options/TableColumnOptions.d.ts +1 -1
- package/schema-builder/options/TableColumnOptions.js.map +1 -1
- package/schema-builder/table/TableColumn.d.ts +1 -1
- package/schema-builder/table/TableColumn.js.map +1 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "name": "typeorm", "private": false, "version": "0.2.40-dev.
|
|
1
|
+
{ "name": "typeorm", "private": false, "version": "0.2.40-dev.969af95", "description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.", "license": "MIT", "readmeFilename": "README.md", "author": { "name": "Umed Khudoiberdiev", "email": "pleerock.me@gmail.com" }, "main": "./index.js", "browser": { "./browser/driver/aurora-data-api/AuroraDataApiDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/cockroachdb/CockroachDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/postgres/PostgresDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/oracle/OracleDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sap/SapDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mysql/MysqlDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlserver/SqlServerDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoQueryRunner.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/entity-manager/MongoEntityManager.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/repository/MongoRepository.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlite/SqliteDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/better-sqlite3/BetterSqlite3Driver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/util/DirectoryExportedClassesLoader.js": "./browser/platform/BrowserDirectoryExportedClassesLoader.js", "./browser/logger/FileLogger.js": "./browser/platform/BrowserFileLoggerDummy.js", "./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsYmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/platform/PlatformTools.js": "./browser/platform/BrowserPlatformTools.js", "./index.js": "./browser/index.js" }, "repository": { "type": "git", "url": "https://github.com/typeorm/typeorm.git" }, "bugs": { "url": "https://github.com/typeorm/typeorm/issues" }, "tags": [ "orm", "typescript", "typescript-orm", "mysql", "mysql-orm", "postgresql", "postgresql-orm", "mariadb", "mariadb-orm", "sqlite", "sqlite-orm", "sql-server", "sql-server-orm", "oracle", "oracle-orm" ], "devDependencies": { "@types/app-root-path": "^1.2.4", "@types/chai": "^4.2.15", "@types/chai-as-promised": "^7.1.3", "@types/debug": "^4.1.5", "@types/dotenv": "^8.2.0", "@types/js-yaml": "^4.0.0", "@types/mkdirp": "^1.0.1", "@types/mocha": "^8.2.1", "@types/node": "^14.14.31", "@types/rimraf": "^3.0.0", "@types/sha.js": "^2.4.0", "@types/sinon": "^9.0.10", "@types/source-map-support": "^0.5.3", "@types/xml2js": "^0.4.8", "@types/yargs": "^17.0.2", "@typescript-eslint/eslint-plugin": "^4.15.2", "@typescript-eslint/parser": "^4.15.2", "better-sqlite3": "^7.1.2", "chai": "^4.3.0", "chai-as-promised": "^7.1.1", "class-transformer": "^0.4.0", "conventional-changelog-angular": "^5.0.12", "conventional-changelog-cli": "^2.1.1", "del": "^6.0.0", "eslint": "^7.20.0", "gulp": "^4.0.2", "gulp-eslint": "^6.0.0", "gulp-istanbul": "^1.1.3", "gulp-mocha": "^8.0.0", "gulp-rename": "^2.0.0", "gulp-replace": "^1.0.0", "gulp-shell": "^0.8.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1", "gulpclass": "^0.2.0", "husky": "^5.1.1", "lint-staged": "^10.5.4", "mocha": "^8.3.0", "mongodb": "^3.6.4", "mssql": "^6.3.1", "mysql": "^2.18.1", "mysql2": "^2.2.5", "oracledb": "^5.1.0", "pg": "^8.5.1", "pg-query-stream": "^4.0.0", "redis": "^3.1.1", "remap-istanbul": "^0.13.0", "rimraf": "^3.0.2", "sinon": "^9.2.4", "sinon-chai": "^3.5.0", "source-map-support": "^0.5.19", "sql.js": "^1.4.0", "sqlite3": "^5.0.2", "ts-node": "^9.1.1", "typeorm-aurora-data-api-driver": "^2.0.0", "typescript": "^4.2.2" }, "peerDependencies": { "@sap/hana-client": "*", "better-sqlite3": "*", "hdb-pool": "*", "ioredis": "*", "mongodb": "^3.6.0", "mssql": "*", "mysql2": "*", "oracledb": "*", "pg": "*", "pg-native": "*", "pg-query-stream": "*", "redis": "*", "sql.js": "*", "sqlite3": "*", "typeorm-aurora-data-api-driver": "*" }, "peerDependenciesMeta": { "@sap/hana-client": { "optional": true }, "better-sqlite3": { "optional": true }, "hdb-pool": { "optional": true }, "ioredis": { "optional": true }, "mongodb": { "optional": true }, "mssql": { "optional": true }, "mysql2": { "optional": true }, "oracledb": { "optional": true }, "pg": { "optional": true }, "pg-native": { "optional": true }, "pg-query-stream": { "optional": true }, "redis": { "optional": true }, "sql.js": { "optional": true }, "sqlite3": { "optional": true }, "typeorm-aurora-data-api-driver": { "optional": true } }, "dependencies": { "@sqltools/formatter": "^1.2.2", "app-root-path": "^3.0.0", "buffer": "^6.0.3", "chalk": "^4.1.0", "cli-highlight": "^2.1.11", "debug": "^4.3.1", "dotenv": "^8.2.0", "glob": "^7.1.6", "js-yaml": "^4.0.0", "mkdirp": "^1.0.4", "reflect-metadata": "^0.1.13", "sha.js": "^2.4.11", "tslib": "^2.1.0", "xml2js": "^0.4.23", "yargs": "^17.0.1", "zen-observable-ts": "^1.0.0" }, "lint-staged": { "*.ts": [ "eslint --fix", "git add" ] }, "scripts": { "test": "rimraf ./build && tsc && mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test", "test-fast": "mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test", "compile": "rimraf ./build && tsc", "watch": "./node_modules/.bin/tsc -w", "package": "gulp package", "pack": "gulp pack", "lint": "eslint -c ./.eslintrc.js src/**/*.ts test/**/*.ts sample/**/*.ts", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1" }, "bin": { "typeorm": "./cli.js" }, "funding": "https://opencollective.com/typeorm", "collective": { "type": "opencollective", "url": "https://opencollective.com/typeorm", "logo": "https://opencollective.com/opencollective/logo.txt" }, "nyc": { "all": true, "cache": false, "exclude": [ "**/*.d.ts" ], "extension": [ ".ts" ], "include": [ "build/compiled/src/**", "src/**" ], "reporter": "json" } }
|
|
@@ -29,7 +29,7 @@ export interface TableColumnOptions {
|
|
|
29
29
|
/**
|
|
30
30
|
* Specifies generation strategy if this column will use auto increment.
|
|
31
31
|
*/
|
|
32
|
-
generationStrategy?: "uuid" | "increment" | "rowid";
|
|
32
|
+
generationStrategy?: "uuid" | "increment" | "rowid" | "identity";
|
|
33
33
|
/**
|
|
34
34
|
* Indicates if column is a primary key.
|
|
35
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema-builder/options/TableColumnOptions.ts"],"names":[],"mappings":"","file":"TableColumnOptions.js","sourcesContent":["\n/**\n * Table's column options.\n */\nexport interface TableColumnOptions {\n\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Column name.\n */\n name: string;\n\n /**\n * Column type.\n */\n type: string;\n\n /**\n * Column's default value.\n */\n default?: any;\n\n /**\n * ON UPDATE trigger. Works only for MySQL.\n */\n onUpdate?: string;\n\n /**\n * Indicates if column is NULL, or is NOT NULL in the database.\n */\n isNullable?: boolean;\n\n /**\n * Indicates if column is auto-generated sequence.\n */\n isGenerated?: boolean;\n\n /**\n * Specifies generation strategy if this column will use auto increment.\n */\n generationStrategy?: \"uuid\"|\"increment\"|\"rowid\";\n\n /**\n * Indicates if column is a primary key.\n */\n isPrimary?: boolean;\n\n /**\n * Indicates if column has unique value.\n */\n isUnique?: boolean;\n\n /**\n * Indicates if column stores array.\n */\n isArray?: boolean;\n\n /**\n * Column's comment.\n */\n comment?: string;\n\n /**\n * Column type's length. Used only on some column types.\n * For example type = \"string\" and length = \"100\" means that ORM will create a column with type varchar(100).\n */\n length?: string;\n\n /**\n * Column type's display width. Used only on some column types in MySQL.\n * For example, INT(4) specifies an INT with a display width of four digits.\n */\n width?: number;\n\n /**\n * Defines column character set.\n */\n charset?: string;\n\n /**\n * Defines column collation.\n */\n collation?: string;\n\n /**\n * The precision for a decimal (exact numeric) column (applies only for decimal column), which is the maximum\n * number of digits that are stored for the values.\n */\n precision?: number|null;\n\n /**\n * The scale for a decimal (exact numeric) column (applies only for decimal column), which represents the number\n * of digits to the right of the decimal point and must not be greater than precision.\n */\n scale?: number;\n\n /**\n * Puts ZEROFILL attribute on to numeric column. Works only for MySQL.\n * If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column\n */\n zerofill?: boolean;\n\n /**\n * Puts UNSIGNED attribute on to numeric column. Works only for MySQL.\n */\n unsigned?: boolean;\n\n /**\n * Array of possible enumerated values.\n */\n enum?: string[];\n\n /**\n * Exact name of enum\n */\n enumName?: string;\n\n /**\n * Generated column expression. Supports only in MySQL.\n */\n asExpression?: string;\n\n /**\n * Generated column type. Supports only in MySQL.\n */\n generatedType?: \"VIRTUAL\"|\"STORED\";\n\n /**\n * Spatial Feature Type (Geometry, Point, Polygon, etc.)\n */\n spatialFeatureType?: string;\n\n /**\n * SRID (Spatial Reference ID (EPSG code))\n */\n srid?: number;\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../src/schema-builder/options/TableColumnOptions.ts"],"names":[],"mappings":"","file":"TableColumnOptions.js","sourcesContent":["\n/**\n * Table's column options.\n */\nexport interface TableColumnOptions {\n\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Column name.\n */\n name: string;\n\n /**\n * Column type.\n */\n type: string;\n\n /**\n * Column's default value.\n */\n default?: any;\n\n /**\n * ON UPDATE trigger. Works only for MySQL.\n */\n onUpdate?: string;\n\n /**\n * Indicates if column is NULL, or is NOT NULL in the database.\n */\n isNullable?: boolean;\n\n /**\n * Indicates if column is auto-generated sequence.\n */\n isGenerated?: boolean;\n\n /**\n * Specifies generation strategy if this column will use auto increment.\n */\n generationStrategy?: \"uuid\"|\"increment\"|\"rowid\"|\"identity\";\n\n /**\n * Indicates if column is a primary key.\n */\n isPrimary?: boolean;\n\n /**\n * Indicates if column has unique value.\n */\n isUnique?: boolean;\n\n /**\n * Indicates if column stores array.\n */\n isArray?: boolean;\n\n /**\n * Column's comment.\n */\n comment?: string;\n\n /**\n * Column type's length. Used only on some column types.\n * For example type = \"string\" and length = \"100\" means that ORM will create a column with type varchar(100).\n */\n length?: string;\n\n /**\n * Column type's display width. Used only on some column types in MySQL.\n * For example, INT(4) specifies an INT with a display width of four digits.\n */\n width?: number;\n\n /**\n * Defines column character set.\n */\n charset?: string;\n\n /**\n * Defines column collation.\n */\n collation?: string;\n\n /**\n * The precision for a decimal (exact numeric) column (applies only for decimal column), which is the maximum\n * number of digits that are stored for the values.\n */\n precision?: number|null;\n\n /**\n * The scale for a decimal (exact numeric) column (applies only for decimal column), which represents the number\n * of digits to the right of the decimal point and must not be greater than precision.\n */\n scale?: number;\n\n /**\n * Puts ZEROFILL attribute on to numeric column. Works only for MySQL.\n * If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column\n */\n zerofill?: boolean;\n\n /**\n * Puts UNSIGNED attribute on to numeric column. Works only for MySQL.\n */\n unsigned?: boolean;\n\n /**\n * Array of possible enumerated values.\n */\n enum?: string[];\n\n /**\n * Exact name of enum\n */\n enumName?: string;\n\n /**\n * Generated column expression. Supports only in MySQL.\n */\n asExpression?: string;\n\n /**\n * Generated column type. Supports only in MySQL.\n */\n generatedType?: \"VIRTUAL\"|\"STORED\";\n\n /**\n * Spatial Feature Type (Geometry, Point, Polygon, etc.)\n */\n spatialFeatureType?: string;\n\n /**\n * SRID (Spatial Reference ID (EPSG code))\n */\n srid?: number;\n}\n"],"sourceRoot":"../.."}
|
|
@@ -31,7 +31,7 @@ export declare class TableColumn {
|
|
|
31
31
|
* Specifies generation strategy if this column will use auto increment.
|
|
32
32
|
* `rowid` option supported only in CockroachDB.
|
|
33
33
|
*/
|
|
34
|
-
generationStrategy?: "uuid" | "increment" | "rowid";
|
|
34
|
+
generationStrategy?: "uuid" | "increment" | "rowid" | "identity";
|
|
35
35
|
/**
|
|
36
36
|
* Indicates if column is a primary key.
|
|
37
37
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema-builder/table/TableColumn.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH;IAyII,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,qBAAY,OAA4B;QAnHxC;;WAEG;QACH,eAAU,GAAY,KAAK,CAAC;QAE5B;;WAEG;QACH,gBAAW,GAAY,KAAK,CAAC;QAQ7B;;WAEG;QACH,cAAS,GAAY,KAAK,CAAC;QAE3B;;WAEG;QACH,aAAQ,GAAY,KAAK,CAAC;QAE1B;;WAEG;QACH,YAAO,GAAY,KAAK,CAAC;QAOzB;;;WAGG;QACH,WAAM,GAAW,EAAE,CAAC;QA8BpB;;;WAGG;QACH,aAAQ,GAAY,KAAK,CAAC;QAE1B;;WAEG;QACH,aAAQ,GAAY,KAAK,CAAC;QAqCtB,IAAI,OAAO,EAAE;YACT,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAC/B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;YACnC,IAAI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AA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACH,2BAAK,GAAL;QACI,OAAO,IAAI,WAAW,CAAqB;YACvC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,IAAI,EAAE,IAAI,CAAC,IAAI;SAClB,CAAC,CAAC;IACP,CAAC;IAEL,kBAAC;AAAD,CAhNA,AAgNC,IAAA;AAhNY,kCAAW","file":"TableColumn.js","sourcesContent":["import {TableColumnOptions} from \"../options/TableColumnOptions\";\n\n/**\n * Table's columns in the database represented in this class.\n */\nexport class TableColumn {\n\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Column name.\n */\n name: string;\n\n /**\n * Column type.\n */\n type: string;\n\n /**\n * Column's default value.\n */\n default?: any;\n\n /**\n * ON UPDATE trigger. Works only for MySQL.\n */\n onUpdate?: string;\n\n /**\n * Indicates if column is NULL, or is NOT NULL in the database.\n */\n isNullable: boolean = false;\n\n /**\n * Indicates if column is auto-generated sequence.\n */\n isGenerated: boolean = false;\n\n /**\n * Specifies generation strategy if this column will use auto increment.\n * `rowid` option supported only in CockroachDB.\n */\n generationStrategy?: \"uuid\"|\"increment\"|\"rowid\";\n\n /**\n * Indicates if column is a primary key.\n */\n isPrimary: boolean = false;\n\n /**\n * Indicates if column has unique value.\n */\n isUnique: boolean = false;\n\n /**\n * Indicates if column stores array.\n */\n isArray: boolean = false;\n\n /**\n * Column's comment.\n */\n comment?: string;\n\n /**\n * Column type's length. Used only on some column types.\n * For example type = \"string\" and length = \"100\" means that ORM will create a column with type varchar(100).\n */\n length: string = \"\";\n\n /**\n * Column type's display width. Used only on some column types in MySQL.\n * For example, INT(4) specifies an INT with a display width of four digits.\n */\n width?: number;\n\n /**\n * Defines column character set.\n */\n charset?: string;\n\n /**\n * Defines column collation.\n */\n collation?: string;\n\n /**\n * The precision for a decimal (exact numeric) column (applies only for decimal column), which is the maximum\n * number of digits that are stored for the values.\n */\n precision?: number|null;\n\n /**\n * The scale for a decimal (exact numeric) column (applies only for decimal column), which represents the number\n * of digits to the right of the decimal point and must not be greater than precision.\n */\n scale?: number;\n\n /**\n * Puts ZEROFILL attribute on to numeric column. Works only for MySQL.\n * If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column\n */\n zerofill: boolean = false;\n\n /**\n * Puts UNSIGNED attribute on to numeric column. Works only for MySQL.\n */\n unsigned: boolean = false;\n\n /**\n * Array of possible enumerated values.\n */\n enum?: string[];\n\n /**\n * Exact name of enum\n */\n enumName?: string;\n\n /**\n * Generated column expression. Supports only in MySQL.\n */\n asExpression?: string;\n\n /**\n * Generated column type. Supports only in MySQL.\n */\n generatedType?: \"VIRTUAL\"|\"STORED\";\n\n /**\n * Spatial Feature Type (Geometry, Point, Polygon, etc.)\n */\n spatialFeatureType?: string;\n\n /**\n * SRID (Spatial Reference ID (EPSG code))\n */\n srid?: number;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(options?: TableColumnOptions) {\n if (options) {\n this.name = options.name;\n this.type = options.type || \"\";\n this.length = options.length || \"\";\n this.width = options.width;\n this.charset = options.charset;\n this.collation = options.collation;\n this.precision = options.precision;\n this.scale = options.scale;\n this.zerofill = options.zerofill || false;\n this.unsigned = this.zerofill ? true : (options.unsigned || false);\n this.default = options.default;\n this.onUpdate = options.onUpdate;\n this.isNullable = options.isNullable || false;\n this.isGenerated = options.isGenerated || false;\n this.generationStrategy = options.generationStrategy;\n this.isPrimary = options.isPrimary || false;\n this.isUnique = options.isUnique || false;\n this.isArray = options.isArray || false;\n this.comment = options.comment;\n this.enum = options.enum;\n this.enumName = options.enumName;\n this.asExpression = options.asExpression;\n this.generatedType = options.generatedType;\n this.spatialFeatureType = options.spatialFeatureType;\n this.srid = options.srid;\n }\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Clones this column to a new column with exact same properties as this column has.\n */\n clone(): TableColumn {\n return new TableColumn(<TableColumnOptions>{\n name: this.name,\n type: this.type,\n length: this.length,\n width: this.width,\n charset: this.charset,\n collation: this.collation,\n precision: this.precision,\n scale: this.scale,\n zerofill: this.zerofill,\n unsigned: this.unsigned,\n enum: this.enum,\n enumName: this.enumName,\n asExpression: this.asExpression,\n generatedType: this.generatedType,\n default: this.default,\n onUpdate: this.onUpdate,\n isNullable: this.isNullable,\n isGenerated: this.isGenerated,\n generationStrategy: this.generationStrategy,\n isPrimary: this.isPrimary,\n isUnique: this.isUnique,\n isArray: this.isArray,\n comment: this.comment,\n spatialFeatureType: this.spatialFeatureType,\n srid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AI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,IAAI,EAAE,IAAI,CAAC,IAAI;SAClB,CAAC,CAAC;IACP,CAAC;IAEL,kBAAC;AAAD,CAhNA,AAgNC,IAAA;AAhNY,kCAAW","file":"TableColumn.js","sourcesContent":["import {TableColumnOptions} from \"../options/TableColumnOptions\";\n\n/**\n * Table's columns in the database represented in this class.\n */\nexport class TableColumn {\n\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Column name.\n */\n name: string;\n\n /**\n * Column type.\n */\n type: string;\n\n /**\n * Column's default value.\n */\n default?: any;\n\n /**\n * ON UPDATE trigger. Works only for MySQL.\n */\n onUpdate?: string;\n\n /**\n * Indicates if column is NULL, or is NOT NULL in the database.\n */\n isNullable: boolean = false;\n\n /**\n * Indicates if column is auto-generated sequence.\n */\n isGenerated: boolean = false;\n\n /**\n * Specifies generation strategy if this column will use auto increment.\n * `rowid` option supported only in CockroachDB.\n */\n generationStrategy?: \"uuid\"|\"increment\"|\"rowid\"|\"identity\";\n\n /**\n * Indicates if column is a primary key.\n */\n isPrimary: boolean = false;\n\n /**\n * Indicates if column has unique value.\n */\n isUnique: boolean = false;\n\n /**\n * Indicates if column stores array.\n */\n isArray: boolean = false;\n\n /**\n * Column's comment.\n */\n comment?: string;\n\n /**\n * Column type's length. Used only on some column types.\n * For example type = \"string\" and length = \"100\" means that ORM will create a column with type varchar(100).\n */\n length: string = \"\";\n\n /**\n * Column type's display width. Used only on some column types in MySQL.\n * For example, INT(4) specifies an INT with a display width of four digits.\n */\n width?: number;\n\n /**\n * Defines column character set.\n */\n charset?: string;\n\n /**\n * Defines column collation.\n */\n collation?: string;\n\n /**\n * The precision for a decimal (exact numeric) column (applies only for decimal column), which is the maximum\n * number of digits that are stored for the values.\n */\n precision?: number|null;\n\n /**\n * The scale for a decimal (exact numeric) column (applies only for decimal column), which represents the number\n * of digits to the right of the decimal point and must not be greater than precision.\n */\n scale?: number;\n\n /**\n * Puts ZEROFILL attribute on to numeric column. Works only for MySQL.\n * If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column\n */\n zerofill: boolean = false;\n\n /**\n * Puts UNSIGNED attribute on to numeric column. Works only for MySQL.\n */\n unsigned: boolean = false;\n\n /**\n * Array of possible enumerated values.\n */\n enum?: string[];\n\n /**\n * Exact name of enum\n */\n enumName?: string;\n\n /**\n * Generated column expression. Supports only in MySQL.\n */\n asExpression?: string;\n\n /**\n * Generated column type. Supports only in MySQL.\n */\n generatedType?: \"VIRTUAL\"|\"STORED\";\n\n /**\n * Spatial Feature Type (Geometry, Point, Polygon, etc.)\n */\n spatialFeatureType?: string;\n\n /**\n * SRID (Spatial Reference ID (EPSG code))\n */\n srid?: number;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(options?: TableColumnOptions) {\n if (options) {\n this.name = options.name;\n this.type = options.type || \"\";\n this.length = options.length || \"\";\n this.width = options.width;\n this.charset = options.charset;\n this.collation = options.collation;\n this.precision = options.precision;\n this.scale = options.scale;\n this.zerofill = options.zerofill || false;\n this.unsigned = this.zerofill ? true : (options.unsigned || false);\n this.default = options.default;\n this.onUpdate = options.onUpdate;\n this.isNullable = options.isNullable || false;\n this.isGenerated = options.isGenerated || false;\n this.generationStrategy = options.generationStrategy;\n this.isPrimary = options.isPrimary || false;\n this.isUnique = options.isUnique || false;\n this.isArray = options.isArray || false;\n this.comment = options.comment;\n this.enum = options.enum;\n this.enumName = options.enumName;\n this.asExpression = options.asExpression;\n this.generatedType = options.generatedType;\n this.spatialFeatureType = options.spatialFeatureType;\n this.srid = options.srid;\n }\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Clones this column to a new column with exact same properties as this column has.\n */\n clone(): TableColumn {\n return new TableColumn(<TableColumnOptions>{\n name: this.name,\n type: this.type,\n length: this.length,\n width: this.width,\n charset: this.charset,\n collation: this.collation,\n precision: this.precision,\n scale: this.scale,\n zerofill: this.zerofill,\n unsigned: this.unsigned,\n enum: this.enum,\n enumName: this.enumName,\n asExpression: this.asExpression,\n generatedType: this.generatedType,\n default: this.default,\n onUpdate: this.onUpdate,\n isNullable: this.isNullable,\n isGenerated: this.isGenerated,\n generationStrategy: this.generationStrategy,\n isPrimary: this.isPrimary,\n isUnique: this.isUnique,\n isArray: this.isArray,\n comment: this.comment,\n spatialFeatureType: this.spatialFeatureType,\n srid: this.srid\n });\n }\n\n}\n"],"sourceRoot":"../.."}
|