typeorm 0.2.45-dev.3131c5c → 0.2.45-dev.ea16ac2

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.
Files changed (121) hide show
  1. package/browser/driver/Driver.d.ts +4 -0
  2. package/browser/driver/Driver.js.map +1 -1
  3. package/browser/driver/aurora-data-api/AuroraDataApiDriver.d.ts +4 -0
  4. package/browser/driver/aurora-data-api/AuroraDataApiDriver.js +4 -0
  5. package/browser/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
  6. package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +45 -14
  7. package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
  8. package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.d.ts +4 -0
  9. package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +4 -0
  10. package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
  11. package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +43 -11
  12. package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
  13. package/browser/driver/cockroachdb/CockroachDriver.d.ts +4 -0
  14. package/browser/driver/cockroachdb/CockroachDriver.js +4 -0
  15. package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
  16. package/browser/driver/cockroachdb/CockroachQueryRunner.js +79 -48
  17. package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
  18. package/browser/driver/expo/ExpoQueryRunner.js +42 -10
  19. package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
  20. package/browser/driver/mongodb/MongoDriver.d.ts +4 -0
  21. package/browser/driver/mongodb/MongoDriver.js +4 -0
  22. package/browser/driver/mongodb/MongoDriver.js.map +1 -1
  23. package/browser/driver/mysql/MysqlDriver.d.ts +4 -0
  24. package/browser/driver/mysql/MysqlDriver.js +4 -0
  25. package/browser/driver/mysql/MysqlDriver.js.map +1 -1
  26. package/browser/driver/mysql/MysqlQueryRunner.js +50 -23
  27. package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
  28. package/browser/driver/oracle/OracleDriver.d.ts +4 -0
  29. package/browser/driver/oracle/OracleDriver.js +4 -0
  30. package/browser/driver/oracle/OracleDriver.js.map +1 -1
  31. package/browser/driver/oracle/OracleQueryRunner.js +41 -14
  32. package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
  33. package/browser/driver/postgres/PostgresDriver.d.ts +4 -0
  34. package/browser/driver/postgres/PostgresDriver.js +4 -0
  35. package/browser/driver/postgres/PostgresDriver.js.map +1 -1
  36. package/browser/driver/postgres/PostgresQueryRunner.js +50 -19
  37. package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
  38. package/browser/driver/sap/SapDriver.d.ts +4 -0
  39. package/browser/driver/sap/SapDriver.js +4 -0
  40. package/browser/driver/sap/SapDriver.js.map +1 -1
  41. package/browser/driver/sap/SapQueryRunner.js +1 -1
  42. package/browser/driver/sap/SapQueryRunner.js.map +1 -1
  43. package/browser/driver/sqlite-abstract/AbstractSqliteDriver.d.ts +4 -0
  44. package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js +4 -0
  45. package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
  46. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.d.ts +1 -0
  47. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +57 -21
  48. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
  49. package/browser/driver/sqlserver/SqlServerDriver.d.ts +4 -0
  50. package/browser/driver/sqlserver/SqlServerDriver.js +4 -0
  51. package/browser/driver/sqlserver/SqlServerDriver.js.map +1 -1
  52. package/browser/driver/sqlserver/SqlServerQueryRunner.js +109 -80
  53. package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  54. package/browser/entity-manager/EntityManager.js +19 -30
  55. package/browser/entity-manager/EntityManager.js.map +1 -1
  56. package/browser/metadata/ColumnMetadata.js +7 -1
  57. package/browser/metadata/ColumnMetadata.js.map +1 -1
  58. package/browser/query-runner/BaseQueryRunner.d.ts +5 -0
  59. package/browser/query-runner/BaseQueryRunner.js +5 -0
  60. package/browser/query-runner/BaseQueryRunner.js.map +1 -1
  61. package/driver/Driver.d.ts +4 -0
  62. package/driver/Driver.js.map +1 -1
  63. package/driver/aurora-data-api/AuroraDataApiDriver.d.ts +4 -0
  64. package/driver/aurora-data-api/AuroraDataApiDriver.js +4 -0
  65. package/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
  66. package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +45 -14
  67. package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
  68. package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.d.ts +4 -0
  69. package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +4 -0
  70. package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
  71. package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +43 -11
  72. package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
  73. package/driver/cockroachdb/CockroachDriver.d.ts +4 -0
  74. package/driver/cockroachdb/CockroachDriver.js +4 -0
  75. package/driver/cockroachdb/CockroachDriver.js.map +1 -1
  76. package/driver/cockroachdb/CockroachQueryRunner.js +79 -48
  77. package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
  78. package/driver/expo/ExpoQueryRunner.js +42 -10
  79. package/driver/expo/ExpoQueryRunner.js.map +1 -1
  80. package/driver/mongodb/MongoDriver.d.ts +4 -0
  81. package/driver/mongodb/MongoDriver.js +4 -0
  82. package/driver/mongodb/MongoDriver.js.map +1 -1
  83. package/driver/mysql/MysqlDriver.d.ts +4 -0
  84. package/driver/mysql/MysqlDriver.js +4 -0
  85. package/driver/mysql/MysqlDriver.js.map +1 -1
  86. package/driver/mysql/MysqlQueryRunner.js +50 -23
  87. package/driver/mysql/MysqlQueryRunner.js.map +1 -1
  88. package/driver/oracle/OracleDriver.d.ts +4 -0
  89. package/driver/oracle/OracleDriver.js +4 -0
  90. package/driver/oracle/OracleDriver.js.map +1 -1
  91. package/driver/oracle/OracleQueryRunner.js +41 -14
  92. package/driver/oracle/OracleQueryRunner.js.map +1 -1
  93. package/driver/postgres/PostgresDriver.d.ts +4 -0
  94. package/driver/postgres/PostgresDriver.js +4 -0
  95. package/driver/postgres/PostgresDriver.js.map +1 -1
  96. package/driver/postgres/PostgresQueryRunner.js +50 -19
  97. package/driver/postgres/PostgresQueryRunner.js.map +1 -1
  98. package/driver/sap/SapDriver.d.ts +4 -0
  99. package/driver/sap/SapDriver.js +4 -0
  100. package/driver/sap/SapDriver.js.map +1 -1
  101. package/driver/sap/SapQueryRunner.js +1 -1
  102. package/driver/sap/SapQueryRunner.js.map +1 -1
  103. package/driver/sqlite-abstract/AbstractSqliteDriver.d.ts +4 -0
  104. package/driver/sqlite-abstract/AbstractSqliteDriver.js +4 -0
  105. package/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
  106. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.d.ts +1 -0
  107. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +57 -21
  108. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
  109. package/driver/sqlserver/SqlServerDriver.d.ts +4 -0
  110. package/driver/sqlserver/SqlServerDriver.js +4 -0
  111. package/driver/sqlserver/SqlServerDriver.js.map +1 -1
  112. package/driver/sqlserver/SqlServerQueryRunner.js +109 -80
  113. package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  114. package/entity-manager/EntityManager.js +19 -30
  115. package/entity-manager/EntityManager.js.map +1 -1
  116. package/metadata/ColumnMetadata.js +7 -1
  117. package/metadata/ColumnMetadata.js.map +1 -1
  118. package/package.json +1 -1
  119. package/query-runner/BaseQueryRunner.d.ts +5 -0
  120. package/query-runner/BaseQueryRunner.js +5 -0
  121. package/query-runner/BaseQueryRunner.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../browser/src/metadata/ColumnMetadata.ts"],"names":[],"mappings":";AAOA,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAC;AAEtE;;GAEG;AACH;IAySI,wEAAwE;IACxE,cAAc;IACd,wEAAwE;IAExE,wBAAY,OAUX;QA9QD;;WAEG;QACH,WAAM,GAAW,EAAE,CAAC;QAiBpB;;WAEG;QACH,cAAS,GAAY,KAAK,CAAC;QAE3B;;WAEG;QACH,gBAAW,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACH,eAAU,GAAY,KAAK,CAAC;QAE5B;;WAEG;QACH,aAAQ,GAAY,IAAI,CAAC;QAEzB;;WAEG;QACH,aAAQ,GAAY,IAAI,CAAC;QAEzB;;WAEG;QACH,aAAQ,GAAY,IAAI,CAAC;QAwCzB;;;WAGG;QACH,aAAQ,GAAY,KAAK,CAAC;QAE1B;;WAEG;QACH,aAAQ,GAAY,KAAK,CAAC;QA+B1B;;WAEG;QACH,YAAO,GAAY,KAAK,CAAC;QAuCzB;;WAEG;QACH,cAAS,GAAY,KAAK,CAAC;QAE3B;;WAEG;QACH,oBAAe,GAAY,KAAK,CAAC;QAEjC;;WAEG;QACH,gBAAW,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACH,iBAAY,GAAY,KAAK,CAAC;QAE9B;;WAEG;QACH,iBAAY,GAAY,KAAK,CAAC;QAE9B;;WAEG;QACH,iBAAY,GAAY,KAAK,CAAC;QAE9B;;WAEG;QACH,cAAS,GAAY,KAAK,CAAC;QAE3B;;WAEG;QACH,eAAU,GAAY,KAAK,CAAC;QAoB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AI,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;QACtF,IAAI,UAAU,CAAC,MAAM,YAAY,WAAW,EAAE,sEAAsE;YAChH,aAAa,GAAG,EAAE,CAAC;QACvB,OAAO,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;IAC1G,CAAC;IAEL,qBAAC;AAAD,CA1uBA,AA0uBC,IAAA","file":"ColumnMetadata.js","sourcesContent":["import {ColumnType} from \"../driver/types/ColumnTypes\";\nimport {EntityMetadata} from \"./EntityMetadata\";\nimport {EmbeddedMetadata} from \"./EmbeddedMetadata\";\nimport {RelationMetadata} from \"./RelationMetadata\";\nimport {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {ColumnMetadataArgs} from \"../metadata-args/ColumnMetadataArgs\";\nimport {Connection} from \"../connection/Connection\";\nimport {OrmUtils} from \"../util/OrmUtils\";\nimport {ValueTransformer} from \"../decorator/options/ValueTransformer\";\nimport {MongoDriver} from \"../driver/mongodb/MongoDriver\";\nimport {FindOperator} from \"../find-options/FindOperator\";\nimport {ApplyValueTransformers} from \"../util/ApplyValueTransformers\";\n\n/**\n * This metadata contains all information about entity's column.\n */\nexport class ColumnMetadata {\n\n // ---------------------------------------------------------------------\n // Public Properties\n // ---------------------------------------------------------------------\n\n /**\n * Target class where column decorator is used.\n * This may not be always equal to entity metadata (for example embeds or inheritance cases).\n */\n target: Function|string;\n\n /**\n * Entity metadata where this column metadata is.\n *\n * For example for @Column() name: string in Post, entityMetadata will be metadata of Post entity.\n */\n entityMetadata: EntityMetadata;\n\n /**\n * Embedded metadata where this column metadata is.\n * If this column is not in embed then this property value is undefined.\n */\n embeddedMetadata?: EmbeddedMetadata;\n\n /**\n * If column is a foreign key of some relation then this relation's metadata will be there.\n * If this column does not have a foreign key then this property value is undefined.\n */\n relationMetadata?: RelationMetadata;\n\n /**\n * Class's property name on which this column is applied.\n */\n propertyName: string;\n\n /**\n * The database type of the column.\n */\n type: ColumnType;\n\n /**\n * Type's length in the database.\n */\n length: string = \"\";\n\n /**\n * Type's display width in the database.\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 * Indicates if this column is a primary key.\n */\n isPrimary: boolean = false;\n\n /**\n * Indicates if this column is generated (auto increment or generated other way).\n */\n isGenerated: boolean = false;\n\n /**\n * Indicates if column can contain nulls or not.\n */\n isNullable: boolean = false;\n\n /**\n * Indicates if column is selected by query builder or not.\n */\n isSelect: boolean = true;\n\n /**\n * Indicates if column is inserted by default or not.\n */\n isInsert: boolean = true;\n\n /**\n * Indicates if column allows updates or not.\n */\n isUpdate: boolean = true;\n\n /**\n * Specifies generation strategy if this column will use auto increment.\n */\n generationStrategy?: \"uuid\"|\"increment\"|\"rowid\";\n\n /**\n * Identity column type. Supports only in Postgres 10+.\n */\n generatedIdentity?: \"ALWAYS\"|\"BY DEFAULT\";\n\n /**\n * Column comment.\n * This feature is not supported by all databases.\n */\n comment?: string;\n\n /**\n * Default database value.\n */\n default?: number | boolean | string | null | (number | boolean | string)[] | Record<string, object> | (() => string);\n\n /**\n * ON UPDATE trigger. Works only for MySQL.\n */\n onUpdate?: string;\n\n /**\n * The precision for a decimal (exact numeric) column (applies only for decimal column),\n * which is the maximum 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),\n * which represents the number 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 * `postgres` and `mysql` store enum values as strings but we want to keep support\n * for numeric and heterogeneous based typescript enums, so we need (string|number)[]\n */\n enum?: (string|number)[];\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 * 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 */\n isArray: boolean = false;\n\n /**\n * Gets full path to this column property (including column property name).\n * Full path is relevant when column is used in embeds (one or multiple nested).\n * For example it will return \"counters.subcounters.likes\".\n * If property is not in embeds then it returns just property name of the column.\n */\n propertyPath: string;\n\n /**\n * Same as property path, but dots are replaced with '_'.\n * Used in query builder statements.\n */\n propertyAliasName: string;\n\n /**\n * Gets full path to this column database name (including column database name).\n * Full path is relevant when column is used in embeds (one or multiple nested).\n * For example it will return \"counters.subcounters.likes\".\n * If property is not in embeds then it returns just database name of the column.\n */\n databasePath: string;\n\n /**\n * Complete column name in the database including its embedded prefixes.\n */\n databaseName: string;\n\n /**\n * Database name in the database without embedded prefixes applied.\n */\n databaseNameWithoutPrefixes: string;\n\n /**\n * Database name set by entity metadata builder, not yet passed naming strategy process and without embedded prefixes.\n */\n givenDatabaseName?: string;\n\n /**\n * Indicates if column is virtual. Virtual columns are not mapped to the entity.\n */\n isVirtual: boolean = false;\n\n /**\n * Indicates if column is discriminator. Discriminator columns are not mapped to the entity.\n */\n isDiscriminator: boolean = false;\n\n /**\n * Indicates if column is tree-level column. Tree-level columns are used in closure entities.\n */\n isTreeLevel: boolean = false;\n\n /**\n * Indicates if this column contains an entity creation date.\n */\n isCreateDate: boolean = false;\n\n /**\n * Indicates if this column contains an entity update date.\n */\n isUpdateDate: boolean = false;\n\n /**\n * Indicates if this column contains an entity delete date.\n */\n isDeleteDate: boolean = false;\n\n /**\n * Indicates if this column contains an entity version.\n */\n isVersion: boolean = false;\n\n /**\n * Indicates if this column contains an object id.\n */\n isObjectId: boolean = false;\n\n /**\n * If this column is foreign key then it references some other column,\n * and this property will contain reference to this column.\n */\n referencedColumn: ColumnMetadata|undefined;\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 * Column type in the case if this column is in the closure table.\n * Column can be ancestor or descendant in the closure tables.\n */\n closureType?: \"ancestor\"|\"descendant\";\n\n /**\n * Indicates if this column is nested set's left column.\n * Used only in tree entities with nested-set type.\n */\n isNestedSetLeft: boolean = false;\n\n /**\n * Indicates if this column is nested set's right column.\n * Used only in tree entities with nested-set type.\n */\n isNestedSetRight: boolean = false;\n\n /**\n * Indicates if this column is materialized path's path column.\n * Used only in tree entities with materialized path type.\n */\n isMaterializedPath: boolean = false;\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: {\n connection: Connection,\n entityMetadata: EntityMetadata,\n embeddedMetadata?: EmbeddedMetadata,\n referencedColumn?: ColumnMetadata,\n args: ColumnMetadataArgs,\n closureType?: \"ancestor\"|\"descendant\",\n nestedSetLeft?: boolean,\n nestedSetRight?: boolean,\n materializedPath?: boolean,\n }) {\n this.entityMetadata = options.entityMetadata;\n this.embeddedMetadata = options.embeddedMetadata!;\n this.referencedColumn = options.referencedColumn;\n if (options.args.target)\n this.target = options.args.target;\n if (options.args.propertyName)\n this.propertyName = options.args.propertyName;\n if (options.args.options.name)\n this.givenDatabaseName = options.args.options.name;\n if (options.args.options.type)\n this.type = options.args.options.type;\n if (options.args.options.length)\n this.length = options.args.options.length ? options.args.options.length.toString() : \"\";\n if (options.args.options.width)\n this.width = options.args.options.width;\n if (options.args.options.charset)\n this.charset = options.args.options.charset;\n if (options.args.options.collation)\n this.collation = options.args.options.collation;\n if (options.args.options.primary)\n this.isPrimary = options.args.options.primary;\n if (options.args.options.default === null) // to make sure default: null is the same as nullable: true\n this.isNullable = true;\n if (options.args.options.nullable !== undefined)\n this.isNullable = options.args.options.nullable;\n if (options.args.options.select !== undefined)\n this.isSelect = options.args.options.select;\n if (options.args.options.insert !== undefined)\n this.isInsert = options.args.options.insert;\n if (options.args.options.update !== undefined)\n this.isUpdate = options.args.options.update;\n if (options.args.options.readonly !== undefined)\n this.isUpdate = !options.args.options.readonly;\n if (options.args.options.comment)\n this.comment = options.args.options.comment;\n if (options.args.options.default !== undefined)\n this.default = options.args.options.default;\n if (options.args.options.onUpdate)\n this.onUpdate = options.args.options.onUpdate;\n if (options.args.options.generatedIdentity)\n this.generatedIdentity = options.args.options.generatedIdentity;\n if (options.args.options.scale !== null && options.args.options.scale !== undefined)\n this.scale = options.args.options.scale;\n if (options.args.options.zerofill) {\n this.zerofill = options.args.options.zerofill;\n this.unsigned = true; // if you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column\n }\n if (options.args.options.unsigned)\n this.unsigned = options.args.options.unsigned;\n if (options.args.options.precision !== null)\n this.precision = options.args.options.precision;\n if (options.args.options.enum) {\n if (options.args.options.enum instanceof Object && !Array.isArray(options.args.options.enum)) {\n this.enum = Object.keys(options.args.options.enum)\n // remove numeric keys - typescript numeric enum types generate them\n // From the documentation: “declaration merging” means that the compiler merges two separate declarations\n // declared with the same name into a single definition. This concept is often used to merge enum with namespace\n // where in namespace we define e.g. utility methods for creating enum. This is well known in other languages\n // like Java (enum methods). Here in case if enum have function, we need to remove it from metadata, otherwise\n // generated SQL statements contains string representation of that function which leads into syntax error\n // at database side.\n .filter(key => isNaN(+key) && typeof (options.args.options.enum as ObjectLiteral)[key] !== \"function\")\n .map(key => (options.args.options.enum as ObjectLiteral)[key]);\n\n } else {\n this.enum = options.args.options.enum;\n }\n }\n if (options.args.options.enumName) {\n this.enumName = options.args.options.enumName;\n }\n if (options.args.options.asExpression) {\n this.asExpression = options.args.options.asExpression;\n this.generatedType = options.args.options.generatedType ? options.args.options.generatedType : \"VIRTUAL\";\n }\n if (options.args.options.hstoreType)\n this.hstoreType = options.args.options.hstoreType;\n if (options.args.options.array)\n this.isArray = options.args.options.array;\n if (options.args.mode) {\n this.isVirtual = options.args.mode === \"virtual\";\n this.isTreeLevel = options.args.mode === \"treeLevel\";\n this.isCreateDate = options.args.mode === \"createDate\";\n this.isUpdateDate = options.args.mode === \"updateDate\";\n this.isDeleteDate = options.args.mode === \"deleteDate\";\n this.isVersion = options.args.mode === \"version\";\n this.isObjectId = options.args.mode === \"objectId\";\n }\n if (options.args.options.transformer)\n this.transformer = options.args.options.transformer;\n if (options.args.options.spatialFeatureType)\n this.spatialFeatureType = options.args.options.spatialFeatureType;\n if (options.args.options.srid !== undefined)\n this.srid = options.args.options.srid;\n if (this.isTreeLevel)\n this.type = options.connection.driver.mappedDataTypes.treeLevel;\n if (this.isCreateDate) {\n if (!this.type)\n this.type = options.connection.driver.mappedDataTypes.createDate;\n if (!this.default)\n this.default = () => options.connection.driver.mappedDataTypes.createDateDefault;\n // skip precision if it was explicitly set to \"null\" in column options. Otherwise use default precision if it exist.\n if (this.precision === undefined && options.args.options.precision === undefined && options.connection.driver.mappedDataTypes.createDatePrecision)\n this.precision = options.connection.driver.mappedDataTypes.createDatePrecision;\n }\n if (this.isUpdateDate) {\n if (!this.type)\n this.type = options.connection.driver.mappedDataTypes.updateDate;\n if (!this.default)\n this.default = () => options.connection.driver.mappedDataTypes.updateDateDefault;\n if (!this.onUpdate)\n this.onUpdate = options.connection.driver.mappedDataTypes.updateDateDefault;\n // skip precision if it was explicitly set to \"null\" in column options. Otherwise use default precision if it exist.\n if (this.precision === undefined && options.args.options.precision === undefined && options.connection.driver.mappedDataTypes.updateDatePrecision)\n this.precision = options.connection.driver.mappedDataTypes.updateDatePrecision;\n }\n if (this.isDeleteDate) {\n if (!this.type)\n this.type = options.connection.driver.mappedDataTypes.deleteDate;\n if (!this.isNullable)\n this.isNullable = options.connection.driver.mappedDataTypes.deleteDateNullable;\n // skip precision if it was explicitly set to \"null\" in column options. Otherwise use default precision if it exist.\n if (this.precision === undefined && options.args.options.precision === undefined && options.connection.driver.mappedDataTypes.deleteDatePrecision)\n this.precision = options.connection.driver.mappedDataTypes.deleteDatePrecision;\n }\n if (this.isVersion)\n this.type = options.connection.driver.mappedDataTypes.version;\n if (options.closureType)\n this.closureType = options.closureType;\n if (options.nestedSetLeft)\n this.isNestedSetLeft = options.nestedSetLeft;\n if (options.nestedSetRight)\n this.isNestedSetRight = options.nestedSetRight;\n if (options.materializedPath)\n this.isMaterializedPath = options.materializedPath;\n }\n\n // ---------------------------------------------------------------------\n // Public Methods\n // ---------------------------------------------------------------------\n\n /**\n * Creates entity id map from the given entity ids array.\n */\n createValueMap(value: any, useDatabaseName = false) {\n\n // extract column value from embeds of entity if column is in embedded\n if (this.embeddedMetadata) {\n\n // example: post[data][information][counters].id where \"data\", \"information\" and \"counters\" are embeddeds\n // we need to get value of \"id\" column from the post real entity object and return it in a\n // { data: { information: { counters: { id: ... } } } } format\n\n // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n const propertyNames = [...this.embeddedMetadata.parentPropertyNames];\n\n // now need to access post[data][information][counters] to get column value from the counters\n // and on each step we need to create complex literal object, e.g. first { data },\n // then { data: { information } }, then { data: { information: { counters } } },\n // then { data: { information: { counters: [this.propertyName]: entity[data][information][counters][this.propertyName] } } }\n // this recursive function helps doing that\n const extractEmbeddedColumnValue = (propertyNames: string[], map: ObjectLiteral): any => {\n const propertyName = propertyNames.shift();\n if (propertyName) {\n map[propertyName] = {};\n extractEmbeddedColumnValue(propertyNames, map[propertyName]);\n return map;\n }\n\n // this is bugfix for #720 when increment number is bigint we need to make sure its a string\n if ((this.generationStrategy === \"increment\" || this.generationStrategy === \"rowid\") && this.type === \"bigint\" && value !== null)\n value = String(value);\n\n map[useDatabaseName ? this.databaseName : this.propertyName] = value;\n return map;\n };\n return extractEmbeddedColumnValue(propertyNames, {});\n\n } else { // no embeds - no problems. Simply return column property name and its value of the entity\n\n // this is bugfix for #720 when increment number is bigint we need to make sure its a string\n if ((this.generationStrategy === \"increment\" || this.generationStrategy === \"rowid\") && this.type === \"bigint\" && value !== null)\n value = String(value);\n\n return { [useDatabaseName ? this.databaseName : this.propertyName]: value };\n }\n }\n\n /**\n * Extracts column value and returns its column name with this value in a literal object.\n * If column is in embedded (or recursive embedded) it returns complex literal object.\n *\n * Examples what this method can return depend if this column is in embeds.\n * { id: 1 } or { title: \"hello\" }, { counters: { code: 1 } }, { data: { information: { counters: { code: 1 } } } }\n */\n getEntityValueMap(entity: ObjectLiteral, options?: { skipNulls?: boolean }): ObjectLiteral|undefined {\n const returnNulls = false; // options && options.skipNulls === false ? false : true; // todo: remove if current will not bring problems, uncomment if it will.\n\n // extract column value from embeds of entity if column is in embedded\n if (this.embeddedMetadata) {\n\n // example: post[data][information][counters].id where \"data\", \"information\" and \"counters\" are embeddeds\n // we need to get value of \"id\" column from the post real entity object and return it in a\n // { data: { information: { counters: { id: ... } } } } format\n\n // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n const propertyNames = [...this.embeddedMetadata.parentPropertyNames];\n const isEmbeddedArray = this.embeddedMetadata.isArray;\n\n // now need to access post[data][information][counters] to get column value from the counters\n // and on each step we need to create complex literal object, e.g. first { data },\n // then { data: { information } }, then { data: { information: { counters } } },\n // then { data: { information: { counters: [this.propertyName]: entity[data][information][counters][this.propertyName] } } }\n // this recursive function helps doing that\n const extractEmbeddedColumnValue = (propertyNames: string[], value: ObjectLiteral): ObjectLiteral => {\n if (value === undefined) {\n return {};\n }\n\n const propertyName = propertyNames.shift();\n\n if (propertyName) {\n const submap = extractEmbeddedColumnValue(propertyNames, value[propertyName]);\n if (Object.keys(submap).length > 0) {\n return { [propertyName]: submap };\n }\n return {};\n }\n\n if (isEmbeddedArray && Array.isArray(value)) {\n return value.map(v => ({ [this.propertyName]: v[this.propertyName] }));\n }\n\n if (value[this.propertyName] !== undefined && (returnNulls === false || value[this.propertyName] !== null)) {\n return { [this.propertyName]: value[this.propertyName] };\n }\n\n return {};\n };\n const map = extractEmbeddedColumnValue(propertyNames, entity);\n\n return Object.keys(map).length > 0 ? map : undefined;\n\n } else { // no embeds - no problems. Simply return column property name and its value of the entity\n if (this.relationMetadata && entity[this.relationMetadata.propertyName] && entity[this.relationMetadata.propertyName] instanceof Object) {\n const map = this.relationMetadata.joinColumns.reduce((map, joinColumn) => {\n const value = joinColumn.referencedColumn!.getEntityValueMap(entity[this.relationMetadata!.propertyName]);\n if (value === undefined) return map;\n return OrmUtils.mergeDeep(map, value);\n }, {});\n if (Object.keys(map).length > 0)\n return { [this.propertyName]: map };\n\n return undefined;\n } else {\n if (entity[this.propertyName] !== undefined && (returnNulls === false || entity[this.propertyName] !== null))\n return { [this.propertyName]: entity[this.propertyName] };\n\n return undefined;\n }\n }\n }\n\n /**\n * Extracts column value from the given entity.\n * If column is in embedded (or recursive embedded) it extracts its value from there.\n */\n getEntityValue(entity: ObjectLiteral, transform: boolean = false): any|undefined {\n if (entity === undefined || entity === null) return undefined;\n\n // extract column value from embeddeds of entity if column is in embedded\n let value: any = undefined;\n if (this.embeddedMetadata) {\n\n // example: post[data][information][counters].id where \"data\", \"information\" and \"counters\" are embeddeds\n // we need to get value of \"id\" column from the post real entity object\n\n // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n const propertyNames = [...this.embeddedMetadata.parentPropertyNames];\n const isEmbeddedArray = this.embeddedMetadata.isArray;\n\n // next we need to access post[data][information][counters][this.propertyName] to get column value from the counters\n // this recursive function takes array of generated property names and gets the post[data][information][counters] embed\n const extractEmbeddedColumnValue = (propertyNames: string[], value: ObjectLiteral): any => {\n const propertyName = propertyNames.shift();\n return propertyName && value ? extractEmbeddedColumnValue(propertyNames, value[propertyName]) : value;\n };\n\n // once we get nested embed object we get its column, e.g. post[data][information][counters][this.propertyName]\n const embeddedObject = extractEmbeddedColumnValue(propertyNames, entity);\n if (embeddedObject) {\n if (this.relationMetadata && this.referencedColumn) {\n const relatedEntity = this.relationMetadata.getEntityValue(embeddedObject);\n if (relatedEntity && relatedEntity instanceof Object && !(relatedEntity instanceof FindOperator) && !(relatedEntity instanceof Buffer)) {\n value = this.referencedColumn.getEntityValue(relatedEntity);\n\n } else if (embeddedObject[this.propertyName] && embeddedObject[this.propertyName] instanceof Object && !(embeddedObject[this.propertyName] instanceof FindOperator) && !(embeddedObject[this.propertyName] instanceof Buffer) && !(embeddedObject[this.propertyName] instanceof Date)) {\n value = this.referencedColumn.getEntityValue(embeddedObject[this.propertyName]);\n\n } else {\n value = embeddedObject[this.propertyName];\n\n }\n\n } else if (this.referencedColumn) {\n value = this.referencedColumn.getEntityValue(embeddedObject[this.propertyName]);\n\n } else if (isEmbeddedArray && Array.isArray(embeddedObject)) {\n value = embeddedObject.map(o => o[this.propertyName]);\n } else {\n value = embeddedObject[this.propertyName];\n }\n }\n\n } else { // no embeds - no problems. Simply return column name by property name of the entity\n if (this.relationMetadata && this.referencedColumn) {\n const relatedEntity = this.relationMetadata.getEntityValue(entity);\n if (relatedEntity && relatedEntity instanceof Object && !(relatedEntity instanceof FindOperator) && !(relatedEntity instanceof Function) && !(relatedEntity instanceof Buffer)) {\n value = this.referencedColumn.getEntityValue(relatedEntity);\n\n } else if (entity[this.propertyName] && entity[this.propertyName] instanceof Object && !(entity[this.propertyName] instanceof FindOperator) && !(entity[this.propertyName] instanceof Function) && !(entity[this.propertyName] instanceof Buffer) && !(entity[this.propertyName] instanceof Date)) {\n value = this.referencedColumn.getEntityValue(entity[this.propertyName]);\n\n } else {\n value = entity[this.propertyName];\n }\n\n } else if (this.referencedColumn) {\n value = this.referencedColumn.getEntityValue(entity[this.propertyName]);\n\n } else {\n value = entity[this.propertyName];\n }\n }\n\n if (transform && this.transformer)\n value = ApplyValueTransformers.transformTo(this.transformer, value);\n\n return value;\n }\n\n /**\n * Sets given entity's column value.\n * Using of this method helps to set entity relation's value of the lazy and non-lazy relations.\n */\n setEntityValue(entity: ObjectLiteral, value: any): void {\n if (this.embeddedMetadata) {\n\n // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n const extractEmbeddedColumnValue = (embeddedMetadatas: EmbeddedMetadata[], map: ObjectLiteral): any => {\n // if (!object[embeddedMetadata.propertyName])\n // object[embeddedMetadata.propertyName] = embeddedMetadata.create();\n\n const embeddedMetadata = embeddedMetadatas.shift();\n if (embeddedMetadata) {\n if (!map[embeddedMetadata.propertyName])\n map[embeddedMetadata.propertyName] = embeddedMetadata.create();\n\n extractEmbeddedColumnValue(embeddedMetadatas, map[embeddedMetadata.propertyName]);\n return map;\n }\n map[this.propertyName] = value;\n return map;\n };\n return extractEmbeddedColumnValue([...this.embeddedMetadata.embeddedMetadataTree], entity);\n\n } else {\n // we write a deep object in this entity only if the column is virtual\n // because if its not virtual it means the user defined a real column for this relation\n // also we don't do it if column is inside a junction table\n if (!this.entityMetadata.isJunction && this.isVirtual && this.referencedColumn && this.referencedColumn.propertyName !== this.propertyName) {\n if (!(this.propertyName in entity)) {\n entity[this.propertyName] = {};\n }\n\n entity[this.propertyName][this.referencedColumn.propertyName] = value;\n } else {\n entity[this.propertyName] = value;\n }\n }\n }\n\n // ---------------------------------------------------------------------\n // Builder Methods\n // ---------------------------------------------------------------------\n\n build(connection: Connection): this {\n this.propertyPath = this.buildPropertyPath();\n this.propertyAliasName = this.propertyPath.replace(\".\", \"_\");\n this.databaseName = this.buildDatabaseName(connection);\n this.databasePath = this.buildDatabasePath();\n this.databaseNameWithoutPrefixes = connection.namingStrategy.columnName(this.propertyName, this.givenDatabaseName, []);\n return this;\n }\n\n protected buildPropertyPath(): string {\n let path = \"\";\n if (this.embeddedMetadata && this.embeddedMetadata.parentPropertyNames.length)\n path = this.embeddedMetadata.parentPropertyNames.join(\".\") + \".\";\n\n path += this.propertyName;\n\n // we add reference column to property path only if this column is virtual\n // because if its not virtual it means user defined a real column for this relation\n // also we don't do it if column is inside a junction table\n if (!this.entityMetadata.isJunction && this.isVirtual && this.referencedColumn && this.referencedColumn.propertyName !== this.propertyName)\n path += \".\" + this.referencedColumn.propertyName;\n\n return path;\n }\n\n protected buildDatabasePath(): string {\n let path = \"\";\n if (this.embeddedMetadata && this.embeddedMetadata.parentPropertyNames.length)\n path = this.embeddedMetadata.parentPropertyNames.join(\".\") + \".\";\n\n path += this.databaseName;\n\n // we add reference column to property path only if this column is virtual\n // because if its not virtual it means user defined a real column for this relation\n // also we don't do it if column is inside a junction table\n if (!this.entityMetadata.isJunction && this.isVirtual && this.referencedColumn && this.referencedColumn.databaseName !== this.databaseName)\n path += \".\" + this.referencedColumn.databaseName;\n\n return path;\n }\n\n protected buildDatabaseName(connection: Connection): string {\n let propertyNames = this.embeddedMetadata ? this.embeddedMetadata.parentPrefixes : [];\n if (connection.driver instanceof MongoDriver) // we don't need to include embedded name for the mongodb column names\n propertyNames = [];\n return connection.namingStrategy.columnName(this.propertyName, this.givenDatabaseName, propertyNames);\n }\n\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../browser/src/metadata/ColumnMetadata.ts"],"names":[],"mappings":";AAOA,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAC;AAEtE;;GAEG;AACH;IAySI,wEAAwE;IACxE,cAAc;IACd,wEAAwE;IAExE,wBAAY,OAUX;QA9QD;;WAEG;QACH,WAAM,GAAW,EAAE,CAAC;QAiBpB;;WAEG;QACH,cAAS,GAAY,KAAK,CAAC;QAE3B;;WAEG;QACH,gBAAW,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACH,eAAU,GAAY,KAAK,CAA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\nimport {EmbeddedMetadata} from \"./EmbeddedMetadata\";\nimport {RelationMetadata} from \"./RelationMetadata\";\nimport {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {ColumnMetadataArgs} from \"../metadata-args/ColumnMetadataArgs\";\nimport {Connection} from \"../connection/Connection\";\nimport {OrmUtils} from \"../util/OrmUtils\";\nimport {ValueTransformer} from \"../decorator/options/ValueTransformer\";\nimport {MongoDriver} from \"../driver/mongodb/MongoDriver\";\nimport {FindOperator} from \"../find-options/FindOperator\";\nimport {ApplyValueTransformers} from \"../util/ApplyValueTransformers\";\n\n/**\n * This metadata contains all information about entity's column.\n */\nexport class ColumnMetadata {\n\n // ---------------------------------------------------------------------\n // Public Properties\n // ---------------------------------------------------------------------\n\n /**\n * Target class where column decorator is used.\n * This may not be always equal to entity metadata (for example embeds or inheritance cases).\n */\n target: Function|string;\n\n /**\n * Entity metadata where this column metadata is.\n *\n * For example for @Column() name: string in Post, entityMetadata will be metadata of Post entity.\n */\n entityMetadata: EntityMetadata;\n\n /**\n * Embedded metadata where this column metadata is.\n * If this column is not in embed then this property value is undefined.\n */\n embeddedMetadata?: EmbeddedMetadata;\n\n /**\n * If column is a foreign key of some relation then this relation's metadata will be there.\n * If this column does not have a foreign key then this property value is undefined.\n */\n relationMetadata?: RelationMetadata;\n\n /**\n * Class's property name on which this column is applied.\n */\n propertyName: string;\n\n /**\n * The database type of the column.\n */\n type: ColumnType;\n\n /**\n * Type's length in the database.\n */\n length: string = \"\";\n\n /**\n * Type's display width in the database.\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 * Indicates if this column is a primary key.\n */\n isPrimary: boolean = false;\n\n /**\n * Indicates if this column is generated (auto increment or generated other way).\n */\n isGenerated: boolean = false;\n\n /**\n * Indicates if column can contain nulls or not.\n */\n isNullable: boolean = false;\n\n /**\n * Indicates if column is selected by query builder or not.\n */\n isSelect: boolean = true;\n\n /**\n * Indicates if column is inserted by default or not.\n */\n isInsert: boolean = true;\n\n /**\n * Indicates if column allows updates or not.\n */\n isUpdate: boolean = true;\n\n /**\n * Specifies generation strategy if this column will use auto increment.\n */\n generationStrategy?: \"uuid\"|\"increment\"|\"rowid\";\n\n /**\n * Identity column type. Supports only in Postgres 10+.\n */\n generatedIdentity?: \"ALWAYS\"|\"BY DEFAULT\";\n\n /**\n * Column comment.\n * This feature is not supported by all databases.\n */\n comment?: string;\n\n /**\n * Default database value.\n */\n default?: number | boolean | string | null | (number | boolean | string)[] | Record<string, object> | (() => string);\n\n /**\n * ON UPDATE trigger. Works only for MySQL.\n */\n onUpdate?: string;\n\n /**\n * The precision for a decimal (exact numeric) column (applies only for decimal column),\n * which is the maximum 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),\n * which represents the number 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 * `postgres` and `mysql` store enum values as strings but we want to keep support\n * for numeric and heterogeneous based typescript enums, so we need (string|number)[]\n */\n enum?: (string|number)[];\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 * 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 */\n isArray: boolean = false;\n\n /**\n * Gets full path to this column property (including column property name).\n * Full path is relevant when column is used in embeds (one or multiple nested).\n * For example it will return \"counters.subcounters.likes\".\n * If property is not in embeds then it returns just property name of the column.\n */\n propertyPath: string;\n\n /**\n * Same as property path, but dots are replaced with '_'.\n * Used in query builder statements.\n */\n propertyAliasName: string;\n\n /**\n * Gets full path to this column database name (including column database name).\n * Full path is relevant when column is used in embeds (one or multiple nested).\n * For example it will return \"counters.subcounters.likes\".\n * If property is not in embeds then it returns just database name of the column.\n */\n databasePath: string;\n\n /**\n * Complete column name in the database including its embedded prefixes.\n */\n databaseName: string;\n\n /**\n * Database name in the database without embedded prefixes applied.\n */\n databaseNameWithoutPrefixes: string;\n\n /**\n * Database name set by entity metadata builder, not yet passed naming strategy process and without embedded prefixes.\n */\n givenDatabaseName?: string;\n\n /**\n * Indicates if column is virtual. Virtual columns are not mapped to the entity.\n */\n isVirtual: boolean = false;\n\n /**\n * Indicates if column is discriminator. Discriminator columns are not mapped to the entity.\n */\n isDiscriminator: boolean = false;\n\n /**\n * Indicates if column is tree-level column. Tree-level columns are used in closure entities.\n */\n isTreeLevel: boolean = false;\n\n /**\n * Indicates if this column contains an entity creation date.\n */\n isCreateDate: boolean = false;\n\n /**\n * Indicates if this column contains an entity update date.\n */\n isUpdateDate: boolean = false;\n\n /**\n * Indicates if this column contains an entity delete date.\n */\n isDeleteDate: boolean = false;\n\n /**\n * Indicates if this column contains an entity version.\n */\n isVersion: boolean = false;\n\n /**\n * Indicates if this column contains an object id.\n */\n isObjectId: boolean = false;\n\n /**\n * If this column is foreign key then it references some other column,\n * and this property will contain reference to this column.\n */\n referencedColumn: ColumnMetadata|undefined;\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 * Column type in the case if this column is in the closure table.\n * Column can be ancestor or descendant in the closure tables.\n */\n closureType?: \"ancestor\"|\"descendant\";\n\n /**\n * Indicates if this column is nested set's left column.\n * Used only in tree entities with nested-set type.\n */\n isNestedSetLeft: boolean = false;\n\n /**\n * Indicates if this column is nested set's right column.\n * Used only in tree entities with nested-set type.\n */\n isNestedSetRight: boolean = false;\n\n /**\n * Indicates if this column is materialized path's path column.\n * Used only in tree entities with materialized path type.\n */\n isMaterializedPath: boolean = false;\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: {\n connection: Connection,\n entityMetadata: EntityMetadata,\n embeddedMetadata?: EmbeddedMetadata,\n referencedColumn?: ColumnMetadata,\n args: ColumnMetadataArgs,\n closureType?: \"ancestor\"|\"descendant\",\n nestedSetLeft?: boolean,\n nestedSetRight?: boolean,\n materializedPath?: boolean,\n }) {\n this.entityMetadata = options.entityMetadata;\n this.embeddedMetadata = options.embeddedMetadata!;\n this.referencedColumn = options.referencedColumn;\n if (options.args.target)\n this.target = options.args.target;\n if (options.args.propertyName)\n this.propertyName = options.args.propertyName;\n if (options.args.options.name)\n this.givenDatabaseName = options.args.options.name;\n if (options.args.options.type)\n this.type = options.args.options.type;\n if (options.args.options.length)\n this.length = options.args.options.length ? options.args.options.length.toString() : \"\";\n if (options.args.options.width)\n this.width = options.args.options.width;\n if (options.args.options.charset)\n this.charset = options.args.options.charset;\n if (options.args.options.collation)\n this.collation = options.args.options.collation;\n if (options.args.options.primary)\n this.isPrimary = options.args.options.primary;\n if (options.args.options.default === null) // to make sure default: null is the same as nullable: true\n this.isNullable = true;\n if (options.args.options.nullable !== undefined)\n this.isNullable = options.args.options.nullable;\n if (options.args.options.select !== undefined)\n this.isSelect = options.args.options.select;\n if (options.args.options.insert !== undefined)\n this.isInsert = options.args.options.insert;\n if (options.args.options.update !== undefined)\n this.isUpdate = options.args.options.update;\n if (options.args.options.readonly !== undefined)\n this.isUpdate = !options.args.options.readonly;\n if (options.args.options.comment)\n this.comment = options.args.options.comment;\n if (options.args.options.default !== undefined)\n this.default = options.args.options.default;\n if (options.args.options.onUpdate)\n this.onUpdate = options.args.options.onUpdate;\n if (options.args.options.generatedIdentity)\n this.generatedIdentity = options.args.options.generatedIdentity;\n if (options.args.options.scale !== null && options.args.options.scale !== undefined)\n this.scale = options.args.options.scale;\n if (options.args.options.zerofill) {\n this.zerofill = options.args.options.zerofill;\n this.unsigned = true; // if you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column\n }\n if (options.args.options.unsigned)\n this.unsigned = options.args.options.unsigned;\n if (options.args.options.precision !== null)\n this.precision = options.args.options.precision;\n if (options.args.options.enum) {\n if (options.args.options.enum instanceof Object && !Array.isArray(options.args.options.enum)) {\n this.enum = Object.keys(options.args.options.enum)\n // remove numeric keys - typescript numeric enum types generate them\n // From the documentation: “declaration merging” means that the compiler merges two separate declarations\n // declared with the same name into a single definition. This concept is often used to merge enum with namespace\n // where in namespace we define e.g. utility methods for creating enum. This is well known in other languages\n // like Java (enum methods). Here in case if enum have function, we need to remove it from metadata, otherwise\n // generated SQL statements contains string representation of that function which leads into syntax error\n // at database side.\n .filter(key => isNaN(+key) && typeof (options.args.options.enum as ObjectLiteral)[key] !== \"function\")\n .map(key => (options.args.options.enum as ObjectLiteral)[key]);\n\n } else {\n this.enum = options.args.options.enum;\n }\n }\n if (options.args.options.enumName) {\n this.enumName = options.args.options.enumName;\n }\n if (options.args.options.asExpression) {\n this.asExpression = options.args.options.asExpression;\n this.generatedType = options.args.options.generatedType ? options.args.options.generatedType : \"VIRTUAL\";\n }\n if (options.args.options.hstoreType)\n this.hstoreType = options.args.options.hstoreType;\n if (options.args.options.array)\n this.isArray = options.args.options.array;\n if (options.args.mode) {\n this.isVirtual = options.args.mode === \"virtual\";\n this.isTreeLevel = options.args.mode === \"treeLevel\";\n this.isCreateDate = options.args.mode === \"createDate\";\n this.isUpdateDate = options.args.mode === \"updateDate\";\n this.isDeleteDate = options.args.mode === \"deleteDate\";\n this.isVersion = options.args.mode === \"version\";\n this.isObjectId = options.args.mode === \"objectId\";\n }\n if (options.args.options.transformer)\n this.transformer = options.args.options.transformer;\n if (options.args.options.spatialFeatureType)\n this.spatialFeatureType = options.args.options.spatialFeatureType;\n if (options.args.options.srid !== undefined)\n this.srid = options.args.options.srid;\n if (this.isTreeLevel)\n this.type = options.connection.driver.mappedDataTypes.treeLevel;\n if (this.isCreateDate) {\n if (!this.type)\n this.type = options.connection.driver.mappedDataTypes.createDate;\n if (!this.default)\n this.default = () => options.connection.driver.mappedDataTypes.createDateDefault;\n // skip precision if it was explicitly set to \"null\" in column options. Otherwise use default precision if it exist.\n if (this.precision === undefined && options.args.options.precision === undefined && options.connection.driver.mappedDataTypes.createDatePrecision)\n this.precision = options.connection.driver.mappedDataTypes.createDatePrecision;\n }\n if (this.isUpdateDate) {\n if (!this.type)\n this.type = options.connection.driver.mappedDataTypes.updateDate;\n if (!this.default)\n this.default = () => options.connection.driver.mappedDataTypes.updateDateDefault;\n if (!this.onUpdate)\n this.onUpdate = options.connection.driver.mappedDataTypes.updateDateDefault;\n // skip precision if it was explicitly set to \"null\" in column options. Otherwise use default precision if it exist.\n if (this.precision === undefined && options.args.options.precision === undefined && options.connection.driver.mappedDataTypes.updateDatePrecision)\n this.precision = options.connection.driver.mappedDataTypes.updateDatePrecision;\n }\n if (this.isDeleteDate) {\n if (!this.type)\n this.type = options.connection.driver.mappedDataTypes.deleteDate;\n if (!this.isNullable)\n this.isNullable = options.connection.driver.mappedDataTypes.deleteDateNullable;\n // skip precision if it was explicitly set to \"null\" in column options. Otherwise use default precision if it exist.\n if (this.precision === undefined && options.args.options.precision === undefined && options.connection.driver.mappedDataTypes.deleteDatePrecision)\n this.precision = options.connection.driver.mappedDataTypes.deleteDatePrecision;\n }\n if (this.isVersion)\n this.type = options.connection.driver.mappedDataTypes.version;\n if (options.closureType)\n this.closureType = options.closureType;\n if (options.nestedSetLeft)\n this.isNestedSetLeft = options.nestedSetLeft;\n if (options.nestedSetRight)\n this.isNestedSetRight = options.nestedSetRight;\n if (options.materializedPath)\n this.isMaterializedPath = options.materializedPath;\n }\n\n // ---------------------------------------------------------------------\n // Public Methods\n // ---------------------------------------------------------------------\n\n /**\n * Creates entity id map from the given entity ids array.\n */\n createValueMap(value: any, useDatabaseName = false) {\n\n // extract column value from embeds of entity if column is in embedded\n if (this.embeddedMetadata) {\n\n // example: post[data][information][counters].id where \"data\", \"information\" and \"counters\" are embeddeds\n // we need to get value of \"id\" column from the post real entity object and return it in a\n // { data: { information: { counters: { id: ... } } } } format\n\n // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n const propertyNames = [...this.embeddedMetadata.parentPropertyNames];\n\n // now need to access post[data][information][counters] to get column value from the counters\n // and on each step we need to create complex literal object, e.g. first { data },\n // then { data: { information } }, then { data: { information: { counters } } },\n // then { data: { information: { counters: [this.propertyName]: entity[data][information][counters][this.propertyName] } } }\n // this recursive function helps doing that\n const extractEmbeddedColumnValue = (propertyNames: string[], map: ObjectLiteral): any => {\n const propertyName = propertyNames.shift();\n if (propertyName) {\n map[propertyName] = {};\n extractEmbeddedColumnValue(propertyNames, map[propertyName]);\n return map;\n }\n\n // this is bugfix for #720 when increment number is bigint we need to make sure its a string\n if ((this.generationStrategy === \"increment\" || this.generationStrategy === \"rowid\") && this.type === \"bigint\" && value !== null)\n value = String(value);\n\n map[useDatabaseName ? this.databaseName : this.propertyName] = value;\n return map;\n };\n return extractEmbeddedColumnValue(propertyNames, {});\n\n } else { // no embeds - no problems. Simply return column property name and its value of the entity\n\n // this is bugfix for #720 when increment number is bigint we need to make sure its a string\n if ((this.generationStrategy === \"increment\" || this.generationStrategy === \"rowid\") && this.type === \"bigint\" && value !== null)\n value = String(value);\n\n return { [useDatabaseName ? this.databaseName : this.propertyName]: value };\n }\n }\n\n /**\n * Extracts column value and returns its column name with this value in a literal object.\n * If column is in embedded (or recursive embedded) it returns complex literal object.\n *\n * Examples what this method can return depend if this column is in embeds.\n * { id: 1 } or { title: \"hello\" }, { counters: { code: 1 } }, { data: { information: { counters: { code: 1 } } } }\n */\n getEntityValueMap(entity: ObjectLiteral, options?: { skipNulls?: boolean }): ObjectLiteral|undefined {\n const returnNulls = false; // options && options.skipNulls === false ? false : true; // todo: remove if current will not bring problems, uncomment if it will.\n\n // extract column value from embeds of entity if column is in embedded\n if (this.embeddedMetadata) {\n\n // example: post[data][information][counters].id where \"data\", \"information\" and \"counters\" are embeddeds\n // we need to get value of \"id\" column from the post real entity object and return it in a\n // { data: { information: { counters: { id: ... } } } } format\n\n // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n const propertyNames = [...this.embeddedMetadata.parentPropertyNames];\n const isEmbeddedArray = this.embeddedMetadata.isArray;\n\n // now need to access post[data][information][counters] to get column value from the counters\n // and on each step we need to create complex literal object, e.g. first { data },\n // then { data: { information } }, then { data: { information: { counters } } },\n // then { data: { information: { counters: [this.propertyName]: entity[data][information][counters][this.propertyName] } } }\n // this recursive function helps doing that\n const extractEmbeddedColumnValue = (propertyNames: string[], value: ObjectLiteral): ObjectLiteral => {\n if (value === undefined) {\n return {};\n }\n\n const propertyName = propertyNames.shift();\n\n if (propertyName) {\n const submap = extractEmbeddedColumnValue(propertyNames, value[propertyName]);\n if (Object.keys(submap).length > 0) {\n return { [propertyName]: submap };\n }\n return {};\n }\n\n if (isEmbeddedArray && Array.isArray(value)) {\n return value.map(v => ({ [this.propertyName]: v[this.propertyName] }));\n }\n\n if (value[this.propertyName] !== undefined && (returnNulls === false || value[this.propertyName] !== null)) {\n return { [this.propertyName]: value[this.propertyName] };\n }\n\n return {};\n };\n const map = extractEmbeddedColumnValue(propertyNames, entity);\n\n return Object.keys(map).length > 0 ? map : undefined;\n\n } else { // no embeds - no problems. Simply return column property name and its value of the entity\n /**\n * Object.getOwnPropertyDescriptor checks if the relation is lazy, in which case value is a Promise\n * DO NOT use `entity[this.relationMetadata.propertyName] instanceof Promise`, which will invoke property getter and make unwanted DB request\n * refer: https://github.com/typeorm/typeorm/pull/8676#issuecomment-1049906331\n */\n if (this.relationMetadata && !Object.getOwnPropertyDescriptor(entity, this.relationMetadata.propertyName)?.get && entity[this.relationMetadata.propertyName] && entity[this.relationMetadata.propertyName] instanceof Object) {\n const map = this.relationMetadata.joinColumns.reduce((map, joinColumn) => {\n const value = joinColumn.referencedColumn!.getEntityValueMap(entity[this.relationMetadata!.propertyName]);\n if (value === undefined) return map;\n return OrmUtils.mergeDeep(map, value);\n }, {});\n if (Object.keys(map).length > 0)\n return { [this.propertyName]: map };\n\n return undefined;\n } else {\n if (entity[this.propertyName] !== undefined && (returnNulls === false || entity[this.propertyName] !== null))\n return { [this.propertyName]: entity[this.propertyName] };\n\n return undefined;\n }\n }\n }\n\n /**\n * Extracts column value from the given entity.\n * If column is in embedded (or recursive embedded) it extracts its value from there.\n */\n getEntityValue(entity: ObjectLiteral, transform: boolean = false): any|undefined {\n if (entity === undefined || entity === null) return undefined;\n\n // extract column value from embeddeds of entity if column is in embedded\n let value: any = undefined;\n if (this.embeddedMetadata) {\n\n // example: post[data][information][counters].id where \"data\", \"information\" and \"counters\" are embeddeds\n // we need to get value of \"id\" column from the post real entity object\n\n // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n const propertyNames = [...this.embeddedMetadata.parentPropertyNames];\n const isEmbeddedArray = this.embeddedMetadata.isArray;\n\n // next we need to access post[data][information][counters][this.propertyName] to get column value from the counters\n // this recursive function takes array of generated property names and gets the post[data][information][counters] embed\n const extractEmbeddedColumnValue = (propertyNames: string[], value: ObjectLiteral): any => {\n const propertyName = propertyNames.shift();\n return propertyName && value ? extractEmbeddedColumnValue(propertyNames, value[propertyName]) : value;\n };\n\n // once we get nested embed object we get its column, e.g. post[data][information][counters][this.propertyName]\n const embeddedObject = extractEmbeddedColumnValue(propertyNames, entity);\n if (embeddedObject) {\n if (this.relationMetadata && this.referencedColumn) {\n const relatedEntity = this.relationMetadata.getEntityValue(embeddedObject);\n if (relatedEntity && relatedEntity instanceof Object && !(relatedEntity instanceof FindOperator) && !(relatedEntity instanceof Buffer)) {\n value = this.referencedColumn.getEntityValue(relatedEntity);\n\n } else if (embeddedObject[this.propertyName] && embeddedObject[this.propertyName] instanceof Object && !(embeddedObject[this.propertyName] instanceof FindOperator) && !(embeddedObject[this.propertyName] instanceof Buffer) && !(embeddedObject[this.propertyName] instanceof Date)) {\n value = this.referencedColumn.getEntityValue(embeddedObject[this.propertyName]);\n\n } else {\n value = embeddedObject[this.propertyName];\n\n }\n\n } else if (this.referencedColumn) {\n value = this.referencedColumn.getEntityValue(embeddedObject[this.propertyName]);\n\n } else if (isEmbeddedArray && Array.isArray(embeddedObject)) {\n value = embeddedObject.map(o => o[this.propertyName]);\n } else {\n value = embeddedObject[this.propertyName];\n }\n }\n\n } else { // no embeds - no problems. Simply return column name by property name of the entity\n if (this.relationMetadata && this.referencedColumn) {\n const relatedEntity = this.relationMetadata.getEntityValue(entity);\n if (relatedEntity && relatedEntity instanceof Object && !(relatedEntity instanceof FindOperator) && !(relatedEntity instanceof Function) && !(relatedEntity instanceof Buffer)) {\n value = this.referencedColumn.getEntityValue(relatedEntity);\n\n } else if (entity[this.propertyName] && entity[this.propertyName] instanceof Object && !(entity[this.propertyName] instanceof FindOperator) && !(entity[this.propertyName] instanceof Function) && !(entity[this.propertyName] instanceof Buffer) && !(entity[this.propertyName] instanceof Date)) {\n value = this.referencedColumn.getEntityValue(entity[this.propertyName]);\n\n } else {\n value = entity[this.propertyName];\n }\n\n } else if (this.referencedColumn) {\n value = this.referencedColumn.getEntityValue(entity[this.propertyName]);\n\n } else {\n value = entity[this.propertyName];\n }\n }\n\n if (transform && this.transformer)\n value = ApplyValueTransformers.transformTo(this.transformer, value);\n\n return value;\n }\n\n /**\n * Sets given entity's column value.\n * Using of this method helps to set entity relation's value of the lazy and non-lazy relations.\n */\n setEntityValue(entity: ObjectLiteral, value: any): void {\n if (this.embeddedMetadata) {\n\n // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n const extractEmbeddedColumnValue = (embeddedMetadatas: EmbeddedMetadata[], map: ObjectLiteral): any => {\n // if (!object[embeddedMetadata.propertyName])\n // object[embeddedMetadata.propertyName] = embeddedMetadata.create();\n\n const embeddedMetadata = embeddedMetadatas.shift();\n if (embeddedMetadata) {\n if (!map[embeddedMetadata.propertyName])\n map[embeddedMetadata.propertyName] = embeddedMetadata.create();\n\n extractEmbeddedColumnValue(embeddedMetadatas, map[embeddedMetadata.propertyName]);\n return map;\n }\n map[this.propertyName] = value;\n return map;\n };\n return extractEmbeddedColumnValue([...this.embeddedMetadata.embeddedMetadataTree], entity);\n\n } else {\n // we write a deep object in this entity only if the column is virtual\n // because if its not virtual it means the user defined a real column for this relation\n // also we don't do it if column is inside a junction table\n if (!this.entityMetadata.isJunction && this.isVirtual && this.referencedColumn && this.referencedColumn.propertyName !== this.propertyName) {\n if (!(this.propertyName in entity)) {\n entity[this.propertyName] = {};\n }\n\n entity[this.propertyName][this.referencedColumn.propertyName] = value;\n } else {\n entity[this.propertyName] = value;\n }\n }\n }\n\n // ---------------------------------------------------------------------\n // Builder Methods\n // ---------------------------------------------------------------------\n\n build(connection: Connection): this {\n this.propertyPath = this.buildPropertyPath();\n this.propertyAliasName = this.propertyPath.replace(\".\", \"_\");\n this.databaseName = this.buildDatabaseName(connection);\n this.databasePath = this.buildDatabasePath();\n this.databaseNameWithoutPrefixes = connection.namingStrategy.columnName(this.propertyName, this.givenDatabaseName, []);\n return this;\n }\n\n protected buildPropertyPath(): string {\n let path = \"\";\n if (this.embeddedMetadata && this.embeddedMetadata.parentPropertyNames.length)\n path = this.embeddedMetadata.parentPropertyNames.join(\".\") + \".\";\n\n path += this.propertyName;\n\n // we add reference column to property path only if this column is virtual\n // because if its not virtual it means user defined a real column for this relation\n // also we don't do it if column is inside a junction table\n if (!this.entityMetadata.isJunction && this.isVirtual && this.referencedColumn && this.referencedColumn.propertyName !== this.propertyName)\n path += \".\" + this.referencedColumn.propertyName;\n\n return path;\n }\n\n protected buildDatabasePath(): string {\n let path = \"\";\n if (this.embeddedMetadata && this.embeddedMetadata.parentPropertyNames.length)\n path = this.embeddedMetadata.parentPropertyNames.join(\".\") + \".\";\n\n path += this.databaseName;\n\n // we add reference column to property path only if this column is virtual\n // because if its not virtual it means user defined a real column for this relation\n // also we don't do it if column is inside a junction table\n if (!this.entityMetadata.isJunction && this.isVirtual && this.referencedColumn && this.referencedColumn.databaseName !== this.databaseName)\n path += \".\" + this.referencedColumn.databaseName;\n\n return path;\n }\n\n protected buildDatabaseName(connection: Connection): string {\n let propertyNames = this.embeddedMetadata ? this.embeddedMetadata.parentPrefixes : [];\n if (connection.driver instanceof MongoDriver) // we don't need to include embedded name for the mongodb column names\n propertyNames = [];\n return connection.namingStrategy.columnName(this.propertyName, this.givenDatabaseName, propertyNames);\n }\n\n}\n"],"sourceRoot":".."}
@@ -63,6 +63,11 @@ export declare abstract class BaseQueryRunner {
63
63
  * If replication is not setup its value is ignored.
64
64
  */
65
65
  protected mode: ReplicationMode;
66
+ /**
67
+ * current depth of transaction.
68
+ * for transactionDepth > 0 will use SAVEPOINT to start and commit/rollback transaction blocks
69
+ */
70
+ protected transactionDepth: number;
66
71
  private cachedTablePaths;
67
72
  /**
68
73
  * Executes a given SQL query.
@@ -38,6 +38,11 @@ var BaseQueryRunner = /** @class */ (function () {
38
38
  * Sql-s stored if "sql in memory" mode is enabled.
39
39
  */
40
40
  this.sqlInMemory = new SqlInMemory();
41
+ /**
42
+ * current depth of transaction.
43
+ * for transactionDepth > 0 will use SAVEPOINT to start and commit/rollback transaction blocks
44
+ */
45
+ this.transactionDepth = 0;
41
46
  this.cachedTablePaths = {};
42
47
  }
43
48
  // -------------------------------------------------------------------------
@@ -1 +1 @@
1
- {"version":3,"sources":["../browser/src/query-runner/BaseQueryRunner.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AASlD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,Q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AC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC;QAEhF,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;OAEG;IACa,wCAAc,GAA9B,UAA+B,SAAwB,EAAE,WAA0B;;;;;;;wBAC/E,IAAI,SAAS,YAAY,KAAK;4BAC1B,SAAS,GAAG,CAAC,SAAS,CAAC,CAAC;wBAC5B,IAAI,WAAW,YAAY,KAAK;4BAC5B,WAAW,GAAG,CAAC,WAAW,CAAC,CAAC;wBAEhC,CAAA,KAAA,IAAI,CAAC,WAAW,CAAC,SAAS,CAAA,CAAC,IAAI,oCAAI,SAAS,WAAE;wBAC9C,CAAA,KAAA,IAAI,CAAC,WAAW,CAAC,WAAW,CAAA,CAAC,IAAI,oCAAI,WAAW,WAAE;wBAElD,8EAA8E;wBAC9E,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI;4BAC3B,sBAAO,OAAO,CAAC,OAAO,EAAkB,EAAC;;;;wBAEX,cAAA,SAAA,SAAS,CAAA;;;;wBAAhC,wBAAmB,EAAlB,KAAK,WAAA,EAAE,UAAU,gBAAA;wBACzB,qBAAM,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,EAAA;;wBAAnC,SAAmC,CAAC;;;;;;;;;;;;;;;;;;;;KAE3C;IAEL,sBAAC;AAAD,CAtfA,AAsfC,IAAA","file":"BaseQueryRunner.js","sourcesContent":["import {PostgresConnectionOptions} from \"../driver/postgres/PostgresConnectionOptions\";\nimport {Query} from \"../driver/Query\";\nimport {SqlInMemory} from \"../driver/SqlInMemory\";\nimport {SqlServerConnectionOptions} from \"../driver/sqlserver/SqlServerConnectionOptions\";\nimport {View} from \"../schema-builder/view/View\";\nimport {Connection} from \"../connection/Connection\";\nimport {Table} from \"../schema-builder/table/Table\";\nimport {EntityManager} from \"../entity-manager/EntityManager\";\nimport {TableColumn} from \"../schema-builder/table/TableColumn\";\nimport {Broadcaster} from \"../subscriber/Broadcaster\";\nimport {ReplicationMode} from \"../driver/types/ReplicationMode\";\nimport { TypeORMError } from \"../error/TypeORMError\";\nimport { EntityMetadata } from \"../metadata/EntityMetadata\";\nimport { TableForeignKey } from \"../schema-builder/table/TableForeignKey\";\nimport { OrmUtils } from \"../util/OrmUtils\";\nimport {MetadataTableType} from \"../driver/types/MetadataTableType\";\n\nexport abstract class BaseQueryRunner {\n\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection used by this query runner.\n */\n connection: Connection;\n\n /**\n * Entity manager working only with current query runner.\n */\n manager: EntityManager;\n\n /**\n * Indicates if connection for this query runner is released.\n * Once its released, query runner cannot run queries anymore.\n */\n isReleased = false;\n\n /**\n * Indicates if transaction is in progress.\n */\n isTransactionActive = false;\n\n /**\n * Stores temporarily user data.\n * Useful for sharing data with subscribers.\n */\n data = {};\n\n /**\n * All synchronized tables in the database.\n */\n loadedTables: Table[] = [];\n\n /**\n * All synchronized views in the database.\n */\n loadedViews: View[] = [];\n\n /**\n * Broadcaster used on this query runner to broadcast entity events.\n */\n broadcaster: Broadcaster;\n\n // -------------------------------------------------------------------------\n // Protected Properties\n // -------------------------------------------------------------------------\n\n /**\n * Real database connection from a connection pool used to perform queries.\n */\n protected databaseConnection: any;\n\n /**\n * Indicates if special query runner mode in which sql queries won't be executed is enabled.\n */\n protected sqlMemoryMode: boolean = false;\n\n /**\n * Sql-s stored if \"sql in memory\" mode is enabled.\n */\n protected sqlInMemory: SqlInMemory = new SqlInMemory();\n\n /**\n * Mode in which query runner executes.\n * Used for replication.\n * If replication is not setup its value is ignored.\n */\n protected mode: ReplicationMode;\n\n private cachedTablePaths: Record<string, string> = {};\n\n // -------------------------------------------------------------------------\n // Public Abstract Methods\n // -------------------------------------------------------------------------\n\n /**\n * Executes a given SQL query.\n */\n abstract query(query: string, parameters?: any[], useStructuredResult?: boolean): Promise<any>;\n\n // -------------------------------------------------------------------------\n // Protected Abstract Methods\n // -------------------------------------------------------------------------\n\n protected abstract loadTables(tablePaths?: string[]): Promise<Table[]>;\n\n protected abstract loadViews(tablePaths?: string[]): Promise<View[]>;\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Called before migrations are run.\n */\n async beforeMigration(): Promise<void> {\n // Do nothing\n }\n\n /**\n * Called after migrations are run.\n */\n async afterMigration(): Promise<void> {\n // Do nothing\n }\n\n /**\n * Loads given table's data from the database.\n */\n async getTable(tablePath: string): Promise<Table|undefined> {\n this.loadedTables = await this.loadTables([tablePath]);\n return this.loadedTables.length > 0 ? this.loadedTables[0] : undefined;\n }\n\n /**\n * Loads all tables (with given names) from the database.\n */\n async getTables(tableNames?: string[]): Promise<Table[]> {\n if (!tableNames) {\n // Don't cache in this case.\n // This is the new case & isn't used anywhere else anyway.\n return await this.loadTables(tableNames);\n }\n\n this.loadedTables = await this.loadTables(tableNames);\n return this.loadedTables;\n }\n\n /**\n * Loads given view's data from the database.\n */\n async getView(viewPath: string): Promise<View|undefined> {\n this.loadedViews = await this.loadViews([viewPath]);\n return this.loadedViews.length > 0 ? this.loadedViews[0] : undefined;\n }\n\n /**\n * Loads given view's data from the database.\n */\n async getViews(viewPaths?: string[]): Promise<View[]> {\n this.loadedViews = await this.loadViews(viewPaths);\n return this.loadedViews;\n }\n\n /**\n * Enables special query runner mode in which sql queries won't be executed,\n * instead they will be memorized into a special variable inside query runner.\n * You can get memorized sql using getMemorySql() method.\n */\n enableSqlMemory(): void {\n this.sqlInMemory = new SqlInMemory();\n this.sqlMemoryMode = true;\n }\n\n /**\n * Disables special query runner mode in which sql queries won't be executed\n * started by calling enableSqlMemory() method.\n *\n * Previously memorized sql will be flushed.\n */\n disableSqlMemory(): void {\n this.sqlInMemory = new SqlInMemory();\n this.sqlMemoryMode = false;\n }\n\n /**\n * Flushes all memorized sqls.\n */\n clearSqlMemory(): void {\n this.sqlInMemory = new SqlInMemory();\n }\n\n /**\n * Gets sql stored in the memory. Parameters in the sql are already replaced.\n */\n getMemorySql(): SqlInMemory {\n return this.sqlInMemory;\n }\n\n /**\n * Executes up sql queries.\n */\n async executeMemoryUpSql(): Promise<void> {\n for (const {query, parameters} of this.sqlInMemory.upQueries) {\n await this.query(query, parameters);\n }\n }\n\n /**\n * Executes down sql queries.\n */\n async executeMemoryDownSql(): Promise<void> {\n for (const {query, parameters} of this.sqlInMemory.downQueries.reverse()) {\n await this.query(query, parameters);\n }\n }\n\n getReplicationMode(): ReplicationMode {\n return this.mode;\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Gets view from previously loaded views, otherwise loads it from database.\n */\n protected async getCachedView(viewName: string): Promise<View> {\n const view = this.loadedViews.find(view => view.name === viewName);\n if (view) return view;\n\n const foundViews = await this.loadViews([viewName]);\n if (foundViews.length > 0) {\n this.loadedViews.push(foundViews[0]);\n return foundViews[0];\n } else {\n throw new TypeORMError(`View \"${viewName}\" does not exist.`);\n }\n }\n\n /**\n * Gets table from previously loaded tables, otherwise loads it from database.\n */\n protected async getCachedTable(tableName: string): Promise<Table> {\n if (tableName in this.cachedTablePaths) {\n const tablePath = this.cachedTablePaths[tableName];\n const table = this.loadedTables.find(table => this.getTablePath(table) === tablePath);\n\n if (table) {\n return table;\n }\n }\n\n const foundTables = await this.loadTables([tableName]);\n\n if (foundTables.length > 0) {\n const foundTablePath = this.getTablePath(foundTables[0]);\n\n const cachedTable = this.loadedTables.find((table) => this.getTablePath(table) === foundTablePath);\n\n if (!cachedTable) {\n this.cachedTablePaths[tableName] = this.getTablePath(foundTables[0]);\n this.loadedTables.push(foundTables[0]);\n return foundTables[0];\n } else {\n return cachedTable;\n }\n } else {\n throw new TypeORMError(`Table \"${tableName}\" does not exist.`);\n }\n }\n\n /**\n * Replaces loaded table with given changed table.\n */\n protected replaceCachedTable(table: Table, changedTable: Table): void {\n const oldTablePath = this.getTablePath(table);\n const foundTable = this.loadedTables.find(loadedTable => this.getTablePath(loadedTable) === oldTablePath);\n\n // Clean up the lookup cache..\n for (const [key, cachedPath] of Object.entries(this.cachedTablePaths)) {\n if (cachedPath === oldTablePath) {\n this.cachedTablePaths[key] = this.getTablePath(changedTable);\n }\n }\n\n if (foundTable) {\n foundTable.database = changedTable.database;\n foundTable.schema = changedTable.schema;\n foundTable.name = changedTable.name;\n foundTable.columns = changedTable.columns;\n foundTable.indices = changedTable.indices;\n foundTable.foreignKeys = changedTable.foreignKeys;\n foundTable.uniques = changedTable.uniques;\n foundTable.checks = changedTable.checks;\n foundTable.justCreated = changedTable.justCreated;\n foundTable.engine = changedTable.engine;\n }\n }\n\n protected getTablePath(target: EntityMetadata | Table | View | TableForeignKey | string): string {\n const parsed = this.connection.driver.parseTableName(target);\n\n return this.connection.driver.buildTableName(\n parsed.tableName,\n parsed.schema,\n parsed.database\n );\n }\n\n protected getTypeormMetadataTableName(): string {\n const options = <SqlServerConnectionOptions|PostgresConnectionOptions>this.connection.driver.options;\n return this.connection.driver.buildTableName(this.connection.metadataTableName, options.schema, options.database);\n }\n\n /**\n * Generates SQL query to insert a record into typeorm metadata table.\n */\n protected insertTypeormMetadataSql({\n database,\n schema,\n table,\n type,\n name,\n value\n }: {\n database?: string,\n schema?: string,\n table?: string,\n type: MetadataTableType\n name: string,\n value?: string\n }): Query {\n const [query, parameters] = this.connection.createQueryBuilder()\n .insert()\n .into(this.getTypeormMetadataTableName())\n .values({ database: database, schema: schema, table: table, type: type, name: name, value: value })\n .getQueryAndParameters();\n\n return new Query(query, parameters);\n }\n\n /**\n * Generates SQL query to delete a record from typeorm metadata table.\n */\n protected deleteTypeormMetadataSql({\n database,\n schema,\n table,\n type,\n name\n }: {\n database?: string,\n schema?: string,\n table?: string,\n type: MetadataTableType,\n name: string\n }): Query {\n\n const qb = this.connection.createQueryBuilder();\n const deleteQb = qb.delete()\n .from(this.getTypeormMetadataTableName())\n .where(`${qb.escape(\"type\")} = :type`, { type })\n .andWhere(`${qb.escape(\"name\")} = :name`, { name });\n\n if (database) {\n deleteQb.andWhere(`${qb.escape(\"database\")} = :database`, { database });\n }\n\n if (schema) {\n deleteQb.andWhere(`${qb.escape(\"schema\")} = :schema`, { schema });\n }\n\n if (table) {\n deleteQb.andWhere(`${qb.escape(\"table\")} = :table`, { table });\n }\n\n const [query, parameters] = deleteQb.getQueryAndParameters();\n return new Query(query, parameters);\n }\n\n /**\n * Checks if at least one of column properties was changed.\n * Does not checks column type, length and autoincrement, because these properties changes separately.\n */\n protected isColumnChanged(oldColumn: TableColumn, newColumn: TableColumn, checkDefault?: boolean, checkComment?: boolean): boolean {\n // this logs need to debug issues in column change detection. Do not delete it!\n\n // console.log(\"charset ---------------\");\n // console.log(oldColumn.charset !== newColumn.charset);\n // console.log(oldColumn.charset, newColumn.charset);\n // console.log(\"collation ---------------\");\n // console.log(oldColumn.collation !== newColumn.collation);\n // console.log(oldColumn.collation, newColumn.collation);\n // console.log(\"precision ---------------\");\n // console.log(oldColumn.precision !== newColumn.precision);\n // console.log(oldColumn.precision, newColumn.precision);\n // console.log(\"scale ---------------\");\n // console.log(oldColumn.scale !== newColumn.scale);\n // console.log(oldColumn.scale, newColumn.scale);\n // console.log(\"default ---------------\");\n // console.log((checkDefault && oldColumn.default !== newColumn.default));\n // console.log(oldColumn.default, newColumn.default);\n // console.log(\"isNullable ---------------\");\n // console.log(oldColumn.isNullable !== newColumn.isNullable);\n // console.log(oldColumn.isNullable, newColumn.isNullable);\n // console.log(\"comment ---------------\");\n // console.log((checkComment && oldColumn.comment !== newColumn.comment));\n // console.log(oldColumn.comment, newColumn.comment);\n // console.log(\"enum ---------------\");\n // console.log(!OrmUtils.isArraysEqual(oldColumn.enum || [], newColumn.enum || []));\n // console.log(oldColumn.enum, newColumn.enum);\n\n return oldColumn.charset !== newColumn.charset\n || oldColumn.collation !== newColumn.collation\n || oldColumn.precision !== newColumn.precision\n || oldColumn.scale !== newColumn.scale\n || oldColumn.width !== newColumn.width // MySQL only\n || oldColumn.zerofill !== newColumn.zerofill // MySQL only\n || oldColumn.unsigned !== newColumn.unsigned // MySQL only\n || oldColumn.asExpression !== newColumn.asExpression // MySQL only\n || (checkDefault && oldColumn.default !== newColumn.default)\n || oldColumn.onUpdate !== newColumn.onUpdate // MySQL only\n || oldColumn.isNullable !== newColumn.isNullable\n || (checkComment && oldColumn.comment !== newColumn.comment)\n || !OrmUtils.isArraysEqual(oldColumn.enum || [], newColumn.enum || []);\n }\n\n /**\n * Checks if column length is by default.\n */\n protected isDefaultColumnLength(table: Table, column: TableColumn, length: string): boolean {\n // if table have metadata, we check if length is specified in column metadata\n if (this.connection.hasMetadata(table.name)) {\n const metadata = this.connection.getMetadata(table.name);\n const columnMetadata = metadata.findColumnWithDatabaseName(column.name);\n\n if (columnMetadata) {\n const columnMetadataLength = this.connection.driver.getColumnLength(columnMetadata);\n if (columnMetadataLength)\n return false;\n }\n }\n\n if (this.connection.driver.dataTypeDefaults\n && this.connection.driver.dataTypeDefaults[column.type]\n && this.connection.driver.dataTypeDefaults[column.type].length) {\n return this.connection.driver.dataTypeDefaults[column.type].length!.toString() === length.toString();\n }\n\n return false;\n }\n\n /**\n * Checks if column precision is by default.\n */\n protected isDefaultColumnPrecision(table: Table, column: TableColumn, precision: number): boolean {\n // if table have metadata, we check if length is specified in column metadata\n if (this.connection.hasMetadata(table.name)) {\n const metadata = this.connection.getMetadata(table.name);\n const columnMetadata = metadata.findColumnWithDatabaseName(column.name);\n if (columnMetadata && columnMetadata.precision !== null && columnMetadata.precision !== undefined)\n return false;\n }\n\n if (this.connection.driver.dataTypeDefaults\n && this.connection.driver.dataTypeDefaults[column.type]\n && this.connection.driver.dataTypeDefaults[column.type].precision !== null\n && this.connection.driver.dataTypeDefaults[column.type].precision !== undefined)\n return this.connection.driver.dataTypeDefaults[column.type].precision === precision;\n\n return false;\n }\n\n /**\n * Checks if column scale is by default.\n */\n protected isDefaultColumnScale(table: Table, column: TableColumn, scale: number): boolean {\n // if table have metadata, we check if length is specified in column metadata\n if (this.connection.hasMetadata(table.name)) {\n const metadata = this.connection.getMetadata(table.name);\n const columnMetadata = metadata.findColumnWithDatabaseName(column.name);\n if (columnMetadata && columnMetadata.scale !== null && columnMetadata.scale !== undefined)\n return false;\n }\n\n if (this.connection.driver.dataTypeDefaults\n && this.connection.driver.dataTypeDefaults[column.type]\n && this.connection.driver.dataTypeDefaults[column.type].scale !== null\n && this.connection.driver.dataTypeDefaults[column.type].scale !== undefined)\n return this.connection.driver.dataTypeDefaults[column.type].scale === scale;\n\n return false;\n }\n\n /**\n * Executes sql used special for schema build.\n */\n protected async executeQueries(upQueries: Query|Query[], downQueries: Query|Query[]): Promise<void> {\n if (upQueries instanceof Query)\n upQueries = [upQueries];\n if (downQueries instanceof Query)\n downQueries = [downQueries];\n\n this.sqlInMemory.upQueries.push(...upQueries);\n this.sqlInMemory.downQueries.push(...downQueries);\n\n // if sql-in-memory mode is enabled then simply store sql in memory and return\n if (this.sqlMemoryMode === true)\n return Promise.resolve() as Promise<any>;\n\n for (const {query, parameters} of upQueries) {\n await this.query(query, parameters);\n }\n }\n\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../browser/src/query-runner/BaseQueryRunner.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AASlD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C;IAAA;QAEI,4EAA4E;QAC5E,oBAAoB;QACpB,4EAA4E;QAY5E;;;WAGG;QACH,eAAU,GAAG,KAAK,CAAC;QAEnB;;WAEG;QACH,wBAAmB,GAAG,KAAK,CAAC;QAE5B;;;WAGG;QACH,SAAI,GAAG,EAAE,CAAC;QAEV;;WAEG;QACH,iBAAY,GAAY,EAAE,CAAC;QAE3B;;WAEG;QACH,gBAAW,GAAW,EAAE,CAAC;QA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,CAAC;wBAC5B,IAAI,WAAW,YAAY,KAAK;4BAC5B,WAAW,GAAG,CAAC,WAAW,CAAC,CAAC;wBAEhC,CAAA,KAAA,IAAI,CAAC,WAAW,CAAC,SAAS,CAAA,CAAC,IAAI,oCAAI,SAAS,WAAE;wBAC9C,CAAA,KAAA,IAAI,CAAC,WAAW,CAAC,WAAW,CAAA,CAAC,IAAI,oCAAI,WAAW,WAAE;wBAElD,8EAA8E;wBAC9E,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI;4BAC3B,sBAAO,OAAO,CAAC,OAAO,EAAkB,EAAC;;;;wBAEX,cAAA,SAAA,SAAS,CAAA;;;;wBAAhC,wBAAmB,EAAlB,KAAK,WAAA,EAAE,UAAU,gBAAA;wBACzB,qBAAM,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,EAAA;;wBAAnC,SAAmC,CAAC;;;;;;;;;;;;;;;;;;;;KAE3C;IAEL,sBAAC;AAAD,CA5fA,AA4fC,IAAA","file":"BaseQueryRunner.js","sourcesContent":["import {PostgresConnectionOptions} from \"../driver/postgres/PostgresConnectionOptions\";\nimport {Query} from \"../driver/Query\";\nimport {SqlInMemory} from \"../driver/SqlInMemory\";\nimport {SqlServerConnectionOptions} from \"../driver/sqlserver/SqlServerConnectionOptions\";\nimport {View} from \"../schema-builder/view/View\";\nimport {Connection} from \"../connection/Connection\";\nimport {Table} from \"../schema-builder/table/Table\";\nimport {EntityManager} from \"../entity-manager/EntityManager\";\nimport {TableColumn} from \"../schema-builder/table/TableColumn\";\nimport {Broadcaster} from \"../subscriber/Broadcaster\";\nimport {ReplicationMode} from \"../driver/types/ReplicationMode\";\nimport { TypeORMError } from \"../error/TypeORMError\";\nimport { EntityMetadata } from \"../metadata/EntityMetadata\";\nimport { TableForeignKey } from \"../schema-builder/table/TableForeignKey\";\nimport { OrmUtils } from \"../util/OrmUtils\";\nimport {MetadataTableType} from \"../driver/types/MetadataTableType\";\n\nexport abstract class BaseQueryRunner {\n\n // -------------------------------------------------------------------------\n // Public Properties\n // -------------------------------------------------------------------------\n\n /**\n * Connection used by this query runner.\n */\n connection: Connection;\n\n /**\n * Entity manager working only with current query runner.\n */\n manager: EntityManager;\n\n /**\n * Indicates if connection for this query runner is released.\n * Once its released, query runner cannot run queries anymore.\n */\n isReleased = false;\n\n /**\n * Indicates if transaction is in progress.\n */\n isTransactionActive = false;\n\n /**\n * Stores temporarily user data.\n * Useful for sharing data with subscribers.\n */\n data = {};\n\n /**\n * All synchronized tables in the database.\n */\n loadedTables: Table[] = [];\n\n /**\n * All synchronized views in the database.\n */\n loadedViews: View[] = [];\n\n /**\n * Broadcaster used on this query runner to broadcast entity events.\n */\n broadcaster: Broadcaster;\n\n // -------------------------------------------------------------------------\n // Protected Properties\n // -------------------------------------------------------------------------\n\n /**\n * Real database connection from a connection pool used to perform queries.\n */\n protected databaseConnection: any;\n\n /**\n * Indicates if special query runner mode in which sql queries won't be executed is enabled.\n */\n protected sqlMemoryMode: boolean = false;\n\n /**\n * Sql-s stored if \"sql in memory\" mode is enabled.\n */\n protected sqlInMemory: SqlInMemory = new SqlInMemory();\n\n /**\n * Mode in which query runner executes.\n * Used for replication.\n * If replication is not setup its value is ignored.\n */\n protected mode: ReplicationMode;\n\n /**\n * current depth of transaction.\n * for transactionDepth > 0 will use SAVEPOINT to start and commit/rollback transaction blocks\n */\n protected transactionDepth = 0;\n\n private cachedTablePaths: Record<string, string> = {};\n\n // -------------------------------------------------------------------------\n // Public Abstract Methods\n // -------------------------------------------------------------------------\n\n /**\n * Executes a given SQL query.\n */\n abstract query(query: string, parameters?: any[], useStructuredResult?: boolean): Promise<any>;\n\n // -------------------------------------------------------------------------\n // Protected Abstract Methods\n // -------------------------------------------------------------------------\n\n protected abstract loadTables(tablePaths?: string[]): Promise<Table[]>;\n\n protected abstract loadViews(tablePaths?: string[]): Promise<View[]>;\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Called before migrations are run.\n */\n async beforeMigration(): Promise<void> {\n // Do nothing\n }\n\n /**\n * Called after migrations are run.\n */\n async afterMigration(): Promise<void> {\n // Do nothing\n }\n\n /**\n * Loads given table's data from the database.\n */\n async getTable(tablePath: string): Promise<Table|undefined> {\n this.loadedTables = await this.loadTables([tablePath]);\n return this.loadedTables.length > 0 ? this.loadedTables[0] : undefined;\n }\n\n /**\n * Loads all tables (with given names) from the database.\n */\n async getTables(tableNames?: string[]): Promise<Table[]> {\n if (!tableNames) {\n // Don't cache in this case.\n // This is the new case & isn't used anywhere else anyway.\n return await this.loadTables(tableNames);\n }\n\n this.loadedTables = await this.loadTables(tableNames);\n return this.loadedTables;\n }\n\n /**\n * Loads given view's data from the database.\n */\n async getView(viewPath: string): Promise<View|undefined> {\n this.loadedViews = await this.loadViews([viewPath]);\n return this.loadedViews.length > 0 ? this.loadedViews[0] : undefined;\n }\n\n /**\n * Loads given view's data from the database.\n */\n async getViews(viewPaths?: string[]): Promise<View[]> {\n this.loadedViews = await this.loadViews(viewPaths);\n return this.loadedViews;\n }\n\n /**\n * Enables special query runner mode in which sql queries won't be executed,\n * instead they will be memorized into a special variable inside query runner.\n * You can get memorized sql using getMemorySql() method.\n */\n enableSqlMemory(): void {\n this.sqlInMemory = new SqlInMemory();\n this.sqlMemoryMode = true;\n }\n\n /**\n * Disables special query runner mode in which sql queries won't be executed\n * started by calling enableSqlMemory() method.\n *\n * Previously memorized sql will be flushed.\n */\n disableSqlMemory(): void {\n this.sqlInMemory = new SqlInMemory();\n this.sqlMemoryMode = false;\n }\n\n /**\n * Flushes all memorized sqls.\n */\n clearSqlMemory(): void {\n this.sqlInMemory = new SqlInMemory();\n }\n\n /**\n * Gets sql stored in the memory. Parameters in the sql are already replaced.\n */\n getMemorySql(): SqlInMemory {\n return this.sqlInMemory;\n }\n\n /**\n * Executes up sql queries.\n */\n async executeMemoryUpSql(): Promise<void> {\n for (const {query, parameters} of this.sqlInMemory.upQueries) {\n await this.query(query, parameters);\n }\n }\n\n /**\n * Executes down sql queries.\n */\n async executeMemoryDownSql(): Promise<void> {\n for (const {query, parameters} of this.sqlInMemory.downQueries.reverse()) {\n await this.query(query, parameters);\n }\n }\n\n getReplicationMode(): ReplicationMode {\n return this.mode;\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Gets view from previously loaded views, otherwise loads it from database.\n */\n protected async getCachedView(viewName: string): Promise<View> {\n const view = this.loadedViews.find(view => view.name === viewName);\n if (view) return view;\n\n const foundViews = await this.loadViews([viewName]);\n if (foundViews.length > 0) {\n this.loadedViews.push(foundViews[0]);\n return foundViews[0];\n } else {\n throw new TypeORMError(`View \"${viewName}\" does not exist.`);\n }\n }\n\n /**\n * Gets table from previously loaded tables, otherwise loads it from database.\n */\n protected async getCachedTable(tableName: string): Promise<Table> {\n if (tableName in this.cachedTablePaths) {\n const tablePath = this.cachedTablePaths[tableName];\n const table = this.loadedTables.find(table => this.getTablePath(table) === tablePath);\n\n if (table) {\n return table;\n }\n }\n\n const foundTables = await this.loadTables([tableName]);\n\n if (foundTables.length > 0) {\n const foundTablePath = this.getTablePath(foundTables[0]);\n\n const cachedTable = this.loadedTables.find((table) => this.getTablePath(table) === foundTablePath);\n\n if (!cachedTable) {\n this.cachedTablePaths[tableName] = this.getTablePath(foundTables[0]);\n this.loadedTables.push(foundTables[0]);\n return foundTables[0];\n } else {\n return cachedTable;\n }\n } else {\n throw new TypeORMError(`Table \"${tableName}\" does not exist.`);\n }\n }\n\n /**\n * Replaces loaded table with given changed table.\n */\n protected replaceCachedTable(table: Table, changedTable: Table): void {\n const oldTablePath = this.getTablePath(table);\n const foundTable = this.loadedTables.find(loadedTable => this.getTablePath(loadedTable) === oldTablePath);\n\n // Clean up the lookup cache..\n for (const [key, cachedPath] of Object.entries(this.cachedTablePaths)) {\n if (cachedPath === oldTablePath) {\n this.cachedTablePaths[key] = this.getTablePath(changedTable);\n }\n }\n\n if (foundTable) {\n foundTable.database = changedTable.database;\n foundTable.schema = changedTable.schema;\n foundTable.name = changedTable.name;\n foundTable.columns = changedTable.columns;\n foundTable.indices = changedTable.indices;\n foundTable.foreignKeys = changedTable.foreignKeys;\n foundTable.uniques = changedTable.uniques;\n foundTable.checks = changedTable.checks;\n foundTable.justCreated = changedTable.justCreated;\n foundTable.engine = changedTable.engine;\n }\n }\n\n protected getTablePath(target: EntityMetadata | Table | View | TableForeignKey | string): string {\n const parsed = this.connection.driver.parseTableName(target);\n\n return this.connection.driver.buildTableName(\n parsed.tableName,\n parsed.schema,\n parsed.database\n );\n }\n\n protected getTypeormMetadataTableName(): string {\n const options = <SqlServerConnectionOptions|PostgresConnectionOptions>this.connection.driver.options;\n return this.connection.driver.buildTableName(this.connection.metadataTableName, options.schema, options.database);\n }\n\n /**\n * Generates SQL query to insert a record into typeorm metadata table.\n */\n protected insertTypeormMetadataSql({\n database,\n schema,\n table,\n type,\n name,\n value\n }: {\n database?: string,\n schema?: string,\n table?: string,\n type: MetadataTableType\n name: string,\n value?: string\n }): Query {\n const [query, parameters] = this.connection.createQueryBuilder()\n .insert()\n .into(this.getTypeormMetadataTableName())\n .values({ database: database, schema: schema, table: table, type: type, name: name, value: value })\n .getQueryAndParameters();\n\n return new Query(query, parameters);\n }\n\n /**\n * Generates SQL query to delete a record from typeorm metadata table.\n */\n protected deleteTypeormMetadataSql({\n database,\n schema,\n table,\n type,\n name\n }: {\n database?: string,\n schema?: string,\n table?: string,\n type: MetadataTableType,\n name: string\n }): Query {\n\n const qb = this.connection.createQueryBuilder();\n const deleteQb = qb.delete()\n .from(this.getTypeormMetadataTableName())\n .where(`${qb.escape(\"type\")} = :type`, { type })\n .andWhere(`${qb.escape(\"name\")} = :name`, { name });\n\n if (database) {\n deleteQb.andWhere(`${qb.escape(\"database\")} = :database`, { database });\n }\n\n if (schema) {\n deleteQb.andWhere(`${qb.escape(\"schema\")} = :schema`, { schema });\n }\n\n if (table) {\n deleteQb.andWhere(`${qb.escape(\"table\")} = :table`, { table });\n }\n\n const [query, parameters] = deleteQb.getQueryAndParameters();\n return new Query(query, parameters);\n }\n\n /**\n * Checks if at least one of column properties was changed.\n * Does not checks column type, length and autoincrement, because these properties changes separately.\n */\n protected isColumnChanged(oldColumn: TableColumn, newColumn: TableColumn, checkDefault?: boolean, checkComment?: boolean): boolean {\n // this logs need to debug issues in column change detection. Do not delete it!\n\n // console.log(\"charset ---------------\");\n // console.log(oldColumn.charset !== newColumn.charset);\n // console.log(oldColumn.charset, newColumn.charset);\n // console.log(\"collation ---------------\");\n // console.log(oldColumn.collation !== newColumn.collation);\n // console.log(oldColumn.collation, newColumn.collation);\n // console.log(\"precision ---------------\");\n // console.log(oldColumn.precision !== newColumn.precision);\n // console.log(oldColumn.precision, newColumn.precision);\n // console.log(\"scale ---------------\");\n // console.log(oldColumn.scale !== newColumn.scale);\n // console.log(oldColumn.scale, newColumn.scale);\n // console.log(\"default ---------------\");\n // console.log((checkDefault && oldColumn.default !== newColumn.default));\n // console.log(oldColumn.default, newColumn.default);\n // console.log(\"isNullable ---------------\");\n // console.log(oldColumn.isNullable !== newColumn.isNullable);\n // console.log(oldColumn.isNullable, newColumn.isNullable);\n // console.log(\"comment ---------------\");\n // console.log((checkComment && oldColumn.comment !== newColumn.comment));\n // console.log(oldColumn.comment, newColumn.comment);\n // console.log(\"enum ---------------\");\n // console.log(!OrmUtils.isArraysEqual(oldColumn.enum || [], newColumn.enum || []));\n // console.log(oldColumn.enum, newColumn.enum);\n\n return oldColumn.charset !== newColumn.charset\n || oldColumn.collation !== newColumn.collation\n || oldColumn.precision !== newColumn.precision\n || oldColumn.scale !== newColumn.scale\n || oldColumn.width !== newColumn.width // MySQL only\n || oldColumn.zerofill !== newColumn.zerofill // MySQL only\n || oldColumn.unsigned !== newColumn.unsigned // MySQL only\n || oldColumn.asExpression !== newColumn.asExpression // MySQL only\n || (checkDefault && oldColumn.default !== newColumn.default)\n || oldColumn.onUpdate !== newColumn.onUpdate // MySQL only\n || oldColumn.isNullable !== newColumn.isNullable\n || (checkComment && oldColumn.comment !== newColumn.comment)\n || !OrmUtils.isArraysEqual(oldColumn.enum || [], newColumn.enum || []);\n }\n\n /**\n * Checks if column length is by default.\n */\n protected isDefaultColumnLength(table: Table, column: TableColumn, length: string): boolean {\n // if table have metadata, we check if length is specified in column metadata\n if (this.connection.hasMetadata(table.name)) {\n const metadata = this.connection.getMetadata(table.name);\n const columnMetadata = metadata.findColumnWithDatabaseName(column.name);\n\n if (columnMetadata) {\n const columnMetadataLength = this.connection.driver.getColumnLength(columnMetadata);\n if (columnMetadataLength)\n return false;\n }\n }\n\n if (this.connection.driver.dataTypeDefaults\n && this.connection.driver.dataTypeDefaults[column.type]\n && this.connection.driver.dataTypeDefaults[column.type].length) {\n return this.connection.driver.dataTypeDefaults[column.type].length!.toString() === length.toString();\n }\n\n return false;\n }\n\n /**\n * Checks if column precision is by default.\n */\n protected isDefaultColumnPrecision(table: Table, column: TableColumn, precision: number): boolean {\n // if table have metadata, we check if length is specified in column metadata\n if (this.connection.hasMetadata(table.name)) {\n const metadata = this.connection.getMetadata(table.name);\n const columnMetadata = metadata.findColumnWithDatabaseName(column.name);\n if (columnMetadata && columnMetadata.precision !== null && columnMetadata.precision !== undefined)\n return false;\n }\n\n if (this.connection.driver.dataTypeDefaults\n && this.connection.driver.dataTypeDefaults[column.type]\n && this.connection.driver.dataTypeDefaults[column.type].precision !== null\n && this.connection.driver.dataTypeDefaults[column.type].precision !== undefined)\n return this.connection.driver.dataTypeDefaults[column.type].precision === precision;\n\n return false;\n }\n\n /**\n * Checks if column scale is by default.\n */\n protected isDefaultColumnScale(table: Table, column: TableColumn, scale: number): boolean {\n // if table have metadata, we check if length is specified in column metadata\n if (this.connection.hasMetadata(table.name)) {\n const metadata = this.connection.getMetadata(table.name);\n const columnMetadata = metadata.findColumnWithDatabaseName(column.name);\n if (columnMetadata && columnMetadata.scale !== null && columnMetadata.scale !== undefined)\n return false;\n }\n\n if (this.connection.driver.dataTypeDefaults\n && this.connection.driver.dataTypeDefaults[column.type]\n && this.connection.driver.dataTypeDefaults[column.type].scale !== null\n && this.connection.driver.dataTypeDefaults[column.type].scale !== undefined)\n return this.connection.driver.dataTypeDefaults[column.type].scale === scale;\n\n return false;\n }\n\n /**\n * Executes sql used special for schema build.\n */\n protected async executeQueries(upQueries: Query|Query[], downQueries: Query|Query[]): Promise<void> {\n if (upQueries instanceof Query)\n upQueries = [upQueries];\n if (downQueries instanceof Query)\n downQueries = [downQueries];\n\n this.sqlInMemory.upQueries.push(...upQueries);\n this.sqlInMemory.downQueries.push(...downQueries);\n\n // if sql-in-memory mode is enabled then simply store sql in memory and return\n if (this.sqlMemoryMode === true)\n return Promise.resolve() as Promise<any>;\n\n for (const {query, parameters} of upQueries) {\n await this.query(query, parameters);\n }\n }\n\n}\n"],"sourceRoot":".."}
@@ -40,6 +40,10 @@ export interface Driver {
40
40
  * Indicates if tree tables are supported by this driver.
41
41
  */
42
42
  treeSupport: boolean;
43
+ /**
44
+ * Represent transaction support by this driver
45
+ */
46
+ transactionSupport: "simple" | "nested" | "none";
43
47
  /**
44
48
  * Gets list of supported column data types by a driver.
45
49
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/driver/Driver.ts"],"names":[],"mappings":"","file":"Driver.js","sourcesContent":["import {QueryRunner} from \"../query-runner/QueryRunner\";\nimport {ColumnMetadata} from \"../metadata/ColumnMetadata\";\nimport {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {ColumnType} from \"./types/ColumnTypes\";\nimport {MappedColumnTypes} from \"./types/MappedColumnTypes\";\nimport {SchemaBuilder} from \"../schema-builder/SchemaBuilder\";\nimport {DataTypeDefaults} from \"./types/DataTypeDefaults\";\nimport {BaseConnectionOptions} from \"../connection/BaseConnectionOptions\";\nimport {TableColumn} from \"../schema-builder/table/TableColumn\";\nimport {EntityMetadata} from \"../metadata/EntityMetadata\";\nimport {ReplicationMode} from \"./types/ReplicationMode\";\nimport {Table} from \"../schema-builder/table/Table\";\nimport {View} from \"../schema-builder/view/View\";\nimport {TableForeignKey} from \"../schema-builder/table/TableForeignKey\";\nimport {UpsertType} from \"./types/UpsertType\";\n\nexport type ReturningType = \"insert\" | \"update\" | \"delete\";\n\n/**\n * Driver organizes TypeORM communication with specific database management system.\n */\nexport interface Driver {\n\n /**\n * Connection options.\n */\n options: BaseConnectionOptions;\n\n /**\n * Database name used to perform all write queries.\n *\n * todo: probably move into query runner.\n */\n database?: string;\n\n /**\n * Schema name used to perform all write queries.\n */\n schema?: string;\n\n /**\n * Indicates if replication is enabled.\n */\n isReplicated: boolean;\n\n /**\n * Indicates if tree tables are supported by this driver.\n */\n treeSupport: boolean;\n\n /**\n * Gets list of supported column data types by a driver.\n */\n supportedDataTypes: ColumnType[];\n\n /**\n * Returns type of upsert supported by driver if any\n */\n supportedUpsertType?: UpsertType;\n\n /**\n * Default values of length, precision and scale depends on column data type.\n * Used in the cases when length/precision/scale is not specified by user.\n */\n dataTypeDefaults: DataTypeDefaults;\n\n /**\n * Gets list of spatial column data types.\n */\n spatialTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support length by a driver.\n */\n withLengthColumnTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support precision by a driver.\n */\n withPrecisionColumnTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support scale by a driver.\n */\n withScaleColumnTypes: ColumnType[];\n\n /**\n * Orm has special columns and we need to know what database column types should be for those types.\n * Column types are driver dependant.\n */\n mappedDataTypes: MappedColumnTypes;\n\n /**\n * Max length allowed by the DBMS for aliases (execution of queries).\n */\n maxAliasLength?: number;\n\n /**\n * Performs connection to the database.\n * Depend on driver type it may create a connection pool.\n */\n connect(): Promise<void>;\n\n /**\n * Makes any action after connection (e.g. create extensions in Postgres driver).\n */\n afterConnect(): Promise<void>;\n\n /**\n * Closes connection with database and releases all resources.\n */\n disconnect(): Promise<void>;\n\n /**\n * Synchronizes database schema (creates tables, indices, etc).\n */\n createSchemaBuilder(): SchemaBuilder;\n\n /**\n * Creates a query runner used for common queries.\n */\n createQueryRunner(mode: ReplicationMode): QueryRunner;\n\n /**\n * Replaces parameters in the given sql with special escaping character\n * and an array of parameter names to be passed to a query.\n */\n escapeQueryWithParameters(sql: string, parameters: ObjectLiteral, nativeParameters: ObjectLiteral): [string, any[]];\n\n /**\n * Escapes a table name, column name or an alias.\n *\n * todo: probably escape should be able to handle dots in the names and automatically escape them\n */\n escape(name: string): string;\n\n /**\n * Build full table name with database name, schema name and table name.\n * E.g. myDB.mySchema.myTable\n */\n buildTableName(tableName: string, schema?: string, database?: string): string;\n\n /**\n * Parse a target table name or other types and return a normalized table definition.\n */\n parseTableName(target: EntityMetadata | Table | View | TableForeignKey | string): { tableName: string, schema?: string, database?: string };\n\n /**\n * Prepares given value to a value to be persisted, based on its column type and metadata.\n */\n preparePersistentValue(value: any, column: ColumnMetadata): any;\n\n /**\n * Prepares given value to a value to be persisted, based on its column type.\n */\n prepareHydratedValue(value: any, column: ColumnMetadata): any;\n\n /**\n * Transforms type of the given column to a database column type.\n */\n normalizeType(column: { type?: ColumnType|string, length?: number|string, precision?: number|null, scale?: number, isArray?: boolean }): string;\n\n /**\n * Normalizes \"default\" value of the column.\n */\n normalizeDefault(columnMetadata: ColumnMetadata): string | undefined;\n\n /**\n * Normalizes \"isUnique\" value of the column.\n */\n normalizeIsUnique(column: ColumnMetadata): boolean;\n\n /**\n * Calculates column length taking into account the default length values.\n */\n getColumnLength(column: ColumnMetadata): string;\n\n /**\n * Normalizes \"default\" value of the column.\n */\n createFullType(column: TableColumn): string;\n\n /**\n * Obtains a new database connection to a master server.\n * Used for replication.\n * If replication is not setup then returns default connection's database connection.\n */\n obtainMasterConnection(): Promise<any>;\n\n /**\n * Obtains a new database connection to a slave server.\n * Used for replication.\n * If replication is not setup then returns master (default) connection's database connection.\n */\n obtainSlaveConnection(): Promise<any>;\n\n /**\n * Creates generated map of values generated or returned by database after INSERT query.\n */\n createGeneratedMap(metadata: EntityMetadata, insertResult: any, entityIndex?: number, entityNum?: number): ObjectLiteral|undefined;\n\n /**\n * Differentiate columns of this table and columns from the given column metadatas columns\n * and returns only changed.\n */\n findChangedColumns(tableColumns: TableColumn[], columnMetadatas: ColumnMetadata[]): ColumnMetadata[];\n\n /**\n * Returns true if driver supports RETURNING / OUTPUT statement.\n */\n isReturningSqlSupported(returningType: ReturningType): boolean;\n\n /**\n * Returns true if driver supports uuid values generation on its own.\n */\n isUUIDGenerationSupported(): boolean;\n\n /**\n * Returns true if driver supports fulltext indices.\n */\n isFullTextColumnTypeSupported(): boolean;\n\n /**\n * Creates an escaped parameter.\n */\n createParameter(parameterName: string, index: number): string;\n\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/driver/Driver.ts"],"names":[],"mappings":"","file":"Driver.js","sourcesContent":["import {QueryRunner} from \"../query-runner/QueryRunner\";\nimport {ColumnMetadata} from \"../metadata/ColumnMetadata\";\nimport {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {ColumnType} from \"./types/ColumnTypes\";\nimport {MappedColumnTypes} from \"./types/MappedColumnTypes\";\nimport {SchemaBuilder} from \"../schema-builder/SchemaBuilder\";\nimport {DataTypeDefaults} from \"./types/DataTypeDefaults\";\nimport {BaseConnectionOptions} from \"../connection/BaseConnectionOptions\";\nimport {TableColumn} from \"../schema-builder/table/TableColumn\";\nimport {EntityMetadata} from \"../metadata/EntityMetadata\";\nimport {ReplicationMode} from \"./types/ReplicationMode\";\nimport {Table} from \"../schema-builder/table/Table\";\nimport {View} from \"../schema-builder/view/View\";\nimport {TableForeignKey} from \"../schema-builder/table/TableForeignKey\";\nimport {UpsertType} from \"./types/UpsertType\";\n\nexport type ReturningType = \"insert\" | \"update\" | \"delete\";\n\n/**\n * Driver organizes TypeORM communication with specific database management system.\n */\nexport interface Driver {\n\n /**\n * Connection options.\n */\n options: BaseConnectionOptions;\n\n /**\n * Database name used to perform all write queries.\n *\n * todo: probably move into query runner.\n */\n database?: string;\n\n /**\n * Schema name used to perform all write queries.\n */\n schema?: string;\n\n /**\n * Indicates if replication is enabled.\n */\n isReplicated: boolean;\n\n /**\n * Indicates if tree tables are supported by this driver.\n */\n treeSupport: boolean;\n\n /**\n * Represent transaction support by this driver\n */\n transactionSupport: \"simple\" | \"nested\" | \"none\";\n\n /**\n * Gets list of supported column data types by a driver.\n */\n supportedDataTypes: ColumnType[];\n\n /**\n * Returns type of upsert supported by driver if any\n */\n supportedUpsertType?: UpsertType;\n\n /**\n * Default values of length, precision and scale depends on column data type.\n * Used in the cases when length/precision/scale is not specified by user.\n */\n dataTypeDefaults: DataTypeDefaults;\n\n /**\n * Gets list of spatial column data types.\n */\n spatialTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support length by a driver.\n */\n withLengthColumnTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support precision by a driver.\n */\n withPrecisionColumnTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support scale by a driver.\n */\n withScaleColumnTypes: ColumnType[];\n\n /**\n * Orm has special columns and we need to know what database column types should be for those types.\n * Column types are driver dependant.\n */\n mappedDataTypes: MappedColumnTypes;\n\n /**\n * Max length allowed by the DBMS for aliases (execution of queries).\n */\n maxAliasLength?: number;\n\n /**\n * Performs connection to the database.\n * Depend on driver type it may create a connection pool.\n */\n connect(): Promise<void>;\n\n /**\n * Makes any action after connection (e.g. create extensions in Postgres driver).\n */\n afterConnect(): Promise<void>;\n\n /**\n * Closes connection with database and releases all resources.\n */\n disconnect(): Promise<void>;\n\n /**\n * Synchronizes database schema (creates tables, indices, etc).\n */\n createSchemaBuilder(): SchemaBuilder;\n\n /**\n * Creates a query runner used for common queries.\n */\n createQueryRunner(mode: ReplicationMode): QueryRunner;\n\n /**\n * Replaces parameters in the given sql with special escaping character\n * and an array of parameter names to be passed to a query.\n */\n escapeQueryWithParameters(sql: string, parameters: ObjectLiteral, nativeParameters: ObjectLiteral): [string, any[]];\n\n /**\n * Escapes a table name, column name or an alias.\n *\n * todo: probably escape should be able to handle dots in the names and automatically escape them\n */\n escape(name: string): string;\n\n /**\n * Build full table name with database name, schema name and table name.\n * E.g. myDB.mySchema.myTable\n */\n buildTableName(tableName: string, schema?: string, database?: string): string;\n\n /**\n * Parse a target table name or other types and return a normalized table definition.\n */\n parseTableName(target: EntityMetadata | Table | View | TableForeignKey | string): { tableName: string, schema?: string, database?: string };\n\n /**\n * Prepares given value to a value to be persisted, based on its column type and metadata.\n */\n preparePersistentValue(value: any, column: ColumnMetadata): any;\n\n /**\n * Prepares given value to a value to be persisted, based on its column type.\n */\n prepareHydratedValue(value: any, column: ColumnMetadata): any;\n\n /**\n * Transforms type of the given column to a database column type.\n */\n normalizeType(column: { type?: ColumnType|string, length?: number|string, precision?: number|null, scale?: number, isArray?: boolean }): string;\n\n /**\n * Normalizes \"default\" value of the column.\n */\n normalizeDefault(columnMetadata: ColumnMetadata): string | undefined;\n\n /**\n * Normalizes \"isUnique\" value of the column.\n */\n normalizeIsUnique(column: ColumnMetadata): boolean;\n\n /**\n * Calculates column length taking into account the default length values.\n */\n getColumnLength(column: ColumnMetadata): string;\n\n /**\n * Normalizes \"default\" value of the column.\n */\n createFullType(column: TableColumn): string;\n\n /**\n * Obtains a new database connection to a master server.\n * Used for replication.\n * If replication is not setup then returns default connection's database connection.\n */\n obtainMasterConnection(): Promise<any>;\n\n /**\n * Obtains a new database connection to a slave server.\n * Used for replication.\n * If replication is not setup then returns master (default) connection's database connection.\n */\n obtainSlaveConnection(): Promise<any>;\n\n /**\n * Creates generated map of values generated or returned by database after INSERT query.\n */\n createGeneratedMap(metadata: EntityMetadata, insertResult: any, entityIndex?: number, entityNum?: number): ObjectLiteral|undefined;\n\n /**\n * Differentiate columns of this table and columns from the given column metadatas columns\n * and returns only changed.\n */\n findChangedColumns(tableColumns: TableColumn[], columnMetadatas: ColumnMetadata[]): ColumnMetadata[];\n\n /**\n * Returns true if driver supports RETURNING / OUTPUT statement.\n */\n isReturningSqlSupported(returningType: ReturningType): boolean;\n\n /**\n * Returns true if driver supports uuid values generation on its own.\n */\n isUUIDGenerationSupported(): boolean;\n\n /**\n * Returns true if driver supports fulltext indices.\n */\n isFullTextColumnTypeSupported(): boolean;\n\n /**\n * Creates an escaped parameter.\n */\n createParameter(parameterName: string, index: number): string;\n\n}\n"],"sourceRoot":".."}
@@ -54,6 +54,10 @@ export declare class AuroraDataApiDriver implements Driver {
54
54
  * Indicates if tree tables are supported by this driver.
55
55
  */
56
56
  treeSupport: boolean;
57
+ /**
58
+ * Represent transaction support by this driver
59
+ */
60
+ transactionSupport: "nested";
57
61
  /**
58
62
  * Gets list of supported column data types by a driver.
59
63
  *
@@ -31,6 +31,10 @@ var AuroraDataApiDriver = /** @class */ (function () {
31
31
  * Indicates if tree tables are supported by this driver.
32
32
  */
33
33
  this.treeSupport = true;
34
+ /**
35
+ * Represent transaction support by this driver
36
+ */
37
+ this.transactionSupport = "nested";
34
38
  /**
35
39
  * Gets list of supported column data types by a driver.
36
40
  *