typeorm 0.3.27-dev.6965fa2 → 0.3.27-dev.8b76e1a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/decorator/columns/Column.d.ts +7 -7
- package/browser/decorator/columns/Column.js +1 -1
- package/browser/decorator/columns/Column.js.map +1 -1
- package/browser/decorator/options/ColumnNumericOptions.d.ts +8 -1
- package/browser/decorator/options/ColumnNumericOptions.js.map +1 -1
- package/browser/decorator/options/ColumnOptions.d.ts +6 -0
- package/browser/decorator/options/ColumnOptions.js.map +1 -1
- package/browser/decorator/options/ColumnUnsignedOptions.d.ts +28 -0
- package/browser/decorator/options/ColumnUnsignedOptions.js +3 -0
- package/browser/decorator/options/ColumnUnsignedOptions.js.map +1 -0
- package/browser/decorator/options/PrimaryGeneratedColumnNumericOptions.d.ts +3 -0
- package/browser/decorator/options/PrimaryGeneratedColumnNumericOptions.js.map +1 -1
- package/browser/driver/aurora-mysql/AuroraMysqlDriver.d.ts +15 -19
- package/browser/driver/aurora-mysql/AuroraMysqlDriver.js +7 -27
- package/browser/driver/aurora-mysql/AuroraMysqlDriver.js.map +1 -1
- package/browser/driver/aurora-mysql/AuroraMysqlQueryRunner.d.ts +7 -7
- package/browser/driver/aurora-mysql/AuroraMysqlQueryRunner.js +15 -13
- package/browser/driver/aurora-mysql/AuroraMysqlQueryRunner.js.map +1 -1
- package/browser/driver/mysql/MysqlDriver.d.ts +15 -19
- package/browser/driver/mysql/MysqlDriver.js +8 -28
- package/browser/driver/mysql/MysqlDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.d.ts +1 -0
- package/browser/driver/mysql/MysqlQueryRunner.js +12 -6
- package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/browser/driver/spanner/SpannerConnectionOptions.d.ts +0 -5
- package/browser/driver/spanner/SpannerConnectionOptions.js.map +1 -1
- package/browser/driver/spanner/SpannerDriver.d.ts +0 -4
- package/browser/driver/spanner/SpannerDriver.js +0 -4
- package/browser/driver/spanner/SpannerDriver.js.map +1 -1
- package/browser/driver/types/ColumnTypes.d.ts +2 -2
- package/browser/driver/types/ColumnTypes.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.js +5 -0
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/util/StringUtils.d.ts +1 -1
- package/browser/util/StringUtils.js +2 -2
- package/browser/util/StringUtils.js.map +1 -1
- package/commands/MigrationCreateCommand.js +7 -0
- package/commands/MigrationCreateCommand.js.map +1 -1
- package/commands/MigrationGenerateCommand.js +7 -0
- package/commands/MigrationGenerateCommand.js.map +1 -1
- package/decorator/columns/Column.d.ts +7 -7
- package/decorator/columns/Column.js +1 -1
- package/decorator/columns/Column.js.map +1 -1
- package/decorator/options/ColumnNumericOptions.d.ts +8 -1
- package/decorator/options/ColumnNumericOptions.js.map +1 -1
- package/decorator/options/ColumnOptions.d.ts +6 -0
- package/decorator/options/ColumnOptions.js.map +1 -1
- package/decorator/options/ColumnUnsignedOptions.d.ts +28 -0
- package/decorator/options/{ColumnWithWidthOptions.js → ColumnUnsignedOptions.js} +1 -1
- package/decorator/options/ColumnUnsignedOptions.js.map +1 -0
- package/decorator/options/PrimaryGeneratedColumnNumericOptions.d.ts +3 -0
- package/decorator/options/PrimaryGeneratedColumnNumericOptions.js.map +1 -1
- package/driver/aurora-mysql/AuroraMysqlDriver.d.ts +15 -19
- package/driver/aurora-mysql/AuroraMysqlDriver.js +7 -27
- package/driver/aurora-mysql/AuroraMysqlDriver.js.map +1 -1
- package/driver/aurora-mysql/AuroraMysqlQueryRunner.d.ts +7 -7
- package/driver/aurora-mysql/AuroraMysqlQueryRunner.js +15 -13
- package/driver/aurora-mysql/AuroraMysqlQueryRunner.js.map +1 -1
- package/driver/mysql/MysqlDriver.d.ts +15 -19
- package/driver/mysql/MysqlDriver.js +8 -28
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.d.ts +1 -0
- package/driver/mysql/MysqlQueryRunner.js +12 -6
- package/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/driver/spanner/SpannerConnectionOptions.d.ts +0 -5
- package/driver/spanner/SpannerConnectionOptions.js.map +1 -1
- package/driver/spanner/SpannerDriver.d.ts +0 -4
- package/driver/spanner/SpannerDriver.js +0 -4
- package/driver/spanner/SpannerDriver.js.map +1 -1
- package/driver/types/ColumnTypes.d.ts +2 -2
- package/driver/types/ColumnTypes.js.map +1 -1
- package/package.json +1 -1
- package/query-builder/SelectQueryBuilder.js +5 -0
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/util/StringUtils.d.ts +1 -1
- package/util/StringUtils.js +2 -2
- package/util/StringUtils.js.map +1 -1
- package/browser/decorator/options/ColumnWithWidthOptions.d.ts +0 -19
- package/browser/decorator/options/ColumnWithWidthOptions.js +0 -3
- package/browser/decorator/options/ColumnWithWidthOptions.js.map +0 -1
- package/decorator/options/ColumnWithWidthOptions.d.ts +0 -19
- package/decorator/options/ColumnWithWidthOptions.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { SimpleColumnType, SpatialColumnType, WithLengthColumnType, WithPrecisionColumnType
|
|
1
|
+
import { SimpleColumnType, SpatialColumnType, UnsignedColumnType, WithLengthColumnType, WithPrecisionColumnType } from "../../driver/types/ColumnTypes";
|
|
2
2
|
import { ColumnCommonOptions } from "../options/ColumnCommonOptions";
|
|
3
|
-
import { SpatialColumnOptions } from "../options/SpatialColumnOptions";
|
|
4
|
-
import { ColumnWithLengthOptions } from "../options/ColumnWithLengthOptions";
|
|
5
|
-
import { ColumnNumericOptions } from "../options/ColumnNumericOptions";
|
|
6
|
-
import { ColumnEnumOptions } from "../options/ColumnEnumOptions";
|
|
7
3
|
import { ColumnEmbeddedOptions } from "../options/ColumnEmbeddedOptions";
|
|
4
|
+
import { ColumnEnumOptions } from "../options/ColumnEnumOptions";
|
|
8
5
|
import { ColumnHstoreOptions } from "../options/ColumnHstoreOptions";
|
|
9
|
-
import {
|
|
6
|
+
import { ColumnNumericOptions } from "../options/ColumnNumericOptions";
|
|
10
7
|
import { ColumnOptions } from "../options/ColumnOptions";
|
|
8
|
+
import { ColumnUnsignedOptions } from "../options/ColumnUnsignedOptions";
|
|
9
|
+
import { ColumnWithLengthOptions } from "../options/ColumnWithLengthOptions";
|
|
10
|
+
import { SpatialColumnOptions } from "../options/SpatialColumnOptions";
|
|
11
11
|
/**
|
|
12
12
|
* Column decorator is used to mark a specific class property as a table column. Only properties decorated with this
|
|
13
13
|
* decorator will be persisted to the database when entity be saved.
|
|
@@ -37,7 +37,7 @@ export declare function Column(type: WithLengthColumnType, options?: ColumnCommo
|
|
|
37
37
|
* Column decorator is used to mark a specific class property as a table column.
|
|
38
38
|
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
|
|
39
39
|
*/
|
|
40
|
-
export declare function Column(type:
|
|
40
|
+
export declare function Column(type: UnsignedColumnType, options?: ColumnCommonOptions & ColumnUnsignedOptions): PropertyDecorator;
|
|
41
41
|
/**
|
|
42
42
|
* Column decorator is used to mark a specific class property as a table column.
|
|
43
43
|
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getMetadataArgsStorage } from "../../globals";
|
|
2
1
|
import { ColumnTypeUndefinedError } from "../../error/ColumnTypeUndefinedError";
|
|
2
|
+
import { getMetadataArgsStorage } from "../../globals";
|
|
3
3
|
/**
|
|
4
4
|
* Column decorator is used to mark a specific class property as a table column.
|
|
5
5
|
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/decorator/columns/Column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAiBtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAA;AAgH/E;;;GAGG;AACH,MAAM,UAAU,MAAM,CAClB,aAG6C,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,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;gBAC7D,IAAI,EAAE,aAAyC;aAC1B,CAAC,CAAA;QAC9B,CAAC;aAAM,CAAC;YACJ,4BAA4B;YAE5B,yFAAyF;YACzF,IAAI,CAAC,OAAO,CAAC,IAAI;gBACb,MAAM,IAAI,wBAAwB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;YAE5D,gBAAgB;YAChB,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI;gBACvB,sBAAsB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;oBAClC,MAAM,EAAE,MAAM,CAAC,WAAW;oBAC1B,OAAO,EAAE,CAAC,YAAY,CAAC;iBAC1B,CAAC,CAAA;YAEN,sBAAsB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;gBAClC,MAAM,EAAE,MAAM,CAAC,WAAW;gBAC1B,YAAY,EAAE,YAAY;gBAC1B,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,OAAO;aACG,CAAC,CAAA;YAExB,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;gBACpB,sBAAsB,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;oBACtC,MAAM,EAAE,MAAM,CAAC,WAAW;oBAC1B,YAAY,EAAE,YAAY;oBAC1B,QAAQ,EACJ,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ;wBACjC,CAAC,CAAC,OAAO,CAAC,SAAS;wBACnB,CAAC,CAAC,WAAW;iBACC,CAAC,CAAA;YAC/B,CAAC;QACL,CAAC;IACL,CAAC,CAAA;AACL,CAAC","file":"Column.js","sourcesContent":["import { getMetadataArgsStorage } from \"../../globals\"\nimport {\n ColumnType,\n SimpleColumnType,\n SpatialColumnType,\n WithLengthColumnType,\n WithPrecisionColumnType,\n WithWidthColumnType,\n} from \"../../driver/types/ColumnTypes\"\nimport { ColumnMetadataArgs } from \"../../metadata-args/ColumnMetadataArgs\"\nimport { ColumnCommonOptions } from \"../options/ColumnCommonOptions\"\nimport { SpatialColumnOptions } from \"../options/SpatialColumnOptions\"\nimport { ColumnWithLengthOptions } from \"../options/ColumnWithLengthOptions\"\nimport { ColumnNumericOptions } from \"../options/ColumnNumericOptions\"\nimport { ColumnEnumOptions } from \"../options/ColumnEnumOptions\"\nimport { ColumnEmbeddedOptions } from \"../options/ColumnEmbeddedOptions\"\nimport { EmbeddedMetadataArgs } from \"../../metadata-args/EmbeddedMetadataArgs\"\nimport { ColumnTypeUndefinedError } from \"../../error/ColumnTypeUndefinedError\"\nimport { ColumnHstoreOptions } from \"../options/ColumnHstoreOptions\"\nimport { ColumnWithWidthOptions } from \"../options/ColumnWithWidthOptions\"\nimport { GeneratedMetadataArgs } from \"../../metadata-args/GeneratedMetadataArgs\"\nimport { ColumnOptions } from \"../options/ColumnOptions\"\n\n/**\n * Column decorator is used to mark a specific class property as a table column. Only properties decorated with this\n * decorator will be persisted to the database when entity be saved.\n */\nexport function Column(): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(options: ColumnOptions): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: SimpleColumnType,\n options?: ColumnCommonOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: SpatialColumnType,\n options?: ColumnCommonOptions & SpatialColumnOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithLengthColumnType,\n options?: ColumnCommonOptions & ColumnWithLengthOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithWidthColumnType,\n options?: ColumnCommonOptions & ColumnWithWidthOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithPrecisionColumnType,\n options?: ColumnCommonOptions & ColumnNumericOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"enum\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"simple-enum\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"set\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"hstore\",\n options?: ColumnCommonOptions & ColumnHstoreOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n *\n * Property in entity can be marked as Embedded, and on persist all columns from the embedded are mapped to the\n * single table of the entity where Embedded is used. And on hydration all columns which supposed to be in the\n * embedded will be mapped to it from the single table.\n */\nexport function Column(\n type: (type?: any) => Function,\n options?: ColumnEmbeddedOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n typeOrOptions?:\n | ((type?: any) => Function)\n | ColumnType\n | (ColumnOptions & ColumnEmbeddedOptions),\n options?: ColumnOptions & ColumnEmbeddedOptions,\n): PropertyDecorator {\n return function (object: Object, propertyName: string) {\n // normalize parameters\n let type: ColumnType | undefined\n if (\n typeof typeOrOptions === \"string\" ||\n typeof typeOrOptions === \"function\"\n ) {\n type = <ColumnType>typeOrOptions\n } else if (typeOrOptions) {\n options = <ColumnOptions>typeOrOptions\n type = typeOrOptions.type\n }\n if (!options) options = {} as ColumnOptions\n\n // if type is not given explicitly then try to guess it\n const reflectMetadataType =\n Reflect && (Reflect as any).getMetadata\n ? (Reflect as any).getMetadata(\n \"design:type\",\n object,\n propertyName,\n )\n : undefined\n if (!type && reflectMetadataType)\n // if type is not given explicitly then try to guess it\n type = reflectMetadataType\n\n // check if there is no type in column options then set type from first function argument, or guessed one\n if (!options.type && type) options.type = type\n\n // specify HSTORE type if column is HSTORE\n if (options.type === \"hstore\" && !options.hstoreType)\n options.hstoreType =\n reflectMetadataType === Object ? \"object\" : \"string\"\n\n if (typeof typeOrOptions === \"function\") {\n // register an embedded\n getMetadataArgsStorage().embeddeds.push({\n target: object.constructor,\n propertyName: propertyName,\n isArray:\n reflectMetadataType === Array || options.array === true,\n prefix:\n options.prefix !== undefined ? options.prefix : undefined,\n type: typeOrOptions as (type?: any) => Function,\n } as EmbeddedMetadataArgs)\n } else {\n // register a regular column\n\n // if we still don't have a type then we need to give error to user that type is required\n if (!options.type)\n throw new ColumnTypeUndefinedError(object, propertyName)\n\n // create unique\n if (options.unique === true)\n getMetadataArgsStorage().uniques.push({\n target: object.constructor,\n columns: [propertyName],\n })\n\n getMetadataArgsStorage().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"regular\",\n options: options,\n } as ColumnMetadataArgs)\n\n if (options.generated) {\n getMetadataArgsStorage().generations.push({\n target: object.constructor,\n propertyName: propertyName,\n strategy:\n typeof options.generated === \"string\"\n ? options.generated\n : \"increment\",\n } as GeneratedMetadataArgs)\n }\n }\n }\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/decorator/columns/Column.ts"],"names":[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atialColumnType,\n UnsignedColumnType,\n WithLengthColumnType,\n WithPrecisionColumnType,\n} from \"../../driver/types/ColumnTypes\"\nimport { ColumnTypeUndefinedError } from \"../../error/ColumnTypeUndefinedError\"\nimport { getMetadataArgsStorage } from \"../../globals\"\nimport { ColumnMetadataArgs } from \"../../metadata-args/ColumnMetadataArgs\"\nimport { EmbeddedMetadataArgs } from \"../../metadata-args/EmbeddedMetadataArgs\"\nimport { GeneratedMetadataArgs } from \"../../metadata-args/GeneratedMetadataArgs\"\nimport { ColumnCommonOptions } from \"../options/ColumnCommonOptions\"\nimport { ColumnEmbeddedOptions } from \"../options/ColumnEmbeddedOptions\"\nimport { ColumnEnumOptions } from \"../options/ColumnEnumOptions\"\nimport { ColumnHstoreOptions } from \"../options/ColumnHstoreOptions\"\nimport { ColumnNumericOptions } from \"../options/ColumnNumericOptions\"\nimport { ColumnOptions } from \"../options/ColumnOptions\"\nimport { ColumnUnsignedOptions } from \"../options/ColumnUnsignedOptions\"\nimport { ColumnWithLengthOptions } from \"../options/ColumnWithLengthOptions\"\nimport { SpatialColumnOptions } from \"../options/SpatialColumnOptions\"\n\n/**\n * Column decorator is used to mark a specific class property as a table column. Only properties decorated with this\n * decorator will be persisted to the database when entity be saved.\n */\nexport function Column(): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(options: ColumnOptions): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: SimpleColumnType,\n options?: ColumnCommonOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: SpatialColumnType,\n options?: ColumnCommonOptions & SpatialColumnOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithLengthColumnType,\n options?: ColumnCommonOptions & ColumnWithLengthOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: UnsignedColumnType,\n options?: ColumnCommonOptions & ColumnUnsignedOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithPrecisionColumnType,\n options?: ColumnCommonOptions & ColumnNumericOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"enum\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"simple-enum\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"set\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"hstore\",\n options?: ColumnCommonOptions & ColumnHstoreOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n *\n * Property in entity can be marked as Embedded, and on persist all columns from the embedded are mapped to the\n * single table of the entity where Embedded is used. And on hydration all columns which supposed to be in the\n * embedded will be mapped to it from the single table.\n */\nexport function Column(\n type: (type?: any) => Function,\n options?: ColumnEmbeddedOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n typeOrOptions?:\n | ((type?: any) => Function)\n | ColumnType\n | (ColumnOptions & ColumnEmbeddedOptions),\n options?: ColumnOptions & ColumnEmbeddedOptions,\n): PropertyDecorator {\n return function (object: Object, propertyName: string) {\n // normalize parameters\n let type: ColumnType | undefined\n if (\n typeof typeOrOptions === \"string\" ||\n typeof typeOrOptions === \"function\"\n ) {\n type = <ColumnType>typeOrOptions\n } else if (typeOrOptions) {\n options = <ColumnOptions>typeOrOptions\n type = typeOrOptions.type\n }\n if (!options) options = {} as ColumnOptions\n\n // if type is not given explicitly then try to guess it\n const reflectMetadataType =\n Reflect && (Reflect as any).getMetadata\n ? (Reflect as any).getMetadata(\n \"design:type\",\n object,\n propertyName,\n )\n : undefined\n if (!type && reflectMetadataType)\n // if type is not given explicitly then try to guess it\n type = reflectMetadataType\n\n // check if there is no type in column options then set type from first function argument, or guessed one\n if (!options.type && type) options.type = type\n\n // specify HSTORE type if column is HSTORE\n if (options.type === \"hstore\" && !options.hstoreType)\n options.hstoreType =\n reflectMetadataType === Object ? \"object\" : \"string\"\n\n if (typeof typeOrOptions === \"function\") {\n // register an embedded\n getMetadataArgsStorage().embeddeds.push({\n target: object.constructor,\n propertyName: propertyName,\n isArray:\n reflectMetadataType === Array || options.array === true,\n prefix:\n options.prefix !== undefined ? options.prefix : undefined,\n type: typeOrOptions as (type?: any) => Function,\n } as EmbeddedMetadataArgs)\n } else {\n // register a regular column\n\n // if we still don't have a type then we need to give error to user that type is required\n if (!options.type)\n throw new ColumnTypeUndefinedError(object, propertyName)\n\n // create unique\n if (options.unique === true)\n getMetadataArgsStorage().uniques.push({\n target: object.constructor,\n columns: [propertyName],\n })\n\n getMetadataArgsStorage().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"regular\",\n options: options,\n } as ColumnMetadataArgs)\n\n if (options.generated) {\n getMetadataArgsStorage().generations.push({\n target: object.constructor,\n propertyName: propertyName,\n strategy:\n typeof options.generated === \"string\"\n ? options.generated\n : \"increment\",\n } as GeneratedMetadataArgs)\n }\n }\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -14,11 +14,18 @@ export interface ColumnNumericOptions {
|
|
|
14
14
|
scale?: number;
|
|
15
15
|
/**
|
|
16
16
|
* Puts ZEROFILL attribute on to numeric column. Works only for MySQL.
|
|
17
|
-
* If you specify ZEROFILL for a numeric column, MySQL automatically adds
|
|
17
|
+
* If you specify ZEROFILL for a numeric column, MySQL automatically adds
|
|
18
|
+
* the UNSIGNED attribute to the column
|
|
19
|
+
* @deprecated MySQL deprecated and removed the ZEROFILL attribute. This
|
|
20
|
+
* will also be removed from TypeORM in an upcoming version. Use a character
|
|
21
|
+
* column and the `LPAD` function as suggested by MySQL or handle the
|
|
22
|
+
* formatting in the application layer.
|
|
18
23
|
*/
|
|
19
24
|
zerofill?: boolean;
|
|
20
25
|
/**
|
|
21
26
|
* Puts UNSIGNED attribute on to numeric column. Works only for MySQL.
|
|
27
|
+
* @deprecated MySQL deprecated the UNSIGNED attribute for non-integer
|
|
28
|
+
* numeric types. This will also be removed from TypeORM in an upcoming version.
|
|
22
29
|
*/
|
|
23
30
|
unsigned?: boolean;
|
|
24
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/decorator/options/ColumnNumericOptions.ts"],"names":[],"mappings":"","file":"ColumnNumericOptions.js","sourcesContent":["/**\n * Options for numeric column types where user can specify scale and precision.\n */\nexport interface ColumnNumericOptions {\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\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"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/decorator/options/ColumnNumericOptions.ts"],"names":[],"mappings":"","file":"ColumnNumericOptions.js","sourcesContent":["/**\n * Options for numeric column types where user can specify scale and precision.\n */\nexport interface ColumnNumericOptions {\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\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\n * the UNSIGNED attribute to the column\n * @deprecated MySQL deprecated and removed the ZEROFILL attribute. This\n * will also be removed from TypeORM in an upcoming version. Use a character\n * column and the `LPAD` function as suggested by MySQL or handle the\n * formatting in the application layer.\n */\n zerofill?: boolean\n\n /**\n * Puts UNSIGNED attribute on to numeric column. Works only for MySQL.\n * @deprecated MySQL deprecated the UNSIGNED attribute for non-integer\n * numeric types. This will also be removed from TypeORM in an upcoming version.\n */\n unsigned?: boolean\n}\n"],"sourceRoot":"../.."}
|
|
@@ -21,6 +21,9 @@ export interface ColumnOptions extends ColumnCommonOptions {
|
|
|
21
21
|
/**
|
|
22
22
|
* Column type's display width. Used only on some column types in MySQL.
|
|
23
23
|
* For example, INT(4) specifies an INT with a display width of four digits.
|
|
24
|
+
* @deprecated No longer supported in newer MySQL versions, will be removed
|
|
25
|
+
* from TypeORM in an upcoming version. Use a character column and the
|
|
26
|
+
* `LPAD` function as suggested by MySQL
|
|
24
27
|
*/
|
|
25
28
|
width?: number;
|
|
26
29
|
/**
|
|
@@ -88,6 +91,9 @@ export interface ColumnOptions extends ColumnCommonOptions {
|
|
|
88
91
|
/**
|
|
89
92
|
* Puts ZEROFILL attribute on to numeric column. Works only for MySQL.
|
|
90
93
|
* If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to this column
|
|
94
|
+
* @deprecated No longer supported in newer MySQL versions, will be removed
|
|
95
|
+
* from TypeORM in an upcoming version. Use a character column and the
|
|
96
|
+
* `LPAD` function as suggested by MySQL
|
|
91
97
|
*/
|
|
92
98
|
zerofill?: boolean;
|
|
93
99
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/decorator/options/ColumnOptions.ts"],"names":[],"mappings":"","file":"ColumnOptions.js","sourcesContent":["import { ColumnType } from \"../../driver/types/ColumnTypes\"\nimport { ValueTransformer } from \"./ValueTransformer\"\nimport { ColumnCommonOptions } from \"./ColumnCommonOptions\"\n\n/**\n * Describes all column's options.\n */\nexport interface ColumnOptions extends ColumnCommonOptions {\n /**\n * Column type. Must be one of the value from the ColumnTypes class.\n */\n type?: ColumnType\n\n /**\n * Column name in the database.\n */\n name?: 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 | number\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 * Indicates if column's value can be set to NULL.\n * Default value is \"false\".\n */\n nullable?: boolean\n\n /**\n * Indicates if column value is not updated by \"save\" operation.\n * It means you'll be able to write this value only when you first time insert the object.\n * Default value is \"false\".\n *\n * @deprecated Please use the `update` option instead. Careful, it takes\n * the opposite value to readonly.\n *\n */\n readonly?: boolean\n\n /**\n * Indicates if column value is updated by \"save\" operation.\n * If false, you'll be able to write this value only when you first time insert the object.\n * Default value is \"true\".\n */\n update?: boolean\n\n /**\n * Indicates if column is always selected by QueryBuilder and find operations.\n * Default value is \"true\".\n */\n select?: boolean\n\n /**\n * Indicates if column is inserted by default.\n * Default value is \"true\".\n */\n insert?: boolean\n\n /**\n * Default database value.\n */\n default?: any\n\n /**\n * ON UPDATE trigger. Works only for MySQL.\n */\n onUpdate?: string\n\n /**\n * Indicates if this column is a primary key.\n * Same can be achieved when @PrimaryColumn decorator is used.\n */\n primary?: boolean\n\n /**\n * Specifies if column's value must be unique or not.\n */\n unique?: boolean\n\n /**\n * Column comment. Not supported by all database types.\n */\n comment?: 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 this 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 * Defines a column character set.\n * Not supported by all database types.\n */\n charset?: string\n\n /**\n * Defines a column collation.\n */\n collation?: string\n\n /**\n * Array of possible enumerated values.\n */\n enum?: (string | number)[] | Object\n\n /**\n * Exact name of enum\n */\n enumName?: string\n\n /**\n * If this column is primary key then this specifies the name for it.\n */\n primaryKeyConstraintName?: string\n\n /**\n * If this column is foreign key then this specifies the name for it.\n */\n foreignKeyConstraintName?: string\n\n /**\n * Generated column expression.\n */\n asExpression?: string\n\n /**\n * Generated column type.\n */\n generatedType?: \"VIRTUAL\" | \"STORED\"\n\n /**\n * Identity column type. Supports only in Postgres 10+.\n */\n generatedIdentity?: \"ALWAYS\" | \"BY DEFAULT\"\n\n /**\n * Return type of HSTORE column.\n * Returns value as string or as object.\n */\n hstoreType?: \"object\" | \"string\"\n\n /**\n * Indicates if this column is an array.\n * Can be simply set to true or array length can be specified.\n * Supported only by postgres.\n */\n array?: boolean\n\n /**\n * Specifies a value transformer that is to be used to (un)marshal\n * this column when reading or writing to the database.\n */\n transformer?: ValueTransformer | ValueTransformer[]\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 * Query to be used to populate the column data. This query is used when generating the relational db script.\n * The query function is called with the current entities alias either defined by the Entity Decorator or automatically\n * @See https://typeorm.io/decorator-reference#virtualcolumn for more details.\n */\n query?: (alias: string) => string\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/decorator/options/ColumnOptions.ts"],"names":[],"mappings":"","file":"ColumnOptions.js","sourcesContent":["import { ColumnType } from \"../../driver/types/ColumnTypes\"\nimport { ValueTransformer } from \"./ValueTransformer\"\nimport { ColumnCommonOptions } from \"./ColumnCommonOptions\"\n\n/**\n * Describes all column's options.\n */\nexport interface ColumnOptions extends ColumnCommonOptions {\n /**\n * Column type. Must be one of the value from the ColumnTypes class.\n */\n type?: ColumnType\n\n /**\n * Column name in the database.\n */\n name?: 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 | number\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 * @deprecated No longer supported in newer MySQL versions, will be removed\n * from TypeORM in an upcoming version. Use a character column and the\n * `LPAD` function as suggested by MySQL\n */\n width?: number\n\n /**\n * Indicates if column's value can be set to NULL.\n * Default value is \"false\".\n */\n nullable?: boolean\n\n /**\n * Indicates if column value is not updated by \"save\" operation.\n * It means you'll be able to write this value only when you first time insert the object.\n * Default value is \"false\".\n *\n * @deprecated Please use the `update` option instead. Careful, it takes\n * the opposite value to readonly.\n *\n */\n readonly?: boolean\n\n /**\n * Indicates if column value is updated by \"save\" operation.\n * If false, you'll be able to write this value only when you first time insert the object.\n * Default value is \"true\".\n */\n update?: boolean\n\n /**\n * Indicates if column is always selected by QueryBuilder and find operations.\n * Default value is \"true\".\n */\n select?: boolean\n\n /**\n * Indicates if column is inserted by default.\n * Default value is \"true\".\n */\n insert?: boolean\n\n /**\n * Default database value.\n */\n default?: any\n\n /**\n * ON UPDATE trigger. Works only for MySQL.\n */\n onUpdate?: string\n\n /**\n * Indicates if this column is a primary key.\n * Same can be achieved when @PrimaryColumn decorator is used.\n */\n primary?: boolean\n\n /**\n * Specifies if column's value must be unique or not.\n */\n unique?: boolean\n\n /**\n * Column comment. Not supported by all database types.\n */\n comment?: 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 this column\n * @deprecated No longer supported in newer MySQL versions, will be removed\n * from TypeORM in an upcoming version. Use a character column and the\n * `LPAD` function as suggested by MySQL\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 * Defines a column character set.\n * Not supported by all database types.\n */\n charset?: string\n\n /**\n * Defines a column collation.\n */\n collation?: string\n\n /**\n * Array of possible enumerated values.\n */\n enum?: (string | number)[] | Object\n\n /**\n * Exact name of enum\n */\n enumName?: string\n\n /**\n * If this column is primary key then this specifies the name for it.\n */\n primaryKeyConstraintName?: string\n\n /**\n * If this column is foreign key then this specifies the name for it.\n */\n foreignKeyConstraintName?: string\n\n /**\n * Generated column expression.\n */\n asExpression?: string\n\n /**\n * Generated column type.\n */\n generatedType?: \"VIRTUAL\" | \"STORED\"\n\n /**\n * Identity column type. Supports only in Postgres 10+.\n */\n generatedIdentity?: \"ALWAYS\" | \"BY DEFAULT\"\n\n /**\n * Return type of HSTORE column.\n * Returns value as string or as object.\n */\n hstoreType?: \"object\" | \"string\"\n\n /**\n * Indicates if this column is an array.\n * Can be simply set to true or array length can be specified.\n * Supported only by postgres.\n */\n array?: boolean\n\n /**\n * Specifies a value transformer that is to be used to (un)marshal\n * this column when reading or writing to the database.\n */\n transformer?: ValueTransformer | ValueTransformer[]\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 * Query to be used to populate the column data. This query is used when generating the relational db script.\n * The query function is called with the current entities alias either defined by the Entity Decorator or automatically\n * @See https://typeorm.io/decorator-reference#virtualcolumn for more details.\n */\n query?: (alias: string) => string\n}\n"],"sourceRoot":"../.."}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for columns that can define a length of the column type.
|
|
3
|
+
*/
|
|
4
|
+
export interface ColumnUnsignedOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Column type's display width. Used only on some column types in MySQL.
|
|
7
|
+
* For example, INT(4) specifies an INT with a display width of four digits.
|
|
8
|
+
* @deprecated MySQL deprecated and removed display width for integer types,
|
|
9
|
+
* TypeORM will also remove it in an upcoming version. Use a character
|
|
10
|
+
* column and the `LPAD` function as suggested by MySQL or handle the
|
|
11
|
+
* formatting in the application layer.
|
|
12
|
+
*/
|
|
13
|
+
width?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Puts ZEROFILL attribute on to numeric column. Works only for MySQL.
|
|
16
|
+
* If you specify ZEROFILL for a numeric column, MySQL automatically adds
|
|
17
|
+
* the UNSIGNED attribute to this column
|
|
18
|
+
* @deprecated MySQL deprecated and removed the zerofill attribute. This
|
|
19
|
+
* will also be removed from TypeORM in an upcoming version. Use a character
|
|
20
|
+
* column and the `LPAD` function as suggested by MySQL or handle the
|
|
21
|
+
* formatting in the application layer.
|
|
22
|
+
*/
|
|
23
|
+
zerofill?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Puts UNSIGNED attribute on to numeric column. Works only for MySQL.
|
|
26
|
+
*/
|
|
27
|
+
unsigned?: boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../browser/src/decorator/options/ColumnUnsignedOptions.ts"],"names":[],"mappings":"","file":"ColumnUnsignedOptions.js","sourcesContent":["/**\n * Options for columns that can define a length of the column type.\n */\nexport interface ColumnUnsignedOptions {\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 * @deprecated MySQL deprecated and removed display width for integer types,\n * TypeORM will also remove it in an upcoming version. Use a character\n * column and the `LPAD` function as suggested by MySQL or handle the\n * formatting in the application layer.\n */\n width?: 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\n * the UNSIGNED attribute to this column\n * @deprecated MySQL deprecated and removed the zerofill attribute. This\n * will also be removed from TypeORM in an upcoming version. Use a character\n * column and the `LPAD` function as suggested by MySQL or handle the\n * formatting in the application layer.\n */\n zerofill?: boolean\n\n /**\n * Puts UNSIGNED attribute on to numeric column. Works only for MySQL.\n */\n unsigned?: boolean\n}\n"],"sourceRoot":"../.."}
|
|
@@ -18,6 +18,9 @@ export interface PrimaryGeneratedColumnNumericOptions {
|
|
|
18
18
|
/**
|
|
19
19
|
* Puts ZEROFILL attribute on to numeric column. Works only for MySQL.
|
|
20
20
|
* If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column
|
|
21
|
+
* @deprecated No longer supported in newer MySQL versions, will be removed
|
|
22
|
+
* from TypeORM in an upcoming version. Use a character column and the
|
|
23
|
+
* `LPAD` function as suggested by MySQL
|
|
21
24
|
*/
|
|
22
25
|
zerofill?: boolean;
|
|
23
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../browser/src/decorator/options/PrimaryGeneratedColumnNumericOptions.ts"],"names":[],"mappings":"","file":"PrimaryGeneratedColumnNumericOptions.js","sourcesContent":["import { PrimaryGeneratedColumnType } from \"../../driver/types/ColumnTypes\"\n\n/**\n * Describes all options for PrimaryGeneratedColumn decorator with numeric generation strategy.\n */\nexport interface PrimaryGeneratedColumnNumericOptions {\n /**\n * Column type. Must be one of the value from the ColumnTypes class.\n */\n type?: PrimaryGeneratedColumnType\n\n /**\n * Column name in the database.\n */\n name?: string\n\n /**\n * Column comment. Not supported by all database types.\n */\n comment?: string\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 * Name of the primary key constraint.\n */\n primaryKeyConstraintName?: string\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../browser/src/decorator/options/PrimaryGeneratedColumnNumericOptions.ts"],"names":[],"mappings":"","file":"PrimaryGeneratedColumnNumericOptions.js","sourcesContent":["import { PrimaryGeneratedColumnType } from \"../../driver/types/ColumnTypes\"\n\n/**\n * Describes all options for PrimaryGeneratedColumn decorator with numeric generation strategy.\n */\nexport interface PrimaryGeneratedColumnNumericOptions {\n /**\n * Column type. Must be one of the value from the ColumnTypes class.\n */\n type?: PrimaryGeneratedColumnType\n\n /**\n * Column name in the database.\n */\n name?: string\n\n /**\n * Column comment. Not supported by all database types.\n */\n comment?: string\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 * @deprecated No longer supported in newer MySQL versions, will be removed\n * from TypeORM in an upcoming version. Use a character column and the\n * `LPAD` function as suggested by MySQL\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 * Name of the primary key constraint.\n */\n primaryKeyConstraintName?: string\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Driver } from "../Driver";
|
|
2
|
-
import { CteCapabilities } from "../types/CteCapabilities";
|
|
3
|
-
import { AuroraMysqlQueryRunner } from "./AuroraMysqlQueryRunner";
|
|
4
1
|
import { ObjectLiteral } from "../../common/ObjectLiteral";
|
|
5
|
-
import { ColumnMetadata } from "../../metadata/ColumnMetadata";
|
|
6
2
|
import { DataSource } from "../../data-source";
|
|
7
|
-
import {
|
|
8
|
-
import { AuroraMysqlConnectionOptions } from "./AuroraMysqlConnectionOptions";
|
|
9
|
-
import { MappedColumnTypes } from "../types/MappedColumnTypes";
|
|
10
|
-
import { ColumnType } from "../types/ColumnTypes";
|
|
11
|
-
import { DataTypeDefaults } from "../types/DataTypeDefaults";
|
|
12
|
-
import { TableColumn } from "../../schema-builder/table/TableColumn";
|
|
13
|
-
import { AuroraMysqlConnectionCredentialsOptions } from "./AuroraMysqlConnectionCredentialsOptions";
|
|
3
|
+
import { ColumnMetadata } from "../../metadata/ColumnMetadata";
|
|
14
4
|
import { EntityMetadata } from "../../metadata/EntityMetadata";
|
|
15
|
-
import {
|
|
5
|
+
import { RdbmsSchemaBuilder } from "../../schema-builder/RdbmsSchemaBuilder";
|
|
16
6
|
import { Table } from "../../schema-builder/table/Table";
|
|
17
|
-
import {
|
|
7
|
+
import { TableColumn } from "../../schema-builder/table/TableColumn";
|
|
18
8
|
import { TableForeignKey } from "../../schema-builder/table/TableForeignKey";
|
|
9
|
+
import { View } from "../../schema-builder/view/View";
|
|
10
|
+
import { Driver } from "../Driver";
|
|
11
|
+
import { ColumnType, UnsignedColumnType } from "../types/ColumnTypes";
|
|
12
|
+
import { CteCapabilities } from "../types/CteCapabilities";
|
|
13
|
+
import { DataTypeDefaults } from "../types/DataTypeDefaults";
|
|
14
|
+
import { MappedColumnTypes } from "../types/MappedColumnTypes";
|
|
15
|
+
import { ReplicationMode } from "../types/ReplicationMode";
|
|
19
16
|
import { UpsertType } from "../types/UpsertType";
|
|
17
|
+
import { AuroraMysqlConnectionCredentialsOptions } from "./AuroraMysqlConnectionCredentialsOptions";
|
|
18
|
+
import { AuroraMysqlConnectionOptions } from "./AuroraMysqlConnectionOptions";
|
|
19
|
+
import { AuroraMysqlQueryRunner } from "./AuroraMysqlQueryRunner";
|
|
20
20
|
/**
|
|
21
21
|
* Organizes communication with MySQL DBMS.
|
|
22
22
|
*/
|
|
@@ -80,9 +80,9 @@ export declare class AuroraMysqlDriver implements Driver {
|
|
|
80
80
|
*/
|
|
81
81
|
withLengthColumnTypes: ColumnType[];
|
|
82
82
|
/**
|
|
83
|
-
* Gets list of column data types that support
|
|
83
|
+
* Gets list of column data types that support unsigned by a driver.
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
unsignedColumnTypes: UnsignedColumnType[];
|
|
86
86
|
/**
|
|
87
87
|
* Gets list of column data types that support precision by a driver.
|
|
88
88
|
*/
|
|
@@ -91,10 +91,6 @@ export declare class AuroraMysqlDriver implements Driver {
|
|
|
91
91
|
* Gets list of column data types that supports scale by a driver.
|
|
92
92
|
*/
|
|
93
93
|
withScaleColumnTypes: ColumnType[];
|
|
94
|
-
/**
|
|
95
|
-
* Gets list of column data types that supports UNSIGNED and ZEROFILL attributes.
|
|
96
|
-
*/
|
|
97
|
-
unsignedAndZerofillTypes: ColumnType[];
|
|
98
94
|
/**
|
|
99
95
|
* ORM has special columns and we need to know what database column types should be for those columns.
|
|
100
96
|
* Column types are driver dependant.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AuroraMysqlQueryRunner } from "./AuroraMysqlQueryRunner";
|
|
3
|
-
import { DateUtils } from "../../util/DateUtils";
|
|
1
|
+
import { TypeORMError } from "../../error";
|
|
4
2
|
import { PlatformTools } from "../../platform/PlatformTools";
|
|
5
3
|
import { RdbmsSchemaBuilder } from "../../schema-builder/RdbmsSchemaBuilder";
|
|
6
|
-
import { OrmUtils } from "../../util/OrmUtils";
|
|
7
4
|
import { ApplyValueTransformers } from "../../util/ApplyValueTransformers";
|
|
8
|
-
import {
|
|
5
|
+
import { DateUtils } from "../../util/DateUtils";
|
|
9
6
|
import { InstanceChecker } from "../../util/InstanceChecker";
|
|
7
|
+
import { OrmUtils } from "../../util/OrmUtils";
|
|
8
|
+
import { DriverUtils } from "../DriverUtils";
|
|
9
|
+
import { AuroraMysqlQueryRunner } from "./AuroraMysqlQueryRunner";
|
|
10
10
|
/**
|
|
11
11
|
* Organizes communication with MySQL DBMS.
|
|
12
12
|
*/
|
|
@@ -117,10 +117,9 @@ export class AuroraMysqlDriver {
|
|
|
117
117
|
"varbinary",
|
|
118
118
|
];
|
|
119
119
|
/**
|
|
120
|
-
* Gets list of column data types that support
|
|
120
|
+
* Gets list of column data types that support unsigned by a driver.
|
|
121
121
|
*/
|
|
122
|
-
this.
|
|
123
|
-
"bit",
|
|
122
|
+
this.unsignedColumnTypes = [
|
|
124
123
|
"tinyint",
|
|
125
124
|
"smallint",
|
|
126
125
|
"mediumint",
|
|
@@ -157,25 +156,6 @@ export class AuroraMysqlDriver {
|
|
|
157
156
|
"double precision",
|
|
158
157
|
"real",
|
|
159
158
|
];
|
|
160
|
-
/**
|
|
161
|
-
* Gets list of column data types that supports UNSIGNED and ZEROFILL attributes.
|
|
162
|
-
*/
|
|
163
|
-
this.unsignedAndZerofillTypes = [
|
|
164
|
-
"int",
|
|
165
|
-
"integer",
|
|
166
|
-
"smallint",
|
|
167
|
-
"tinyint",
|
|
168
|
-
"mediumint",
|
|
169
|
-
"bigint",
|
|
170
|
-
"decimal",
|
|
171
|
-
"dec",
|
|
172
|
-
"numeric",
|
|
173
|
-
"fixed",
|
|
174
|
-
"float",
|
|
175
|
-
"double",
|
|
176
|
-
"double precision",
|
|
177
|
-
"real",
|
|
178
|
-
];
|
|
179
159
|
/**
|
|
180
160
|
* ORM has special columns and we need to know what database column types should be for those columns.
|
|
181
161
|
* Column types are driver dependant.
|