typeorm 0.2.25 → 0.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -7
- package/browser/cache/DbQueryResultCache.js +14 -14
- package/browser/cache/DbQueryResultCache.js.map +1 -1
- package/browser/cache/RedisQueryResultCache.js +19 -14
- package/browser/cache/RedisQueryResultCache.js.map +1 -1
- package/browser/common/DeepPartial.d.ts +1 -1
- package/browser/common/DeepPartial.js.map +1 -1
- package/browser/common/EntityTarget.d.ts +9 -0
- package/browser/common/EntityTarget.js +3 -0
- package/browser/common/EntityTarget.js.map +1 -0
- package/browser/connection/Connection.d.ts +11 -10
- package/browser/connection/Connection.js +63 -40
- package/browser/connection/Connection.js.map +1 -1
- package/browser/connection/ConnectionMetadataBuilder.js +8 -8
- package/browser/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/browser/connection/ConnectionOptions.d.ts +2 -1
- package/browser/connection/ConnectionOptions.js.map +1 -1
- package/browser/connection/ConnectionOptionsReader.js +48 -43
- package/browser/connection/ConnectionOptionsReader.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsEnvReader.d.ts +5 -1
- package/browser/connection/options-reader/ConnectionOptionsEnvReader.js +45 -31
- package/browser/connection/options-reader/ConnectionOptionsEnvReader.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsXmlReader.js +4 -4
- package/browser/connection/options-reader/ConnectionOptionsXmlReader.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.d.ts +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js +15 -4
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/browser/decorator/Check.d.ts +2 -2
- package/browser/decorator/Check.js.map +1 -1
- package/browser/decorator/EntityRepository.d.ts +1 -1
- package/browser/decorator/EntityRepository.js.map +1 -1
- package/browser/decorator/Exclusion.d.ts +2 -2
- package/browser/decorator/Exclusion.js.map +1 -1
- package/browser/decorator/Generated.d.ts +1 -1
- package/browser/decorator/Generated.js.map +1 -1
- package/browser/decorator/Index.d.ts +7 -7
- package/browser/decorator/Index.js.map +1 -1
- package/browser/decorator/Unique.d.ts +4 -4
- package/browser/decorator/Unique.js +12 -1
- package/browser/decorator/Unique.js.map +1 -1
- package/browser/decorator/columns/Column.d.ts +12 -12
- package/browser/decorator/columns/Column.js.map +1 -1
- package/browser/decorator/columns/CreateDateColumn.d.ts +1 -1
- package/browser/decorator/columns/CreateDateColumn.js.map +1 -1
- package/browser/decorator/columns/DeleteDateColumn.d.ts +1 -1
- package/browser/decorator/columns/DeleteDateColumn.js.map +1 -1
- package/browser/decorator/columns/ObjectIdColumn.d.ts +1 -1
- package/browser/decorator/columns/ObjectIdColumn.js.map +1 -1
- package/browser/decorator/columns/PrimaryColumn.d.ts +2 -2
- package/browser/decorator/columns/PrimaryColumn.js.map +1 -1
- package/browser/decorator/columns/PrimaryGeneratedColumn.d.ts +5 -5
- package/browser/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/browser/decorator/columns/UpdateDateColumn.d.ts +1 -1
- package/browser/decorator/columns/UpdateDateColumn.js.map +1 -1
- package/browser/decorator/columns/VersionColumn.d.ts +1 -1
- package/browser/decorator/columns/VersionColumn.js.map +1 -1
- package/browser/decorator/columns/ViewColumn.d.ts +1 -1
- package/browser/decorator/columns/ViewColumn.js.map +1 -1
- package/browser/decorator/entity/ChildEntity.d.ts +1 -1
- package/browser/decorator/entity/ChildEntity.js +1 -1
- package/browser/decorator/entity/ChildEntity.js.map +1 -1
- package/browser/decorator/entity/TableInheritance.d.ts +1 -1
- package/browser/decorator/entity/TableInheritance.js.map +1 -1
- package/browser/decorator/entity-view/ViewEntity.d.ts +2 -2
- package/browser/decorator/entity-view/ViewEntity.js.map +1 -1
- package/browser/decorator/listeners/AfterInsert.d.ts +1 -1
- package/browser/decorator/listeners/AfterInsert.js.map +1 -1
- package/browser/decorator/listeners/AfterLoad.d.ts +1 -1
- package/browser/decorator/listeners/AfterLoad.js.map +1 -1
- package/browser/decorator/listeners/AfterRemove.d.ts +1 -1
- package/browser/decorator/listeners/AfterRemove.js.map +1 -1
- package/browser/decorator/listeners/AfterUpdate.d.ts +1 -1
- package/browser/decorator/listeners/AfterUpdate.js.map +1 -1
- package/browser/decorator/listeners/BeforeInsert.d.ts +1 -1
- package/browser/decorator/listeners/BeforeInsert.js.map +1 -1
- package/browser/decorator/listeners/BeforeRemove.d.ts +1 -1
- package/browser/decorator/listeners/BeforeRemove.js.map +1 -1
- package/browser/decorator/listeners/BeforeUpdate.d.ts +1 -1
- package/browser/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/browser/decorator/listeners/EventSubscriber.d.ts +1 -1
- package/browser/decorator/listeners/EventSubscriber.js.map +1 -1
- package/browser/decorator/options/ColumnOptions.js.map +1 -1
- package/browser/decorator/options/TransactionOptions.js.map +1 -1
- package/browser/decorator/relations/JoinColumn.d.ts +3 -3
- package/browser/decorator/relations/JoinColumn.js.map +1 -1
- package/browser/decorator/relations/JoinTable.d.ts +3 -3
- package/browser/decorator/relations/JoinTable.js.map +1 -1
- package/browser/decorator/relations/ManyToMany.d.ts +2 -2
- package/browser/decorator/relations/ManyToMany.js.map +1 -1
- package/browser/decorator/relations/ManyToOne.d.ts +2 -2
- package/browser/decorator/relations/ManyToOne.js.map +1 -1
- package/browser/decorator/relations/OneToMany.d.ts +3 -3
- package/browser/decorator/relations/OneToMany.js +2 -2
- package/browser/decorator/relations/OneToMany.js.map +1 -1
- package/browser/decorator/relations/OneToOne.d.ts +2 -2
- package/browser/decorator/relations/OneToOne.js.map +1 -1
- package/browser/decorator/relations/RelationCount.d.ts +1 -1
- package/browser/decorator/relations/RelationCount.js.map +1 -1
- package/browser/decorator/relations/RelationId.d.ts +1 -1
- package/browser/decorator/relations/RelationId.js.map +1 -1
- package/browser/decorator/transaction/Transaction.js +4 -4
- package/browser/decorator/transaction/Transaction.js.map +1 -1
- package/browser/decorator/transaction/TransactionManager.d.ts +1 -1
- package/browser/decorator/transaction/TransactionManager.js.map +1 -1
- package/browser/decorator/tree/Tree.d.ts +1 -1
- package/browser/decorator/tree/Tree.js.map +1 -1
- package/browser/decorator/tree/TreeChildren.d.ts +1 -1
- package/browser/decorator/tree/TreeChildren.js.map +1 -1
- package/browser/decorator/tree/TreeLevelColumn.d.ts +1 -1
- package/browser/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/browser/decorator/tree/TreeParent.d.ts +1 -1
- package/browser/decorator/tree/TreeParent.js.map +1 -1
- package/browser/driver/Driver.d.ts +7 -2
- package/browser/driver/Driver.js.map +1 -1
- package/browser/driver/DriverFactory.js +4 -1
- package/browser/driver/DriverFactory.js.map +1 -1
- package/browser/driver/DriverUtils.d.ts +2 -2
- package/browser/driver/DriverUtils.js +27 -15
- package/browser/driver/DriverUtils.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiConnection.d.ts +2 -1
- package/browser/driver/aurora-data-api/AuroraDataApiConnection.js +2 -3
- package/browser/driver/aurora-data-api/AuroraDataApiConnection.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +3 -0
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.d.ts +6 -1
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js +14 -9
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.d.ts +5 -0
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +283 -149
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +6 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.d.ts +57 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +99 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.d.ts +4 -3
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +66 -20
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +50 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js +3 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -0
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.d.ts +46 -0
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js +125 -0
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -0
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.d.ts +22 -0
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js +113 -0
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -0
- package/browser/driver/cockroachdb/CockroachConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachDriver.d.ts +6 -1
- package/browser/driver/cockroachdb/CockroachDriver.js +21 -16
- package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.d.ts +7 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +509 -211
- package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/browser/driver/cordova/CordovaDriver.d.ts +2 -1
- package/browser/driver/cordova/CordovaDriver.js +4 -5
- package/browser/driver/cordova/CordovaDriver.js.map +1 -1
- package/browser/driver/cordova/CordovaQueryRunner.js +4 -4
- package/browser/driver/cordova/CordovaQueryRunner.js.map +1 -1
- package/browser/driver/expo/ExpoDriver.d.ts +2 -1
- package/browser/driver/expo/ExpoDriver.js +4 -5
- package/browser/driver/expo/ExpoDriver.js.map +1 -1
- package/browser/driver/expo/ExpoQueryRunner.js +82 -24
- package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/MongoConnectionOptions.d.ts +4 -0
- package/browser/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/browser/driver/mongodb/MongoDriver.d.ts +13 -4
- package/browser/driver/mongodb/MongoDriver.js +24 -18
- package/browser/driver/mongodb/MongoDriver.js.map +1 -1
- package/browser/driver/mongodb/MongoQueryRunner.d.ts +4 -3
- package/browser/driver/mongodb/MongoQueryRunner.js +175 -175
- package/browser/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/typings.js.map +1 -1
- package/browser/driver/mysql/MysqlDriver.d.ts +7 -2
- package/browser/driver/mysql/MysqlDriver.js +20 -13
- package/browser/driver/mysql/MysqlDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.d.ts +11 -1
- package/browser/driver/mysql/MysqlQueryRunner.js +351 -185
- package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/browser/driver/nativescript/NativescriptDriver.d.ts +2 -1
- package/browser/driver/nativescript/NativescriptDriver.js +4 -5
- package/browser/driver/nativescript/NativescriptDriver.js.map +1 -1
- package/browser/driver/nativescript/NativescriptQueryRunner.js +2 -2
- package/browser/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/browser/driver/oracle/OracleDriver.d.ts +6 -1
- package/browser/driver/oracle/OracleDriver.js +17 -12
- package/browser/driver/oracle/OracleDriver.js.map +1 -1
- package/browser/driver/oracle/OracleQueryRunner.d.ts +3 -1
- package/browser/driver/oracle/OracleQueryRunner.js +247 -134
- package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.d.ts +9 -0
- package/browser/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresDriver.d.ts +18 -55
- package/browser/driver/postgres/PostgresDriver.js +196 -206
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.d.ts +11 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +517 -209
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/react-native/ReactNativeDriver.d.ts +2 -1
- package/browser/driver/react-native/ReactNativeDriver.js +4 -5
- package/browser/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/browser/driver/react-native/ReactNativeQueryRunner.js +4 -4
- package/browser/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
- package/browser/driver/sap/SapDriver.d.ts +6 -1
- package/browser/driver/sap/SapDriver.js +12 -7
- package/browser/driver/sap/SapDriver.js.map +1 -1
- package/browser/driver/sap/SapQueryRunner.d.ts +3 -1
- package/browser/driver/sap/SapQueryRunner.js +276 -160
- package/browser/driver/sap/SapQueryRunner.js.map +1 -1
- package/browser/driver/sqlite/SqliteConnectionOptions.d.ts +18 -0
- package/browser/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/browser/driver/sqlite/SqliteDriver.d.ts +2 -1
- package/browser/driver/sqlite/SqliteDriver.js +31 -17
- package/browser/driver/sqlite/SqliteDriver.js.map +1 -1
- package/browser/driver/sqlite/SqliteQueryRunner.js +37 -18
- package/browser/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteDriver.d.ts +7 -2
- package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js +36 -9
- package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.d.ts +1 -0
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +189 -127
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqljs/SqljsDriver.d.ts +2 -1
- package/browser/driver/sqljs/SqljsDriver.js +14 -15
- package/browser/driver/sqljs/SqljsDriver.js.map +1 -1
- package/browser/driver/sqljs/SqljsQueryRunner.js +7 -6
- package/browser/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerDriver.d.ts +6 -1
- package/browser/driver/sqlserver/SqlServerDriver.js +13 -8
- package/browser/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.d.ts +3 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.js +368 -230
- package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/browser/driver/types/ColumnTypes.d.ts +1 -1
- package/browser/driver/types/ColumnTypes.js.map +1 -1
- package/browser/driver/types/DatabaseType.d.ts +1 -1
- package/browser/driver/types/DatabaseType.js.map +1 -1
- package/browser/driver/types/ReplicationMode.d.ts +1 -0
- package/browser/driver/types/ReplicationMode.js +3 -0
- package/browser/driver/types/ReplicationMode.js.map +1 -0
- package/browser/entity-manager/EntityManager.d.ts +41 -256
- package/browser/entity-manager/EntityManager.js +32 -42
- package/browser/entity-manager/EntityManager.js.map +1 -1
- package/browser/entity-manager/MongoEntityManager.d.ts +46 -46
- package/browser/entity-manager/MongoEntityManager.js +31 -20
- package/browser/entity-manager/MongoEntityManager.js.map +1 -1
- package/browser/entity-manager/SqljsEntityManager.js +6 -6
- package/browser/entity-manager/SqljsEntityManager.js.map +1 -1
- package/browser/entity-schema/EntitySchemaColumnOptions.js.map +1 -1
- package/browser/entity-schema/EntitySchemaRelationOptions.d.ts +1 -1
- package/browser/entity-schema/EntitySchemaRelationOptions.js.map +1 -1
- package/browser/entity-schema/EntitySchemaTransformer.js +22 -7
- package/browser/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/browser/error/AlreadyHasActiveConnectionError.js +2 -2
- package/browser/error/AlreadyHasActiveConnectionError.js.map +1 -1
- package/browser/error/CannotAttachTreeChildrenEntityError.js +2 -2
- package/browser/error/CannotAttachTreeChildrenEntityError.js.map +1 -1
- package/browser/error/CannotConnectAlreadyConnectedError.js +2 -2
- package/browser/error/CannotConnectAlreadyConnectedError.js.map +1 -1
- package/browser/error/CannotCreateEntityIdMapError.js +2 -2
- package/browser/error/CannotCreateEntityIdMapError.js.map +1 -1
- package/browser/error/CannotDetermineEntityError.js +2 -2
- package/browser/error/CannotDetermineEntityError.js.map +1 -1
- package/browser/error/CannotExecuteNotConnectedError.js +2 -2
- package/browser/error/CannotExecuteNotConnectedError.js.map +1 -1
- package/browser/error/CannotGetEntityManagerNotConnectedError.js +2 -2
- package/browser/error/CannotGetEntityManagerNotConnectedError.js.map +1 -1
- package/browser/error/CannotReflectMethodParameterTypeError.js +2 -2
- package/browser/error/CannotReflectMethodParameterTypeError.js.map +1 -1
- package/browser/error/CircularRelationsError.js +2 -2
- package/browser/error/CircularRelationsError.js.map +1 -1
- package/browser/error/ColumnTypeUndefinedError.js +2 -2
- package/browser/error/ColumnTypeUndefinedError.js.map +1 -1
- package/browser/error/ConnectionIsNotSetError.js +2 -2
- package/browser/error/ConnectionIsNotSetError.js.map +1 -1
- package/browser/error/ConnectionNotFoundError.js +2 -2
- package/browser/error/ConnectionNotFoundError.js.map +1 -1
- package/browser/error/CustomRepositoryCannotInheritRepositoryError.js +2 -2
- package/browser/error/CustomRepositoryCannotInheritRepositoryError.js.map +1 -1
- package/browser/error/CustomRepositoryDoesNotHaveEntityError.js +2 -2
- package/browser/error/CustomRepositoryDoesNotHaveEntityError.js.map +1 -1
- package/browser/error/CustomRepositoryNotFoundError.js +2 -2
- package/browser/error/CustomRepositoryNotFoundError.js.map +1 -1
- package/browser/error/DataTypeNotSupportedError.js +2 -2
- package/browser/error/DataTypeNotSupportedError.js.map +1 -1
- package/browser/error/DriverOptionNotSetError.js +2 -2
- package/browser/error/DriverOptionNotSetError.js.map +1 -1
- package/browser/error/DriverPackageNotInstalledError.js +2 -2
- package/browser/error/DriverPackageNotInstalledError.js.map +1 -1
- package/browser/error/EntityColumnNotFound.js +2 -2
- package/browser/error/EntityColumnNotFound.js.map +1 -1
- package/browser/error/EntityMetadataNotFoundError.d.ts +2 -2
- package/browser/error/EntityMetadataNotFoundError.js +5 -2
- package/browser/error/EntityMetadataNotFoundError.js.map +1 -1
- package/browser/error/EntityNotFoundError.d.ts +2 -3
- package/browser/error/EntityNotFoundError.js +5 -2
- package/browser/error/EntityNotFoundError.js.map +1 -1
- package/browser/error/FindRelationsNotFoundError.js +4 -4
- package/browser/error/FindRelationsNotFoundError.js.map +1 -1
- package/browser/error/InitializedRelationError.js +2 -2
- package/browser/error/InitializedRelationError.js.map +1 -1
- package/browser/error/InsertValuesMissingError.js +2 -2
- package/browser/error/InsertValuesMissingError.js.map +1 -1
- package/browser/error/LimitOnUpdateNotSupportedError.js +2 -2
- package/browser/error/LimitOnUpdateNotSupportedError.js.map +1 -1
- package/browser/error/LockNotSupportedOnGivenDriverError.js +2 -2
- package/browser/error/LockNotSupportedOnGivenDriverError.js.map +1 -1
- package/browser/error/MetadataAlreadyExistsError.js +2 -2
- package/browser/error/MetadataAlreadyExistsError.js.map +1 -1
- package/browser/error/MetadataWithSuchNameAlreadyExistsError.js +2 -2
- package/browser/error/MetadataWithSuchNameAlreadyExistsError.js.map +1 -1
- package/browser/error/MissingDeleteDateColumnError.js +2 -2
- package/browser/error/MissingDeleteDateColumnError.js.map +1 -1
- package/browser/error/MissingDriverError.js +3 -3
- package/browser/error/MissingDriverError.js.map +1 -1
- package/browser/error/MissingJoinColumnError.js +2 -2
- package/browser/error/MissingJoinColumnError.js.map +1 -1
- package/browser/error/MissingJoinTableError.js +2 -2
- package/browser/error/MissingJoinTableError.js.map +1 -1
- package/browser/error/MissingPrimaryColumnError.js +2 -2
- package/browser/error/MissingPrimaryColumnError.js.map +1 -1
- package/browser/error/MustBeEntityError.js +2 -2
- package/browser/error/MustBeEntityError.js.map +1 -1
- package/browser/error/NamingStrategyNotFoundError.js +2 -2
- package/browser/error/NamingStrategyNotFoundError.js.map +1 -1
- package/browser/error/NoConnectionForRepositoryError.js +2 -2
- package/browser/error/NoConnectionForRepositoryError.js.map +1 -1
- package/browser/error/NoConnectionOptionError.js +2 -2
- package/browser/error/NoConnectionOptionError.js.map +1 -1
- package/browser/error/NoNeedToReleaseEntityManagerError.js +2 -2
- package/browser/error/NoNeedToReleaseEntityManagerError.js.map +1 -1
- package/browser/error/NoVersionOrUpdateDateColumnError.js +2 -2
- package/browser/error/NoVersionOrUpdateDateColumnError.js.map +1 -1
- package/browser/error/OffsetWithoutLimitNotSupportedError.js +2 -2
- package/browser/error/OffsetWithoutLimitNotSupportedError.js.map +1 -1
- package/browser/error/OptimisticLockCanNotBeUsedError.js +2 -2
- package/browser/error/OptimisticLockCanNotBeUsedError.js.map +1 -1
- package/browser/error/OptimisticLockVersionMismatchError.js +2 -2
- package/browser/error/OptimisticLockVersionMismatchError.js.map +1 -1
- package/browser/error/PersistedEntityNotFoundError.js +2 -2
- package/browser/error/PersistedEntityNotFoundError.js.map +1 -1
- package/browser/error/PessimisticLockTransactionRequiredError.js +2 -2
- package/browser/error/PessimisticLockTransactionRequiredError.js.map +1 -1
- package/browser/error/PrimaryColumnCannotBeNullableError.js +2 -2
- package/browser/error/PrimaryColumnCannotBeNullableError.js.map +1 -1
- package/browser/error/QueryFailedError.js +3 -3
- package/browser/error/QueryFailedError.js.map +1 -1
- package/browser/error/QueryRunnerAlreadyReleasedError.js +2 -2
- package/browser/error/QueryRunnerAlreadyReleasedError.js.map +1 -1
- package/browser/error/QueryRunnerProviderAlreadyReleasedError.js +2 -2
- package/browser/error/QueryRunnerProviderAlreadyReleasedError.js.map +1 -1
- package/browser/error/RepositoryNotFoundError.d.ts +2 -2
- package/browser/error/RepositoryNotFoundError.js +5 -2
- package/browser/error/RepositoryNotFoundError.js.map +1 -1
- package/browser/error/RepositoryNotTreeError.d.ts +2 -2
- package/browser/error/RepositoryNotTreeError.js +11 -8
- package/browser/error/RepositoryNotTreeError.js.map +1 -1
- package/browser/error/ReturningStatementNotSupportedError.js +2 -2
- package/browser/error/ReturningStatementNotSupportedError.js.map +1 -1
- package/browser/error/SubjectRemovedAndUpdatedError.js +2 -2
- package/browser/error/SubjectRemovedAndUpdatedError.js.map +1 -1
- package/browser/error/SubjectWithoutIdentifierError.js +2 -2
- package/browser/error/SubjectWithoutIdentifierError.js.map +1 -1
- package/browser/error/TransactionAlreadyStartedError.js +2 -2
- package/browser/error/TransactionAlreadyStartedError.js.map +1 -1
- package/browser/error/TransactionNotStartedError.js +2 -2
- package/browser/error/TransactionNotStartedError.js.map +1 -1
- package/browser/error/TreeRepositoryNotSupportedError.js +2 -2
- package/browser/error/TreeRepositoryNotSupportedError.js.map +1 -1
- package/browser/error/UpdateValuesMissingError.js +2 -2
- package/browser/error/UpdateValuesMissingError.js.map +1 -1
- package/browser/error/UsingJoinColumnIsNotAllowedError.js +2 -2
- package/browser/error/UsingJoinColumnIsNotAllowedError.js.map +1 -1
- package/browser/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +2 -2
- package/browser/error/UsingJoinColumnOnlyOnOneSideAllowedError.js.map +1 -1
- package/browser/error/UsingJoinTableIsNotAllowedError.js +2 -2
- package/browser/error/UsingJoinTableIsNotAllowedError.js.map +1 -1
- package/browser/error/UsingJoinTableOnlyOnOneSideAllowedError.js +2 -2
- package/browser/error/UsingJoinTableOnlyOnOneSideAllowedError.js.map +1 -1
- package/browser/find-options/FindOneOptions.d.ts +4 -0
- package/browser/find-options/FindOneOptions.js.map +1 -1
- package/browser/find-options/FindOperator.d.ts +26 -4
- package/browser/find-options/FindOperator.js +49 -50
- package/browser/find-options/FindOperator.js.map +1 -1
- package/browser/find-options/FindOperatorType.d.ts +1 -1
- package/browser/find-options/FindOperatorType.js.map +1 -1
- package/browser/find-options/FindOptionsUtils.d.ts +2 -2
- package/browser/find-options/FindOptionsUtils.js +5 -1
- package/browser/find-options/FindOptionsUtils.js.map +1 -1
- package/browser/find-options/operator/Any.d.ts +1 -1
- package/browser/find-options/operator/Any.js.map +1 -1
- package/browser/find-options/operator/Between.d.ts +1 -1
- package/browser/find-options/operator/Between.js.map +1 -1
- package/browser/find-options/operator/ILike.d.ts +6 -0
- package/browser/find-options/operator/ILike.js +10 -0
- package/browser/find-options/operator/ILike.js.map +1 -0
- package/browser/find-options/operator/In.d.ts +1 -1
- package/browser/find-options/operator/In.js.map +1 -1
- package/browser/find-options/operator/Raw.d.ts +14 -2
- package/browser/find-options/operator/Raw.js +5 -6
- package/browser/find-options/operator/Raw.js.map +1 -1
- package/browser/index.d.ts +10 -11
- package/browser/index.js +9 -15
- package/browser/index.js.map +1 -1
- package/browser/logger/DebugLogger.d.ts +0 -1
- package/browser/logger/DebugLogger.js +9 -9
- package/browser/logger/DebugLogger.js.map +1 -1
- package/browser/logger/FileLogger.d.ts +3 -1
- package/browser/logger/FileLogger.js +9 -3
- package/browser/logger/FileLogger.js.map +1 -1
- package/browser/logger/Logger.d.ts +1 -1
- package/browser/logger/Logger.js.map +1 -1
- package/browser/logger/LoggerOptions.d.ts +9 -0
- package/browser/logger/LoggerOptions.js.map +1 -1
- package/browser/metadata/ColumnMetadata.js +29 -19
- package/browser/metadata/ColumnMetadata.js.map +1 -1
- package/browser/metadata/EmbeddedMetadata.js +2 -2
- package/browser/metadata/EmbeddedMetadata.js.map +1 -1
- package/browser/metadata/EntityMetadata.d.ts +1 -0
- package/browser/metadata/EntityMetadata.js +13 -5
- package/browser/metadata/EntityMetadata.js.map +1 -1
- package/browser/metadata/RelationMetadata.js +7 -7
- package/browser/metadata/RelationMetadata.js.map +1 -1
- package/browser/metadata/types/EventListenerTypes.d.ts +7 -7
- package/browser/metadata/types/EventListenerTypes.js.map +1 -1
- package/browser/metadata-args/EntityRepositoryMetadataArgs.d.ts +2 -2
- package/browser/metadata-args/EntityRepositoryMetadataArgs.js.map +1 -1
- package/browser/metadata-args/RelationCountMetadataArgs.js.map +1 -1
- package/browser/metadata-args/RelationIdMetadataArgs.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataBuilder.js +21 -15
- package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataValidator.js +8 -5
- package/browser/metadata-builder/EntityMetadataValidator.js.map +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js +3 -2
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/browser/migration/MigrationExecutor.js +132 -103
- package/browser/migration/MigrationExecutor.js.map +1 -1
- package/browser/naming-strategy/DefaultNamingStrategy.js +6 -6
- package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/browser/persistence/EntityPersistExecutor.js +65 -47
- package/browser/persistence/EntityPersistExecutor.js.map +1 -1
- package/browser/persistence/Subject.js +4 -3
- package/browser/persistence/Subject.js.map +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js +9 -8
- package/browser/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/browser/persistence/SubjectExecutor.js +263 -206
- package/browser/persistence/SubjectExecutor.js.map +1 -1
- package/browser/persistence/SubjectTopoligicalSorter.js +6 -6
- package/browser/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/browser/persistence/subject-builder/CascadesSubjectBuilder.js +2 -2
- package/browser/persistence/subject-builder/CascadesSubjectBuilder.js.map +1 -1
- package/browser/persistence/tree/ClosureSubjectExecutor.js +4 -4
- package/browser/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
- package/browser/persistence/tree/MaterializedPathSubjectExecutor.js +5 -4
- package/browser/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/browser/persistence/tree/NestedSetSubjectExecutor.js +3 -3
- package/browser/platform/BrowserConnectionOptionsReaderDummy.d.ts +38 -0
- package/browser/platform/BrowserConnectionOptionsReaderDummy.js +93 -0
- package/browser/platform/BrowserConnectionOptionsReaderDummy.js.map +1 -0
- package/browser/platform/BrowserDirectoryExportedClassesLoader.d.ts +15 -0
- package/browser/platform/BrowserDirectoryExportedClassesLoader.js +22 -0
- package/browser/platform/BrowserDirectoryExportedClassesLoader.js.map +1 -0
- package/browser/platform/BrowserDisabledDriversDummy.d.ts +32 -2
- package/browser/platform/BrowserDisabledDriversDummy.js +52 -2
- package/browser/platform/BrowserDisabledDriversDummy.js.map +1 -1
- package/browser/platform/BrowserFileLoggerDummy.d.ts +33 -0
- package/browser/platform/BrowserFileLoggerDummy.js +58 -0
- package/browser/platform/BrowserFileLoggerDummy.js.map +1 -0
- package/browser/platform/BrowserPlatformTools.d.ts +74 -0
- package/browser/platform/BrowserPlatformTools.js +157 -0
- package/browser/platform/BrowserPlatformTools.js.map +1 -0
- package/browser/platform/PlatformTools.d.ts +15 -21
- package/browser/platform/PlatformTools.js +142 -81
- package/browser/platform/PlatformTools.js.map +1 -1
- package/browser/query-builder/Alias.js.map +1 -1
- package/browser/query-builder/DeleteQueryBuilder.d.ts +2 -3
- package/browser/query-builder/DeleteQueryBuilder.js +12 -6
- package/browser/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/InsertQueryBuilder.d.ts +2 -3
- package/browser/query-builder/InsertQueryBuilder.js +49 -16
- package/browser/query-builder/InsertQueryBuilder.js.map +1 -1
- package/browser/query-builder/JoinAttribute.js +2 -2
- package/browser/query-builder/JoinAttribute.js.map +1 -1
- package/browser/query-builder/QueryBuilder.d.ts +18 -15
- package/browser/query-builder/QueryBuilder.js +205 -55
- package/browser/query-builder/QueryBuilder.js.map +1 -1
- package/browser/query-builder/QueryBuilderUtils.js +2 -2
- package/browser/query-builder/QueryBuilderUtils.js.map +1 -1
- package/browser/query-builder/QueryExpressionMap.d.ts +4 -0
- package/browser/query-builder/QueryExpressionMap.js +4 -4
- package/browser/query-builder/QueryExpressionMap.js.map +1 -1
- package/browser/query-builder/QueryPartialEntity.d.ts +1 -1
- package/browser/query-builder/QueryPartialEntity.js.map +1 -1
- package/browser/query-builder/RelationIdLoader.js +5 -5
- package/browser/query-builder/RelationLoader.js +3 -3
- package/browser/query-builder/RelationLoader.js.map +1 -1
- package/browser/query-builder/RelationQueryBuilder.js +14 -14
- package/browser/query-builder/RelationQueryBuilder.js.map +1 -1
- package/browser/query-builder/RelationRemover.js +7 -7
- package/browser/query-builder/RelationRemover.js.map +1 -1
- package/browser/query-builder/RelationUpdater.js +3 -3
- package/browser/query-builder/ReturningResultsEntityUpdator.js +30 -31
- package/browser/query-builder/ReturningResultsEntityUpdator.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.d.ts +9 -3
- package/browser/query-builder/SelectQueryBuilder.js +116 -68
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-builder/SoftDeleteQueryBuilder.d.ts +2 -3
- package/browser/query-builder/SoftDeleteQueryBuilder.js +6 -6
- package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/UpdateQueryBuilder.js +13 -7
- package/browser/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/browser/query-builder/relation-count/RelationCountAttribute.js +3 -3
- package/browser/query-builder/relation-count/RelationCountAttribute.js.map +1 -1
- package/browser/query-builder/relation-count/RelationCountLoader.js +5 -5
- package/browser/query-builder/relation-id/RelationIdAttribute.js +2 -2
- package/browser/query-builder/relation-id/RelationIdAttribute.js.map +1 -1
- package/browser/query-builder/relation-id/RelationIdLoader.js +6 -6
- package/browser/query-builder/relation-id/RelationIdLoader.js.map +1 -1
- package/browser/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +4 -4
- package/browser/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js.map +1 -1
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js +9 -6
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.d.ts +2 -5
- package/browser/query-runner/BaseQueryRunner.js +106 -56
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/query-runner/QueryRunner.d.ts +2 -1
- package/browser/query-runner/QueryRunner.js.map +1 -1
- package/browser/repository/AbstractRepository.js.map +1 -1
- package/browser/repository/BaseEntity.js +5 -5
- package/browser/repository/BaseEntity.js.map +1 -1
- package/browser/repository/MongoRepository.js +2 -2
- package/browser/repository/MongoRepository.js.map +1 -1
- package/browser/repository/Repository.js +3 -3
- package/browser/repository/Repository.js.map +1 -1
- package/browser/repository/TreeRepository.js +6 -6
- package/browser/repository/TreeRepository.js.map +1 -1
- package/browser/schema-builder/MongoSchemaBuilder.js +4 -4
- package/browser/schema-builder/MongoSchemaBuilder.js.map +1 -1
- package/browser/schema-builder/RdbmsSchemaBuilder.js +924 -368
- package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/browser/schema-builder/options/TableIndexOptions.d.ts +1 -1
- package/browser/schema-builder/options/TableIndexOptions.js.map +1 -1
- package/browser/schema-builder/table/TableCheck.js +2 -2
- package/browser/schema-builder/table/TableCheck.js.map +1 -1
- package/browser/schema-builder/table/TableForeignKey.js +3 -3
- package/browser/schema-builder/table/TableForeignKey.js.map +1 -1
- package/browser/schema-builder/table/TableIndex.js +2 -2
- package/browser/schema-builder/table/TableIndex.js.map +1 -1
- package/browser/schema-builder/table/TableUnique.js +2 -2
- package/browser/schema-builder/table/TableUnique.js.map +1 -1
- package/browser/schema-builder/view/View.d.ts +1 -2
- package/browser/schema-builder/view/View.js.map +1 -1
- package/browser/subscriber/Broadcaster.d.ts +24 -0
- package/browser/subscriber/Broadcaster.js +120 -0
- package/browser/subscriber/Broadcaster.js.map +1 -1
- package/browser/subscriber/EntitySubscriberInterface.d.ts +27 -0
- package/browser/subscriber/EntitySubscriberInterface.js.map +1 -1
- package/browser/subscriber/event/TransactionCommitEvent.d.ts +22 -0
- package/browser/subscriber/event/TransactionCommitEvent.js +3 -0
- package/browser/subscriber/event/TransactionCommitEvent.js.map +1 -0
- package/browser/subscriber/event/TransactionRollbackEvent.d.ts +22 -0
- package/browser/subscriber/event/TransactionRollbackEvent.js +3 -0
- package/browser/subscriber/event/TransactionRollbackEvent.js.map +1 -0
- package/browser/subscriber/event/TransactionStartEvent.d.ts +22 -0
- package/browser/subscriber/event/TransactionStartEvent.js +3 -0
- package/browser/subscriber/event/TransactionStartEvent.js.map +1 -0
- package/browser/util/ApplyValueTransformers.js.map +1 -1
- package/browser/util/DateUtils.js +3 -9
- package/browser/util/DateUtils.js.map +1 -1
- package/browser/util/DirectoryExportedClassesLoader.js +6 -5
- package/browser/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/browser/util/ObjectUtils.js +4 -4
- package/browser/util/ObjectUtils.js.map +1 -1
- package/browser/util/OrmUtils.js +5 -8
- package/browser/util/OrmUtils.js.map +1 -1
- package/cache/DbQueryResultCache.js +1 -1
- package/cache/DbQueryResultCache.js.map +1 -1
- package/cache/RedisQueryResultCache.js +6 -1
- package/cache/RedisQueryResultCache.js.map +1 -1
- package/commands/CacheClearCommand.js +4 -4
- package/commands/CacheClearCommand.js.map +1 -1
- package/commands/CommandUtils.d.ts +1 -1
- package/commands/CommandUtils.js +2 -2
- package/commands/CommandUtils.js.map +1 -1
- package/commands/EntityCreateCommand.js +9 -6
- package/commands/EntityCreateCommand.js.map +1 -1
- package/commands/InitCommand.js +15 -5
- package/commands/InitCommand.js.map +1 -1
- package/commands/MigrationCreateCommand.js +8 -5
- package/commands/MigrationCreateCommand.js.map +1 -1
- package/commands/MigrationGenerateCommand.d.ts +7 -1
- package/commands/MigrationGenerateCommand.js +53 -32
- package/commands/MigrationGenerateCommand.js.map +1 -1
- package/commands/MigrationRevertCommand.js +2 -2
- package/commands/MigrationRevertCommand.js.map +1 -1
- package/commands/MigrationRunCommand.js +2 -2
- package/commands/MigrationRunCommand.js.map +1 -1
- package/commands/MigrationShowCommand.js +2 -2
- package/commands/MigrationShowCommand.js.map +1 -1
- package/commands/QueryCommand.d.ts +2 -0
- package/commands/QueryCommand.js +16 -7
- package/commands/QueryCommand.js.map +1 -1
- package/commands/SchemaDropCommand.js +3 -3
- package/commands/SchemaDropCommand.js.map +1 -1
- package/commands/SchemaLogCommand.js +6 -6
- package/commands/SchemaLogCommand.js.map +1 -1
- package/commands/SchemaSyncCommand.js +3 -3
- package/commands/SchemaSyncCommand.js.map +1 -1
- package/commands/SubscriberCreateCommand.js +8 -5
- package/commands/SubscriberCreateCommand.js.map +1 -1
- package/commands/VersionCommand.js +2 -2
- package/commands/VersionCommand.js.map +1 -1
- package/common/DeepPartial.d.ts +1 -1
- package/common/DeepPartial.js.map +1 -1
- package/common/EntityTarget.d.ts +9 -0
- package/common/EntityTarget.js +4 -0
- package/common/EntityTarget.js.map +1 -0
- package/connection/Connection.d.ts +11 -10
- package/connection/Connection.js +45 -22
- package/connection/Connection.js.map +1 -1
- package/connection/ConnectionOptions.d.ts +2 -1
- package/connection/ConnectionOptions.js.map +1 -1
- package/connection/ConnectionOptionsReader.js +39 -34
- package/connection/ConnectionOptionsReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsEnvReader.d.ts +5 -1
- package/connection/options-reader/ConnectionOptionsEnvReader.js +45 -31
- package/connection/options-reader/ConnectionOptionsEnvReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsXmlReader.js +2 -2
- package/connection/options-reader/ConnectionOptionsXmlReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsYmlReader.d.ts +1 -1
- package/connection/options-reader/ConnectionOptionsYmlReader.js +15 -4
- package/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/decorator/Check.d.ts +2 -2
- package/decorator/Check.js.map +1 -1
- package/decorator/EntityRepository.d.ts +1 -1
- package/decorator/EntityRepository.js.map +1 -1
- package/decorator/Exclusion.d.ts +2 -2
- package/decorator/Exclusion.js.map +1 -1
- package/decorator/Generated.d.ts +1 -1
- package/decorator/Generated.js.map +1 -1
- package/decorator/Index.d.ts +7 -7
- package/decorator/Index.js.map +1 -1
- package/decorator/Unique.d.ts +4 -4
- package/decorator/Unique.js +12 -1
- package/decorator/Unique.js.map +1 -1
- package/decorator/columns/Column.d.ts +12 -12
- package/decorator/columns/Column.js.map +1 -1
- package/decorator/columns/CreateDateColumn.d.ts +1 -1
- package/decorator/columns/CreateDateColumn.js.map +1 -1
- package/decorator/columns/DeleteDateColumn.d.ts +1 -1
- package/decorator/columns/DeleteDateColumn.js.map +1 -1
- package/decorator/columns/ObjectIdColumn.d.ts +1 -1
- package/decorator/columns/ObjectIdColumn.js.map +1 -1
- package/decorator/columns/PrimaryColumn.d.ts +2 -2
- package/decorator/columns/PrimaryColumn.js.map +1 -1
- package/decorator/columns/PrimaryGeneratedColumn.d.ts +5 -5
- package/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/decorator/columns/UpdateDateColumn.d.ts +1 -1
- package/decorator/columns/UpdateDateColumn.js.map +1 -1
- package/decorator/columns/VersionColumn.d.ts +1 -1
- package/decorator/columns/VersionColumn.js.map +1 -1
- package/decorator/columns/ViewColumn.d.ts +1 -1
- package/decorator/columns/ViewColumn.js.map +1 -1
- package/decorator/entity/ChildEntity.d.ts +1 -1
- package/decorator/entity/ChildEntity.js +1 -1
- package/decorator/entity/ChildEntity.js.map +1 -1
- package/decorator/entity/TableInheritance.d.ts +1 -1
- package/decorator/entity/TableInheritance.js.map +1 -1
- package/decorator/entity-view/ViewEntity.d.ts +2 -2
- package/decorator/entity-view/ViewEntity.js.map +1 -1
- package/decorator/listeners/AfterInsert.d.ts +1 -1
- package/decorator/listeners/AfterInsert.js.map +1 -1
- package/decorator/listeners/AfterLoad.d.ts +1 -1
- package/decorator/listeners/AfterLoad.js.map +1 -1
- package/decorator/listeners/AfterRemove.d.ts +1 -1
- package/decorator/listeners/AfterRemove.js.map +1 -1
- package/decorator/listeners/AfterUpdate.d.ts +1 -1
- package/decorator/listeners/AfterUpdate.js.map +1 -1
- package/decorator/listeners/BeforeInsert.d.ts +1 -1
- package/decorator/listeners/BeforeInsert.js.map +1 -1
- package/decorator/listeners/BeforeRemove.d.ts +1 -1
- package/decorator/listeners/BeforeRemove.js.map +1 -1
- package/decorator/listeners/BeforeUpdate.d.ts +1 -1
- package/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/decorator/listeners/EventSubscriber.d.ts +1 -1
- package/decorator/listeners/EventSubscriber.js.map +1 -1
- package/decorator/options/ColumnOptions.js.map +1 -1
- package/decorator/options/TransactionOptions.js.map +1 -1
- package/decorator/relations/JoinColumn.d.ts +3 -3
- package/decorator/relations/JoinColumn.js.map +1 -1
- package/decorator/relations/JoinTable.d.ts +3 -3
- package/decorator/relations/JoinTable.js.map +1 -1
- package/decorator/relations/ManyToMany.d.ts +2 -2
- package/decorator/relations/ManyToMany.js.map +1 -1
- package/decorator/relations/ManyToOne.d.ts +2 -2
- package/decorator/relations/ManyToOne.js.map +1 -1
- package/decorator/relations/OneToMany.d.ts +3 -3
- package/decorator/relations/OneToMany.js +2 -2
- package/decorator/relations/OneToMany.js.map +1 -1
- package/decorator/relations/OneToOne.d.ts +2 -2
- package/decorator/relations/OneToOne.js.map +1 -1
- package/decorator/relations/RelationCount.d.ts +1 -1
- package/decorator/relations/RelationCount.js.map +1 -1
- package/decorator/relations/RelationId.d.ts +1 -1
- package/decorator/relations/RelationId.js.map +1 -1
- package/decorator/transaction/TransactionManager.d.ts +1 -1
- package/decorator/transaction/TransactionManager.js.map +1 -1
- package/decorator/tree/Tree.d.ts +1 -1
- package/decorator/tree/Tree.js.map +1 -1
- package/decorator/tree/TreeChildren.d.ts +1 -1
- package/decorator/tree/TreeChildren.js.map +1 -1
- package/decorator/tree/TreeLevelColumn.d.ts +1 -1
- package/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/decorator/tree/TreeParent.d.ts +1 -1
- package/decorator/tree/TreeParent.js.map +1 -1
- package/driver/Driver.d.ts +7 -2
- package/driver/Driver.js.map +1 -1
- package/driver/DriverFactory.js +5 -2
- package/driver/DriverFactory.js.map +1 -1
- package/driver/DriverUtils.d.ts +2 -2
- package/driver/DriverUtils.js +25 -13
- package/driver/DriverUtils.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.d.ts +2 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js +0 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +3 -0
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiDriver.d.ts +6 -1
- package/driver/aurora-data-api/AuroraDataApiDriver.js +7 -2
- package/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.d.ts +4 -0
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +159 -25
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +6 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.d.ts +57 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +101 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.d.ts +4 -3
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +53 -7
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +50 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js +4 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -0
- package/driver/better-sqlite3/BetterSqlite3Driver.d.ts +46 -0
- package/driver/better-sqlite3/BetterSqlite3Driver.js +127 -0
- package/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -0
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.d.ts +22 -0
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +115 -0
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -0
- package/driver/cockroachdb/CockroachConnectionCredentialsOptions.js.map +1 -1
- package/driver/cockroachdb/CockroachDriver.d.ts +6 -1
- package/driver/cockroachdb/CockroachDriver.js +9 -4
- package/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/driver/cockroachdb/CockroachQueryRunner.d.ts +6 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +392 -94
- package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/driver/cordova/CordovaDriver.d.ts +2 -1
- package/driver/cordova/CordovaDriver.js +0 -1
- package/driver/cordova/CordovaDriver.js.map +1 -1
- package/driver/expo/ExpoDriver.d.ts +2 -1
- package/driver/expo/ExpoDriver.js +0 -1
- package/driver/expo/ExpoDriver.js.map +1 -1
- package/driver/expo/ExpoQueryRunner.js +72 -14
- package/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/driver/mongodb/MongoConnectionOptions.d.ts +4 -0
- package/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/driver/mongodb/MongoDriver.d.ts +13 -4
- package/driver/mongodb/MongoDriver.js +21 -15
- package/driver/mongodb/MongoDriver.js.map +1 -1
- package/driver/mongodb/MongoQueryRunner.d.ts +3 -3
- package/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/driver/mongodb/typings.js.map +1 -1
- package/driver/mysql/MysqlDriver.d.ts +7 -2
- package/driver/mysql/MysqlDriver.js +14 -7
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.d.ts +10 -1
- package/driver/mysql/MysqlQueryRunner.js +227 -61
- package/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/driver/nativescript/NativescriptDriver.d.ts +2 -1
- package/driver/nativescript/NativescriptDriver.js +0 -1
- package/driver/nativescript/NativescriptDriver.js.map +1 -1
- package/driver/oracle/OracleDriver.d.ts +6 -1
- package/driver/oracle/OracleDriver.js +8 -3
- package/driver/oracle/OracleDriver.js.map +1 -1
- package/driver/oracle/OracleQueryRunner.d.ts +2 -1
- package/driver/oracle/OracleQueryRunner.js +139 -26
- package/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/driver/postgres/PostgresConnectionCredentialsOptions.js.map +1 -1
- package/driver/postgres/PostgresConnectionOptions.d.ts +9 -0
- package/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/driver/postgres/PostgresDriver.d.ts +18 -55
- package/driver/postgres/PostgresDriver.js +181 -191
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.d.ts +10 -1
- package/driver/postgres/PostgresQueryRunner.js +389 -81
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/react-native/ReactNativeDriver.d.ts +2 -1
- package/driver/react-native/ReactNativeDriver.js +0 -1
- package/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/driver/sap/SapDriver.d.ts +6 -1
- package/driver/sap/SapDriver.js +6 -1
- package/driver/sap/SapDriver.js.map +1 -1
- package/driver/sap/SapQueryRunner.d.ts +2 -1
- package/driver/sap/SapQueryRunner.js +143 -27
- package/driver/sap/SapQueryRunner.js.map +1 -1
- package/driver/sqlite/SqliteConnectionOptions.d.ts +18 -0
- package/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/driver/sqlite/SqliteDriver.d.ts +2 -1
- package/driver/sqlite/SqliteDriver.js +25 -11
- package/driver/sqlite/SqliteDriver.js.map +1 -1
- package/driver/sqlite/SqliteQueryRunner.js +33 -14
- package/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteDriver.d.ts +7 -2
- package/driver/sqlite-abstract/AbstractSqliteDriver.js +31 -4
- package/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +72 -10
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqljs/SqljsDriver.d.ts +2 -1
- package/driver/sqljs/SqljsDriver.js +0 -1
- package/driver/sqljs/SqljsDriver.js.map +1 -1
- package/driver/sqljs/SqljsQueryRunner.js +1 -0
- package/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/driver/sqlserver/SqlServerDriver.d.ts +6 -1
- package/driver/sqlserver/SqlServerDriver.js +6 -1
- package/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/driver/sqlserver/SqlServerQueryRunner.d.ts +2 -1
- package/driver/sqlserver/SqlServerQueryRunner.js +224 -86
- package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/driver/types/ColumnTypes.d.ts +1 -1
- package/driver/types/ColumnTypes.js.map +1 -1
- package/driver/types/DatabaseType.d.ts +1 -1
- package/driver/types/DatabaseType.js.map +1 -1
- package/driver/types/ReplicationMode.d.ts +1 -0
- package/driver/types/ReplicationMode.js +4 -0
- package/driver/types/ReplicationMode.js.map +1 -0
- package/entity-manager/EntityManager.d.ts +41 -256
- package/entity-manager/EntityManager.js +3 -13
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-manager/MongoEntityManager.d.ts +46 -46
- package/entity-manager/MongoEntityManager.js +14 -3
- package/entity-manager/MongoEntityManager.js.map +1 -1
- package/entity-schema/EntitySchemaColumnOptions.js.map +1 -1
- package/entity-schema/EntitySchemaRelationOptions.d.ts +1 -1
- package/entity-schema/EntitySchemaRelationOptions.js.map +1 -1
- package/entity-schema/EntitySchemaTransformer.js +22 -7
- package/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/error/EntityMetadataNotFoundError.d.ts +2 -2
- package/error/EntityMetadataNotFoundError.js +3 -0
- package/error/EntityMetadataNotFoundError.js.map +1 -1
- package/error/EntityNotFoundError.d.ts +2 -3
- package/error/EntityNotFoundError.js +3 -0
- package/error/EntityNotFoundError.js.map +1 -1
- package/error/FindRelationsNotFoundError.js +2 -2
- package/error/FindRelationsNotFoundError.js.map +1 -1
- package/error/MissingDriverError.js +1 -1
- package/error/MissingDriverError.js.map +1 -1
- package/error/QueryFailedError.js +1 -1
- package/error/QueryFailedError.js.map +1 -1
- package/error/RepositoryNotFoundError.d.ts +2 -2
- package/error/RepositoryNotFoundError.js +3 -0
- package/error/RepositoryNotFoundError.js.map +1 -1
- package/error/RepositoryNotTreeError.d.ts +2 -2
- package/error/RepositoryNotTreeError.js +9 -6
- package/error/RepositoryNotTreeError.js.map +1 -1
- package/find-options/FindOneOptions.d.ts +4 -0
- package/find-options/FindOneOptions.js.map +1 -1
- package/find-options/FindOperator.d.ts +26 -4
- package/find-options/FindOperator.js +49 -50
- package/find-options/FindOperator.js.map +1 -1
- package/find-options/FindOperatorType.d.ts +1 -1
- package/find-options/FindOperatorType.js.map +1 -1
- package/find-options/FindOptionsUtils.d.ts +2 -2
- package/find-options/FindOptionsUtils.js +5 -1
- package/find-options/FindOptionsUtils.js.map +1 -1
- package/find-options/operator/Any.d.ts +1 -1
- package/find-options/operator/Any.js.map +1 -1
- package/find-options/operator/Between.d.ts +1 -1
- package/find-options/operator/Between.js.map +1 -1
- package/find-options/operator/ILike.d.ts +6 -0
- package/find-options/operator/ILike.js +13 -0
- package/find-options/operator/ILike.js.map +1 -0
- package/find-options/operator/In.d.ts +1 -1
- package/find-options/operator/In.js.map +1 -1
- package/find-options/operator/Raw.d.ts +14 -2
- package/find-options/operator/Raw.js +5 -6
- package/find-options/operator/Raw.js.map +1 -1
- package/index.d.ts +10 -11
- package/index.js +2 -14
- package/index.js.map +1 -1
- package/logger/DebugLogger.d.ts +0 -1
- package/logger/DebugLogger.js +10 -9
- package/logger/DebugLogger.js.map +1 -1
- package/logger/FileLogger.d.ts +3 -1
- package/logger/FileLogger.js +10 -3
- package/logger/FileLogger.js.map +1 -1
- package/logger/Logger.d.ts +1 -1
- package/logger/Logger.js.map +1 -1
- package/logger/LoggerOptions.d.ts +9 -0
- package/logger/LoggerOptions.js.map +1 -1
- package/metadata/ColumnMetadata.js +24 -14
- package/metadata/ColumnMetadata.js.map +1 -1
- package/metadata/EntityMetadata.d.ts +1 -0
- package/metadata/EntityMetadata.js +11 -3
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/RelationMetadata.js +2 -2
- package/metadata/RelationMetadata.js.map +1 -1
- package/metadata/types/EventListenerTypes.d.ts +7 -7
- package/metadata/types/EventListenerTypes.js.map +1 -1
- package/metadata-args/EntityRepositoryMetadataArgs.d.ts +2 -2
- package/metadata-args/EntityRepositoryMetadataArgs.js.map +1 -1
- package/metadata-args/RelationCountMetadataArgs.js.map +1 -1
- package/metadata-args/RelationIdMetadataArgs.js.map +1 -1
- package/metadata-builder/EntityMetadataBuilder.js +15 -9
- package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/metadata-builder/EntityMetadataValidator.js +8 -5
- package/metadata-builder/EntityMetadataValidator.js.map +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js +1 -0
- package/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/migration/MigrationExecutor.js +103 -74
- package/migration/MigrationExecutor.js.map +1 -1
- package/package.json +72 -51
- package/persistence/EntityPersistExecutor.js +61 -43
- package/persistence/EntityPersistExecutor.js.map +1 -1
- package/persistence/Subject.js +2 -1
- package/persistence/Subject.js.map +1 -1
- package/persistence/SubjectDatabaseEntityLoader.js +2 -1
- package/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/persistence/SubjectExecutor.js +244 -187
- package/persistence/SubjectExecutor.js.map +1 -1
- package/persistence/tree/MaterializedPathSubjectExecutor.js +2 -1
- package/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/platform/PlatformTools.d.ts +7 -1
- package/platform/PlatformTools.js +42 -41
- package/platform/PlatformTools.js.map +1 -1
- package/query-builder/Alias.js.map +1 -1
- package/query-builder/DeleteQueryBuilder.d.ts +2 -3
- package/query-builder/DeleteQueryBuilder.js +7 -1
- package/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/query-builder/InsertQueryBuilder.d.ts +2 -3
- package/query-builder/InsertQueryBuilder.js +44 -11
- package/query-builder/InsertQueryBuilder.js.map +1 -1
- package/query-builder/QueryBuilder.d.ts +18 -15
- package/query-builder/QueryBuilder.js +198 -48
- package/query-builder/QueryBuilder.js.map +1 -1
- package/query-builder/QueryExpressionMap.d.ts +4 -0
- package/query-builder/QueryExpressionMap.js.map +1 -1
- package/query-builder/QueryPartialEntity.d.ts +1 -1
- package/query-builder/QueryPartialEntity.js.map +1 -1
- package/query-builder/ReturningResultsEntityUpdator.js +23 -24
- package/query-builder/ReturningResultsEntityUpdator.js.map +1 -1
- package/query-builder/SelectQueryBuilder.d.ts +8 -3
- package/query-builder/SelectQueryBuilder.js +80 -32
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-builder/SoftDeleteQueryBuilder.d.ts +2 -3
- package/query-builder/SoftDeleteQueryBuilder.js +1 -1
- package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/query-builder/UpdateQueryBuilder.js +8 -2
- package/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js +6 -3
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/query-runner/BaseQueryRunner.d.ts +2 -5
- package/query-runner/BaseQueryRunner.js +90 -40
- package/query-runner/BaseQueryRunner.js.map +1 -1
- package/query-runner/QueryRunner.d.ts +1 -1
- package/query-runner/QueryRunner.js.map +1 -1
- package/repository/AbstractRepository.js.map +1 -1
- package/repository/BaseEntity.js +1 -1
- package/repository/BaseEntity.js.map +1 -1
- package/repository/MongoRepository.js.map +1 -1
- package/repository/Repository.js +1 -1
- package/repository/Repository.js.map +1 -1
- package/repository/TreeRepository.js +2 -2
- package/repository/TreeRepository.js.map +1 -1
- package/schema-builder/MongoSchemaBuilder.js +1 -1
- package/schema-builder/MongoSchemaBuilder.js.map +1 -1
- package/schema-builder/RdbmsSchemaBuilder.js +875 -319
- package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/schema-builder/options/TableIndexOptions.d.ts +1 -1
- package/schema-builder/options/TableIndexOptions.js.map +1 -1
- package/schema-builder/view/View.d.ts +1 -2
- package/schema-builder/view/View.js.map +1 -1
- package/subscriber/Broadcaster.d.ts +24 -0
- package/subscriber/Broadcaster.js +120 -0
- package/subscriber/Broadcaster.js.map +1 -1
- package/subscriber/EntitySubscriberInterface.d.ts +27 -0
- package/subscriber/EntitySubscriberInterface.js.map +1 -1
- package/subscriber/event/TransactionCommitEvent.d.ts +22 -0
- package/subscriber/event/TransactionCommitEvent.js +4 -0
- package/subscriber/event/TransactionCommitEvent.js.map +1 -0
- package/subscriber/event/TransactionRollbackEvent.d.ts +22 -0
- package/subscriber/event/TransactionRollbackEvent.js +4 -0
- package/subscriber/event/TransactionRollbackEvent.js.map +1 -0
- package/subscriber/event/TransactionStartEvent.d.ts +22 -0
- package/subscriber/event/TransactionStartEvent.js +4 -0
- package/subscriber/event/TransactionStartEvent.js.map +1 -0
- package/typeorm-class-transformer-shim.js +16 -2
- package/typeorm-model-shim.js +146 -111
- package/util/ApplyValueTransformers.js.map +1 -1
- package/util/DateUtils.js +1 -7
- package/util/DateUtils.js.map +1 -1
- package/util/DirectoryExportedClassesLoader.js +7 -5
- package/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/util/ObjectUtils.js +2 -2
- package/util/ObjectUtils.js.map +1 -1
- package/util/OrmUtils.js +3 -6
- package/util/OrmUtils.js.map +1 -1
- package/browser/util/PromiseUtils.d.ts +0 -24
- package/browser/util/PromiseUtils.js +0 -62
- package/browser/util/PromiseUtils.js.map +0 -1
- package/util/PromiseUtils.d.ts +0 -24
- package/util/PromiseUtils.js +0 -64
- package/util/PromiseUtils.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { __awaiter, __extends, __generator, __read, __values } from "tslib";
|
|
2
2
|
import { TransactionAlreadyStartedError } from "../../error/TransactionAlreadyStartedError";
|
|
3
3
|
import { TransactionNotStartedError } from "../../error/TransactionNotStartedError";
|
|
4
4
|
import { TableColumn } from "../../schema-builder/table/TableColumn";
|
|
@@ -13,18 +13,17 @@ import { QueryFailedError } from "../../error/QueryFailedError";
|
|
|
13
13
|
import { TableUnique } from "../../schema-builder/table/TableUnique";
|
|
14
14
|
import { BaseQueryRunner } from "../../query-runner/BaseQueryRunner";
|
|
15
15
|
import { Broadcaster } from "../../subscriber/Broadcaster";
|
|
16
|
-
import { PromiseUtils } from "../../index";
|
|
17
16
|
import { VersionUtils } from "../../util/VersionUtils";
|
|
17
|
+
import { BroadcasterResult } from "../../subscriber/BroadcasterResult";
|
|
18
18
|
/**
|
|
19
19
|
* Runs queries on a single mysql database connection.
|
|
20
20
|
*/
|
|
21
21
|
var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
22
|
-
|
|
22
|
+
__extends(MysqlQueryRunner, _super);
|
|
23
23
|
// -------------------------------------------------------------------------
|
|
24
24
|
// Constructor
|
|
25
25
|
// -------------------------------------------------------------------------
|
|
26
26
|
function MysqlQueryRunner(driver, mode) {
|
|
27
|
-
if (mode === void 0) { mode = "master"; }
|
|
28
27
|
var _this = _super.call(this) || this;
|
|
29
28
|
_this.driver = driver;
|
|
30
29
|
_this.connection = driver.connection;
|
|
@@ -73,26 +72,43 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
73
72
|
* Starts transaction on the current connection.
|
|
74
73
|
*/
|
|
75
74
|
MysqlQueryRunner.prototype.startTransaction = function (isolationLevel) {
|
|
76
|
-
return
|
|
77
|
-
|
|
75
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
76
|
+
var beforeBroadcastResult, afterBroadcastResult;
|
|
77
|
+
return __generator(this, function (_a) {
|
|
78
78
|
switch (_a.label) {
|
|
79
79
|
case 0:
|
|
80
80
|
if (this.isTransactionActive)
|
|
81
81
|
throw new TransactionAlreadyStartedError();
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
beforeBroadcastResult = new BroadcasterResult();
|
|
83
|
+
this.broadcaster.broadcastBeforeTransactionStartEvent(beforeBroadcastResult);
|
|
84
|
+
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
85
|
+
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
85
86
|
case 1:
|
|
86
87
|
_a.sent();
|
|
87
|
-
|
|
88
|
+
_a.label = 2;
|
|
88
89
|
case 2:
|
|
90
|
+
this.isTransactionActive = true;
|
|
91
|
+
if (!isolationLevel) return [3 /*break*/, 5];
|
|
92
|
+
return [4 /*yield*/, this.query("SET TRANSACTION ISOLATION LEVEL " + isolationLevel)];
|
|
93
|
+
case 3:
|
|
89
94
|
_a.sent();
|
|
90
|
-
return [
|
|
91
|
-
case 3: return [4 /*yield*/, this.query("START TRANSACTION")];
|
|
95
|
+
return [4 /*yield*/, this.query("START TRANSACTION")];
|
|
92
96
|
case 4:
|
|
93
97
|
_a.sent();
|
|
94
|
-
|
|
95
|
-
case 5: return [
|
|
98
|
+
return [3 /*break*/, 7];
|
|
99
|
+
case 5: return [4 /*yield*/, this.query("START TRANSACTION")];
|
|
100
|
+
case 6:
|
|
101
|
+
_a.sent();
|
|
102
|
+
_a.label = 7;
|
|
103
|
+
case 7:
|
|
104
|
+
afterBroadcastResult = new BroadcasterResult();
|
|
105
|
+
this.broadcaster.broadcastAfterTransactionStartEvent(afterBroadcastResult);
|
|
106
|
+
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 9];
|
|
107
|
+
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
108
|
+
case 8:
|
|
109
|
+
_a.sent();
|
|
110
|
+
_a.label = 9;
|
|
111
|
+
case 9: return [2 /*return*/];
|
|
96
112
|
}
|
|
97
113
|
});
|
|
98
114
|
});
|
|
@@ -102,17 +118,32 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
102
118
|
* Error will be thrown if transaction was not started.
|
|
103
119
|
*/
|
|
104
120
|
MysqlQueryRunner.prototype.commitTransaction = function () {
|
|
105
|
-
return
|
|
106
|
-
|
|
121
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
+
var beforeBroadcastResult, afterBroadcastResult;
|
|
123
|
+
return __generator(this, function (_a) {
|
|
107
124
|
switch (_a.label) {
|
|
108
125
|
case 0:
|
|
109
126
|
if (!this.isTransactionActive)
|
|
110
127
|
throw new TransactionNotStartedError();
|
|
111
|
-
|
|
128
|
+
beforeBroadcastResult = new BroadcasterResult();
|
|
129
|
+
this.broadcaster.broadcastBeforeTransactionCommitEvent(beforeBroadcastResult);
|
|
130
|
+
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
131
|
+
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
112
132
|
case 1:
|
|
133
|
+
_a.sent();
|
|
134
|
+
_a.label = 2;
|
|
135
|
+
case 2: return [4 /*yield*/, this.query("COMMIT")];
|
|
136
|
+
case 3:
|
|
113
137
|
_a.sent();
|
|
114
138
|
this.isTransactionActive = false;
|
|
115
|
-
|
|
139
|
+
afterBroadcastResult = new BroadcasterResult();
|
|
140
|
+
this.broadcaster.broadcastAfterTransactionCommitEvent(afterBroadcastResult);
|
|
141
|
+
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
142
|
+
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
143
|
+
case 4:
|
|
144
|
+
_a.sent();
|
|
145
|
+
_a.label = 5;
|
|
146
|
+
case 5: return [2 /*return*/];
|
|
116
147
|
}
|
|
117
148
|
});
|
|
118
149
|
});
|
|
@@ -122,17 +153,32 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
122
153
|
* Error will be thrown if transaction was not started.
|
|
123
154
|
*/
|
|
124
155
|
MysqlQueryRunner.prototype.rollbackTransaction = function () {
|
|
125
|
-
return
|
|
126
|
-
|
|
156
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
157
|
+
var beforeBroadcastResult, afterBroadcastResult;
|
|
158
|
+
return __generator(this, function (_a) {
|
|
127
159
|
switch (_a.label) {
|
|
128
160
|
case 0:
|
|
129
161
|
if (!this.isTransactionActive)
|
|
130
162
|
throw new TransactionNotStartedError();
|
|
131
|
-
|
|
163
|
+
beforeBroadcastResult = new BroadcasterResult();
|
|
164
|
+
this.broadcaster.broadcastBeforeTransactionRollbackEvent(beforeBroadcastResult);
|
|
165
|
+
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
166
|
+
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
132
167
|
case 1:
|
|
168
|
+
_a.sent();
|
|
169
|
+
_a.label = 2;
|
|
170
|
+
case 2: return [4 /*yield*/, this.query("ROLLBACK")];
|
|
171
|
+
case 3:
|
|
133
172
|
_a.sent();
|
|
134
173
|
this.isTransactionActive = false;
|
|
135
|
-
|
|
174
|
+
afterBroadcastResult = new BroadcasterResult();
|
|
175
|
+
this.broadcaster.broadcastAfterTransactionRollbackEvent(afterBroadcastResult);
|
|
176
|
+
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
177
|
+
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
178
|
+
case 4:
|
|
179
|
+
_a.sent();
|
|
180
|
+
_a.label = 5;
|
|
181
|
+
case 5: return [2 /*return*/];
|
|
136
182
|
}
|
|
137
183
|
});
|
|
138
184
|
});
|
|
@@ -144,10 +190,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
144
190
|
var _this = this;
|
|
145
191
|
if (this.isReleased)
|
|
146
192
|
throw new QueryRunnerAlreadyReleasedError();
|
|
147
|
-
return new Promise(function (ok, fail) { return
|
|
193
|
+
return new Promise(function (ok, fail) { return __awaiter(_this, void 0, void 0, function () {
|
|
148
194
|
var databaseConnection, queryStartTime_1, err_1;
|
|
149
195
|
var _this = this;
|
|
150
|
-
return
|
|
196
|
+
return __generator(this, function (_a) {
|
|
151
197
|
switch (_a.label) {
|
|
152
198
|
case 0:
|
|
153
199
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -186,9 +232,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
186
232
|
var _this = this;
|
|
187
233
|
if (this.isReleased)
|
|
188
234
|
throw new QueryRunnerAlreadyReleasedError();
|
|
189
|
-
return new Promise(function (ok, fail) { return
|
|
235
|
+
return new Promise(function (ok, fail) { return __awaiter(_this, void 0, void 0, function () {
|
|
190
236
|
var databaseConnection, databaseQuery, err_2;
|
|
191
|
-
return
|
|
237
|
+
return __generator(this, function (_a) {
|
|
192
238
|
switch (_a.label) {
|
|
193
239
|
case 0:
|
|
194
240
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -216,8 +262,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
216
262
|
* Returns all available database names including system databases.
|
|
217
263
|
*/
|
|
218
264
|
MysqlQueryRunner.prototype.getDatabases = function () {
|
|
219
|
-
return
|
|
220
|
-
return
|
|
265
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
266
|
+
return __generator(this, function (_a) {
|
|
221
267
|
return [2 /*return*/, Promise.resolve([])];
|
|
222
268
|
});
|
|
223
269
|
});
|
|
@@ -227,8 +273,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
227
273
|
* If database parameter specified, returns schemas of that database.
|
|
228
274
|
*/
|
|
229
275
|
MysqlQueryRunner.prototype.getSchemas = function (database) {
|
|
230
|
-
return
|
|
231
|
-
return
|
|
276
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
277
|
+
return __generator(this, function (_a) {
|
|
232
278
|
throw new Error("MySql driver does not support table schemas");
|
|
233
279
|
});
|
|
234
280
|
});
|
|
@@ -237,9 +283,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
237
283
|
* Checks if database with the given name exist.
|
|
238
284
|
*/
|
|
239
285
|
MysqlQueryRunner.prototype.hasDatabase = function (database) {
|
|
240
|
-
return
|
|
286
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
241
287
|
var result;
|
|
242
|
-
return
|
|
288
|
+
return __generator(this, function (_a) {
|
|
243
289
|
switch (_a.label) {
|
|
244
290
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM `INFORMATION_SCHEMA`.`SCHEMATA` WHERE `SCHEMA_NAME` = '" + database + "'")];
|
|
245
291
|
case 1:
|
|
@@ -253,8 +299,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
253
299
|
* Checks if schema with the given name exist.
|
|
254
300
|
*/
|
|
255
301
|
MysqlQueryRunner.prototype.hasSchema = function (schema) {
|
|
256
|
-
return
|
|
257
|
-
return
|
|
302
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
303
|
+
return __generator(this, function (_a) {
|
|
258
304
|
throw new Error("MySql driver does not support table schemas");
|
|
259
305
|
});
|
|
260
306
|
});
|
|
@@ -263,9 +309,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
263
309
|
* Checks if table with the given name exist in the database.
|
|
264
310
|
*/
|
|
265
311
|
MysqlQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
266
|
-
return
|
|
312
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
267
313
|
var parsedTableName, sql, result;
|
|
268
|
-
return
|
|
314
|
+
return __generator(this, function (_a) {
|
|
269
315
|
switch (_a.label) {
|
|
270
316
|
case 0:
|
|
271
317
|
parsedTableName = this.parseTableName(tableOrName);
|
|
@@ -282,9 +328,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
282
328
|
* Checks if column with the given name exist in the given table.
|
|
283
329
|
*/
|
|
284
330
|
MysqlQueryRunner.prototype.hasColumn = function (tableOrName, column) {
|
|
285
|
-
return
|
|
331
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
286
332
|
var parsedTableName, columnName, sql, result;
|
|
287
|
-
return
|
|
333
|
+
return __generator(this, function (_a) {
|
|
288
334
|
switch (_a.label) {
|
|
289
335
|
case 0:
|
|
290
336
|
parsedTableName = this.parseTableName(tableOrName);
|
|
@@ -302,9 +348,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
302
348
|
* Creates a new database.
|
|
303
349
|
*/
|
|
304
350
|
MysqlQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
305
|
-
return
|
|
351
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
306
352
|
var up, down;
|
|
307
|
-
return
|
|
353
|
+
return __generator(this, function (_a) {
|
|
308
354
|
switch (_a.label) {
|
|
309
355
|
case 0:
|
|
310
356
|
up = ifNotExist ? "CREATE DATABASE IF NOT EXISTS `" + database + "`" : "CREATE DATABASE `" + database + "`";
|
|
@@ -321,9 +367,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
321
367
|
* Drops database.
|
|
322
368
|
*/
|
|
323
369
|
MysqlQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
324
|
-
return
|
|
370
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
325
371
|
var up, down;
|
|
326
|
-
return
|
|
372
|
+
return __generator(this, function (_a) {
|
|
327
373
|
switch (_a.label) {
|
|
328
374
|
case 0:
|
|
329
375
|
up = ifExist ? "DROP DATABASE IF EXISTS `" + database + "`" : "DROP DATABASE `" + database + "`";
|
|
@@ -340,8 +386,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
340
386
|
* Creates a new table schema.
|
|
341
387
|
*/
|
|
342
388
|
MysqlQueryRunner.prototype.createSchema = function (schema, ifNotExist) {
|
|
343
|
-
return
|
|
344
|
-
return
|
|
389
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
390
|
+
return __generator(this, function (_a) {
|
|
345
391
|
throw new Error("Schema create queries are not supported by MySql driver.");
|
|
346
392
|
});
|
|
347
393
|
});
|
|
@@ -350,8 +396,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
350
396
|
* Drops table schema.
|
|
351
397
|
*/
|
|
352
398
|
MysqlQueryRunner.prototype.dropSchema = function (schemaPath, ifExist) {
|
|
353
|
-
return
|
|
354
|
-
return
|
|
399
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
400
|
+
return __generator(this, function (_a) {
|
|
355
401
|
throw new Error("Schema drop queries are not supported by MySql driver.");
|
|
356
402
|
});
|
|
357
403
|
});
|
|
@@ -362,10 +408,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
362
408
|
MysqlQueryRunner.prototype.createTable = function (table, ifNotExist, createForeignKeys) {
|
|
363
409
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
364
410
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
365
|
-
return
|
|
411
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
366
412
|
var isTableExist, upQueries, downQueries;
|
|
367
413
|
var _this = this;
|
|
368
|
-
return
|
|
414
|
+
return __generator(this, function (_a) {
|
|
369
415
|
switch (_a.label) {
|
|
370
416
|
case 0:
|
|
371
417
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -399,10 +445,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
399
445
|
*/
|
|
400
446
|
MysqlQueryRunner.prototype.dropTable = function (target, ifExist, dropForeignKeys) {
|
|
401
447
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
402
|
-
return
|
|
448
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
403
449
|
var isTableExist, createForeignKeys, tableName, table, upQueries, downQueries;
|
|
404
450
|
var _this = this;
|
|
405
|
-
return
|
|
451
|
+
return __generator(this, function (_a) {
|
|
406
452
|
switch (_a.label) {
|
|
407
453
|
case 0:
|
|
408
454
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -437,9 +483,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
437
483
|
* Creates a new view.
|
|
438
484
|
*/
|
|
439
485
|
MysqlQueryRunner.prototype.createView = function (view) {
|
|
440
|
-
return
|
|
486
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
441
487
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
442
|
-
return
|
|
488
|
+
return __generator(this, function (_e) {
|
|
443
489
|
switch (_e.label) {
|
|
444
490
|
case 0:
|
|
445
491
|
upQueries = [];
|
|
@@ -466,9 +512,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
466
512
|
* Drops the view.
|
|
467
513
|
*/
|
|
468
514
|
MysqlQueryRunner.prototype.dropView = function (target) {
|
|
469
|
-
return
|
|
515
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
470
516
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
471
|
-
return
|
|
517
|
+
return __generator(this, function (_e) {
|
|
472
518
|
switch (_e.label) {
|
|
473
519
|
case 0:
|
|
474
520
|
viewName = target instanceof View ? target.name : target;
|
|
@@ -499,10 +545,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
499
545
|
* Renames a table.
|
|
500
546
|
*/
|
|
501
547
|
MysqlQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
502
|
-
return
|
|
548
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
503
549
|
var upQueries, downQueries, oldTable, _a, newTable, dbName;
|
|
504
550
|
var _this = this;
|
|
505
|
-
return
|
|
551
|
+
return __generator(this, function (_b) {
|
|
506
552
|
switch (_b.label) {
|
|
507
553
|
case 0:
|
|
508
554
|
upQueries = [];
|
|
@@ -580,9 +626,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
580
626
|
* Creates a new column from the column in the table.
|
|
581
627
|
*/
|
|
582
628
|
MysqlQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
583
|
-
return
|
|
629
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
584
630
|
var table, _a, clonedTable, upQueries, downQueries, skipColumnLevelPrimary, generatedColumn, nonGeneratedColumn, primaryColumns, columnNames, nonGeneratedColumn, columnIndex, uniqueIndex;
|
|
585
|
-
return
|
|
631
|
+
return __generator(this, function (_b) {
|
|
586
632
|
switch (_b.label) {
|
|
587
633
|
case 0:
|
|
588
634
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -660,14 +706,37 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
660
706
|
* Creates a new columns from the column in the table.
|
|
661
707
|
*/
|
|
662
708
|
MysqlQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
663
|
-
return
|
|
664
|
-
var
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
709
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
710
|
+
var columns_1, columns_1_1, column, e_1_1;
|
|
711
|
+
var e_1, _a;
|
|
712
|
+
return __generator(this, function (_b) {
|
|
713
|
+
switch (_b.label) {
|
|
714
|
+
case 0:
|
|
715
|
+
_b.trys.push([0, 5, 6, 7]);
|
|
716
|
+
columns_1 = __values(columns), columns_1_1 = columns_1.next();
|
|
717
|
+
_b.label = 1;
|
|
668
718
|
case 1:
|
|
669
|
-
|
|
670
|
-
|
|
719
|
+
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
720
|
+
column = columns_1_1.value;
|
|
721
|
+
return [4 /*yield*/, this.addColumn(tableOrName, column)];
|
|
722
|
+
case 2:
|
|
723
|
+
_b.sent();
|
|
724
|
+
_b.label = 3;
|
|
725
|
+
case 3:
|
|
726
|
+
columns_1_1 = columns_1.next();
|
|
727
|
+
return [3 /*break*/, 1];
|
|
728
|
+
case 4: return [3 /*break*/, 7];
|
|
729
|
+
case 5:
|
|
730
|
+
e_1_1 = _b.sent();
|
|
731
|
+
e_1 = { error: e_1_1 };
|
|
732
|
+
return [3 /*break*/, 7];
|
|
733
|
+
case 6:
|
|
734
|
+
try {
|
|
735
|
+
if (columns_1_1 && !columns_1_1.done && (_a = columns_1.return)) _a.call(columns_1);
|
|
736
|
+
}
|
|
737
|
+
finally { if (e_1) throw e_1.error; }
|
|
738
|
+
return [7 /*endfinally*/];
|
|
739
|
+
case 7: return [2 /*return*/];
|
|
671
740
|
}
|
|
672
741
|
});
|
|
673
742
|
});
|
|
@@ -676,9 +745,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
676
745
|
* Renames column in the given table.
|
|
677
746
|
*/
|
|
678
747
|
MysqlQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
679
|
-
return
|
|
748
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
680
749
|
var table, _a, oldColumn, newColumn;
|
|
681
|
-
return
|
|
750
|
+
return __generator(this, function (_b) {
|
|
682
751
|
switch (_b.label) {
|
|
683
752
|
case 0:
|
|
684
753
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -713,10 +782,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
713
782
|
* Changes a column in the table.
|
|
714
783
|
*/
|
|
715
784
|
MysqlQueryRunner.prototype.changeColumn = function (tableOrName, oldColumnOrName, newColumn) {
|
|
716
|
-
return
|
|
785
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
717
786
|
var table, _a, clonedTable, upQueries, downQueries, oldColumn, oldTableColumn, generatedColumn, nonGeneratedColumn, primaryColumns, columnNames, column, columnNames, primaryColumn, column, columnNames, nonGeneratedColumn, uniqueIndex, uniqueIndex_1, tableUnique;
|
|
718
787
|
var _this = this;
|
|
719
|
-
return
|
|
788
|
+
return __generator(this, function (_b) {
|
|
720
789
|
switch (_b.label) {
|
|
721
790
|
case 0:
|
|
722
791
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -805,7 +874,7 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
805
874
|
clonedTable.columns[clonedTable.columns.indexOf(oldTableColumn)].name = newColumn.name;
|
|
806
875
|
oldColumn.name = newColumn.name;
|
|
807
876
|
}
|
|
808
|
-
if (this.isColumnChanged(oldColumn, newColumn, true)) {
|
|
877
|
+
if (this.isColumnChanged(oldColumn, newColumn, true, true)) {
|
|
809
878
|
upQueries.push(new Query("ALTER TABLE " + this.escapePath(table) + " CHANGE `" + oldColumn.name + "` " + this.buildCreateColumnSql(newColumn, true)));
|
|
810
879
|
downQueries.push(new Query("ALTER TABLE " + this.escapePath(table) + " CHANGE `" + newColumn.name + "` " + this.buildCreateColumnSql(oldColumn, true)));
|
|
811
880
|
}
|
|
@@ -894,14 +963,37 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
894
963
|
* Changes a column in the table.
|
|
895
964
|
*/
|
|
896
965
|
MysqlQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
897
|
-
return
|
|
898
|
-
var
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
966
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
967
|
+
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_2_1;
|
|
968
|
+
var e_2, _b;
|
|
969
|
+
return __generator(this, function (_c) {
|
|
970
|
+
switch (_c.label) {
|
|
971
|
+
case 0:
|
|
972
|
+
_c.trys.push([0, 5, 6, 7]);
|
|
973
|
+
changedColumns_1 = __values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
974
|
+
_c.label = 1;
|
|
902
975
|
case 1:
|
|
903
|
-
|
|
904
|
-
|
|
976
|
+
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
977
|
+
_a = changedColumns_1_1.value, oldColumn = _a.oldColumn, newColumn = _a.newColumn;
|
|
978
|
+
return [4 /*yield*/, this.changeColumn(tableOrName, oldColumn, newColumn)];
|
|
979
|
+
case 2:
|
|
980
|
+
_c.sent();
|
|
981
|
+
_c.label = 3;
|
|
982
|
+
case 3:
|
|
983
|
+
changedColumns_1_1 = changedColumns_1.next();
|
|
984
|
+
return [3 /*break*/, 1];
|
|
985
|
+
case 4: return [3 /*break*/, 7];
|
|
986
|
+
case 5:
|
|
987
|
+
e_2_1 = _c.sent();
|
|
988
|
+
e_2 = { error: e_2_1 };
|
|
989
|
+
return [3 /*break*/, 7];
|
|
990
|
+
case 6:
|
|
991
|
+
try {
|
|
992
|
+
if (changedColumns_1_1 && !changedColumns_1_1.done && (_b = changedColumns_1.return)) _b.call(changedColumns_1);
|
|
993
|
+
}
|
|
994
|
+
finally { if (e_2) throw e_2.error; }
|
|
995
|
+
return [7 /*endfinally*/];
|
|
996
|
+
case 7: return [2 /*return*/];
|
|
905
997
|
}
|
|
906
998
|
});
|
|
907
999
|
});
|
|
@@ -910,9 +1002,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
910
1002
|
* Drops column in the table.
|
|
911
1003
|
*/
|
|
912
1004
|
MysqlQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
913
|
-
return
|
|
1005
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
914
1006
|
var table, _a, column, clonedTable, upQueries, downQueries, generatedColumn, nonGeneratedColumn, columnNames, tableColumn, columnNames_1, nonGeneratedColumn, columnIndex, uniqueName_1, foundUnique, indexName_1, foundIndex;
|
|
915
|
-
return
|
|
1007
|
+
return __generator(this, function (_b) {
|
|
916
1008
|
switch (_b.label) {
|
|
917
1009
|
case 0:
|
|
918
1010
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -994,14 +1086,37 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
994
1086
|
* Drops the columns in the table.
|
|
995
1087
|
*/
|
|
996
1088
|
MysqlQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
997
|
-
return
|
|
998
|
-
var
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1089
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1090
|
+
var columns_2, columns_2_1, column, e_3_1;
|
|
1091
|
+
var e_3, _a;
|
|
1092
|
+
return __generator(this, function (_b) {
|
|
1093
|
+
switch (_b.label) {
|
|
1094
|
+
case 0:
|
|
1095
|
+
_b.trys.push([0, 5, 6, 7]);
|
|
1096
|
+
columns_2 = __values(columns), columns_2_1 = columns_2.next();
|
|
1097
|
+
_b.label = 1;
|
|
1002
1098
|
case 1:
|
|
1003
|
-
|
|
1004
|
-
|
|
1099
|
+
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
1100
|
+
column = columns_2_1.value;
|
|
1101
|
+
return [4 /*yield*/, this.dropColumn(tableOrName, column)];
|
|
1102
|
+
case 2:
|
|
1103
|
+
_b.sent();
|
|
1104
|
+
_b.label = 3;
|
|
1105
|
+
case 3:
|
|
1106
|
+
columns_2_1 = columns_2.next();
|
|
1107
|
+
return [3 /*break*/, 1];
|
|
1108
|
+
case 4: return [3 /*break*/, 7];
|
|
1109
|
+
case 5:
|
|
1110
|
+
e_3_1 = _b.sent();
|
|
1111
|
+
e_3 = { error: e_3_1 };
|
|
1112
|
+
return [3 /*break*/, 7];
|
|
1113
|
+
case 6:
|
|
1114
|
+
try {
|
|
1115
|
+
if (columns_2_1 && !columns_2_1.done && (_a = columns_2.return)) _a.call(columns_2);
|
|
1116
|
+
}
|
|
1117
|
+
finally { if (e_3) throw e_3.error; }
|
|
1118
|
+
return [7 /*endfinally*/];
|
|
1119
|
+
case 7: return [2 /*return*/];
|
|
1005
1120
|
}
|
|
1006
1121
|
});
|
|
1007
1122
|
});
|
|
@@ -1010,9 +1125,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1010
1125
|
* Creates a new primary key.
|
|
1011
1126
|
*/
|
|
1012
1127
|
MysqlQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1013
|
-
return
|
|
1128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1014
1129
|
var table, _a, clonedTable, up, down;
|
|
1015
|
-
return
|
|
1130
|
+
return __generator(this, function (_b) {
|
|
1016
1131
|
switch (_b.label) {
|
|
1017
1132
|
case 0:
|
|
1018
1133
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1044,9 +1159,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1044
1159
|
* Updates composite primary keys.
|
|
1045
1160
|
*/
|
|
1046
1161
|
MysqlQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1047
|
-
return
|
|
1162
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1048
1163
|
var table, _a, clonedTable, columnNames, upQueries, downQueries, generatedColumn, nonGeneratedColumn, primaryColumns, columnNames_2, columnNamesString, newOrExistGeneratedColumn, nonGeneratedColumn, changedGeneratedColumn;
|
|
1049
|
-
return
|
|
1164
|
+
return __generator(this, function (_b) {
|
|
1050
1165
|
switch (_b.label) {
|
|
1051
1166
|
case 0:
|
|
1052
1167
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1107,9 +1222,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1107
1222
|
* Drops a primary key.
|
|
1108
1223
|
*/
|
|
1109
1224
|
MysqlQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1110
|
-
return
|
|
1225
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1111
1226
|
var table, _a, up, down;
|
|
1112
|
-
return
|
|
1227
|
+
return __generator(this, function (_b) {
|
|
1113
1228
|
switch (_b.label) {
|
|
1114
1229
|
case 0:
|
|
1115
1230
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1138,8 +1253,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1138
1253
|
* Creates a new unique constraint.
|
|
1139
1254
|
*/
|
|
1140
1255
|
MysqlQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1141
|
-
return
|
|
1142
|
-
return
|
|
1256
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1257
|
+
return __generator(this, function (_a) {
|
|
1143
1258
|
throw new Error("MySql does not support unique constraints. Use unique index instead.");
|
|
1144
1259
|
});
|
|
1145
1260
|
});
|
|
@@ -1148,8 +1263,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1148
1263
|
* Creates a new unique constraints.
|
|
1149
1264
|
*/
|
|
1150
1265
|
MysqlQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1151
|
-
return
|
|
1152
|
-
return
|
|
1266
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1267
|
+
return __generator(this, function (_a) {
|
|
1153
1268
|
throw new Error("MySql does not support unique constraints. Use unique index instead.");
|
|
1154
1269
|
});
|
|
1155
1270
|
});
|
|
@@ -1158,8 +1273,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1158
1273
|
* Drops an unique constraint.
|
|
1159
1274
|
*/
|
|
1160
1275
|
MysqlQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1161
|
-
return
|
|
1162
|
-
return
|
|
1276
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1277
|
+
return __generator(this, function (_a) {
|
|
1163
1278
|
throw new Error("MySql does not support unique constraints. Use unique index instead.");
|
|
1164
1279
|
});
|
|
1165
1280
|
});
|
|
@@ -1168,8 +1283,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1168
1283
|
* Drops an unique constraints.
|
|
1169
1284
|
*/
|
|
1170
1285
|
MysqlQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1171
|
-
return
|
|
1172
|
-
return
|
|
1286
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1287
|
+
return __generator(this, function (_a) {
|
|
1173
1288
|
throw new Error("MySql does not support unique constraints. Use unique index instead.");
|
|
1174
1289
|
});
|
|
1175
1290
|
});
|
|
@@ -1178,8 +1293,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1178
1293
|
* Creates a new check constraint.
|
|
1179
1294
|
*/
|
|
1180
1295
|
MysqlQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1181
|
-
return
|
|
1182
|
-
return
|
|
1296
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1297
|
+
return __generator(this, function (_a) {
|
|
1183
1298
|
throw new Error("MySql does not support check constraints.");
|
|
1184
1299
|
});
|
|
1185
1300
|
});
|
|
@@ -1188,8 +1303,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1188
1303
|
* Creates a new check constraints.
|
|
1189
1304
|
*/
|
|
1190
1305
|
MysqlQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1191
|
-
return
|
|
1192
|
-
return
|
|
1306
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1307
|
+
return __generator(this, function (_a) {
|
|
1193
1308
|
throw new Error("MySql does not support check constraints.");
|
|
1194
1309
|
});
|
|
1195
1310
|
});
|
|
@@ -1198,8 +1313,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1198
1313
|
* Drops check constraint.
|
|
1199
1314
|
*/
|
|
1200
1315
|
MysqlQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1201
|
-
return
|
|
1202
|
-
return
|
|
1316
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1317
|
+
return __generator(this, function (_a) {
|
|
1203
1318
|
throw new Error("MySql does not support check constraints.");
|
|
1204
1319
|
});
|
|
1205
1320
|
});
|
|
@@ -1208,8 +1323,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1208
1323
|
* Drops check constraints.
|
|
1209
1324
|
*/
|
|
1210
1325
|
MysqlQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1211
|
-
return
|
|
1212
|
-
return
|
|
1326
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1327
|
+
return __generator(this, function (_a) {
|
|
1213
1328
|
throw new Error("MySql does not support check constraints.");
|
|
1214
1329
|
});
|
|
1215
1330
|
});
|
|
@@ -1218,8 +1333,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1218
1333
|
* Creates a new exclusion constraint.
|
|
1219
1334
|
*/
|
|
1220
1335
|
MysqlQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1221
|
-
return
|
|
1222
|
-
return
|
|
1336
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1337
|
+
return __generator(this, function (_a) {
|
|
1223
1338
|
throw new Error("MySql does not support exclusion constraints.");
|
|
1224
1339
|
});
|
|
1225
1340
|
});
|
|
@@ -1228,8 +1343,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1228
1343
|
* Creates a new exclusion constraints.
|
|
1229
1344
|
*/
|
|
1230
1345
|
MysqlQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1231
|
-
return
|
|
1232
|
-
return
|
|
1346
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1347
|
+
return __generator(this, function (_a) {
|
|
1233
1348
|
throw new Error("MySql does not support exclusion constraints.");
|
|
1234
1349
|
});
|
|
1235
1350
|
});
|
|
@@ -1238,8 +1353,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1238
1353
|
* Drops exclusion constraint.
|
|
1239
1354
|
*/
|
|
1240
1355
|
MysqlQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1241
|
-
return
|
|
1242
|
-
return
|
|
1356
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1357
|
+
return __generator(this, function (_a) {
|
|
1243
1358
|
throw new Error("MySql does not support exclusion constraints.");
|
|
1244
1359
|
});
|
|
1245
1360
|
});
|
|
@@ -1248,8 +1363,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1248
1363
|
* Drops exclusion constraints.
|
|
1249
1364
|
*/
|
|
1250
1365
|
MysqlQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1251
|
-
return
|
|
1252
|
-
return
|
|
1366
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1367
|
+
return __generator(this, function (_a) {
|
|
1253
1368
|
throw new Error("MySql does not support exclusion constraints.");
|
|
1254
1369
|
});
|
|
1255
1370
|
});
|
|
@@ -1258,9 +1373,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1258
1373
|
* Creates a new foreign key.
|
|
1259
1374
|
*/
|
|
1260
1375
|
MysqlQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1261
|
-
return
|
|
1376
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1262
1377
|
var table, _a, up, down;
|
|
1263
|
-
return
|
|
1378
|
+
return __generator(this, function (_b) {
|
|
1264
1379
|
switch (_b.label) {
|
|
1265
1380
|
case 0:
|
|
1266
1381
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1290,10 +1405,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1290
1405
|
* Creates a new foreign keys.
|
|
1291
1406
|
*/
|
|
1292
1407
|
MysqlQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1293
|
-
return
|
|
1408
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1294
1409
|
var promises;
|
|
1295
1410
|
var _this = this;
|
|
1296
|
-
return
|
|
1411
|
+
return __generator(this, function (_a) {
|
|
1297
1412
|
switch (_a.label) {
|
|
1298
1413
|
case 0:
|
|
1299
1414
|
promises = foreignKeys.map(function (foreignKey) { return _this.createForeignKey(tableOrName, foreignKey); });
|
|
@@ -1309,9 +1424,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1309
1424
|
* Drops a foreign key.
|
|
1310
1425
|
*/
|
|
1311
1426
|
MysqlQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1312
|
-
return
|
|
1427
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1313
1428
|
var table, _a, foreignKey, up, down;
|
|
1314
|
-
return
|
|
1429
|
+
return __generator(this, function (_b) {
|
|
1315
1430
|
switch (_b.label) {
|
|
1316
1431
|
case 0:
|
|
1317
1432
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1341,10 +1456,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1341
1456
|
* Drops a foreign keys from the table.
|
|
1342
1457
|
*/
|
|
1343
1458
|
MysqlQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1344
|
-
return
|
|
1459
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1345
1460
|
var promises;
|
|
1346
1461
|
var _this = this;
|
|
1347
|
-
return
|
|
1462
|
+
return __generator(this, function (_a) {
|
|
1348
1463
|
switch (_a.label) {
|
|
1349
1464
|
case 0:
|
|
1350
1465
|
promises = foreignKeys.map(function (foreignKey) { return _this.dropForeignKey(tableOrName, foreignKey); });
|
|
@@ -1360,9 +1475,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1360
1475
|
* Creates a new index.
|
|
1361
1476
|
*/
|
|
1362
1477
|
MysqlQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
1363
|
-
return
|
|
1478
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1364
1479
|
var table, _a, up, down;
|
|
1365
|
-
return
|
|
1480
|
+
return __generator(this, function (_b) {
|
|
1366
1481
|
switch (_b.label) {
|
|
1367
1482
|
case 0:
|
|
1368
1483
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1392,10 +1507,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1392
1507
|
* Creates a new indices
|
|
1393
1508
|
*/
|
|
1394
1509
|
MysqlQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
1395
|
-
return
|
|
1510
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1396
1511
|
var promises;
|
|
1397
1512
|
var _this = this;
|
|
1398
|
-
return
|
|
1513
|
+
return __generator(this, function (_a) {
|
|
1399
1514
|
switch (_a.label) {
|
|
1400
1515
|
case 0:
|
|
1401
1516
|
promises = indices.map(function (index) { return _this.createIndex(tableOrName, index); });
|
|
@@ -1411,9 +1526,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1411
1526
|
* Drops an index.
|
|
1412
1527
|
*/
|
|
1413
1528
|
MysqlQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
1414
|
-
return
|
|
1529
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1415
1530
|
var table, _a, index, up, down;
|
|
1416
|
-
return
|
|
1531
|
+
return __generator(this, function (_b) {
|
|
1417
1532
|
switch (_b.label) {
|
|
1418
1533
|
case 0:
|
|
1419
1534
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1443,10 +1558,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1443
1558
|
* Drops an indices from the table.
|
|
1444
1559
|
*/
|
|
1445
1560
|
MysqlQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
1446
|
-
return
|
|
1561
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1447
1562
|
var promises;
|
|
1448
1563
|
var _this = this;
|
|
1449
|
-
return
|
|
1564
|
+
return __generator(this, function (_a) {
|
|
1450
1565
|
switch (_a.label) {
|
|
1451
1566
|
case 0:
|
|
1452
1567
|
promises = indices.map(function (index) { return _this.dropIndex(tableOrName, index); });
|
|
@@ -1463,8 +1578,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1463
1578
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
1464
1579
|
*/
|
|
1465
1580
|
MysqlQueryRunner.prototype.clearTable = function (tableOrName) {
|
|
1466
|
-
return
|
|
1467
|
-
return
|
|
1581
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1582
|
+
return __generator(this, function (_a) {
|
|
1468
1583
|
switch (_a.label) {
|
|
1469
1584
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tableOrName))];
|
|
1470
1585
|
case 1:
|
|
@@ -1480,10 +1595,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1480
1595
|
* (because it can clear all your database).
|
|
1481
1596
|
*/
|
|
1482
1597
|
MysqlQueryRunner.prototype.clearDatabase = function (database) {
|
|
1483
|
-
return
|
|
1598
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1484
1599
|
var dbName, isDatabaseExist, selectViewDropsQuery, dropViewQueries, disableForeignKeysCheckQuery, dropTablesQuery, enableForeignKeysCheckQuery, dropQueries, error_1, rollbackError_1;
|
|
1485
1600
|
var _this = this;
|
|
1486
|
-
return
|
|
1601
|
+
return __generator(this, function (_a) {
|
|
1487
1602
|
switch (_a.label) {
|
|
1488
1603
|
case 0:
|
|
1489
1604
|
dbName = database ? database : this.driver.database;
|
|
@@ -1552,9 +1667,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1552
1667
|
* Returns current database.
|
|
1553
1668
|
*/
|
|
1554
1669
|
MysqlQueryRunner.prototype.getCurrentDatabase = function () {
|
|
1555
|
-
return
|
|
1670
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1556
1671
|
var currentDBQuery;
|
|
1557
|
-
return
|
|
1672
|
+
return __generator(this, function (_a) {
|
|
1558
1673
|
switch (_a.label) {
|
|
1559
1674
|
case 0: return [4 /*yield*/, this.query("SELECT DATABASE() AS `db_name`")];
|
|
1560
1675
|
case 1:
|
|
@@ -1565,10 +1680,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1565
1680
|
});
|
|
1566
1681
|
};
|
|
1567
1682
|
MysqlQueryRunner.prototype.loadViews = function (viewNames) {
|
|
1568
|
-
return
|
|
1683
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1569
1684
|
var hasTable, currentDatabase, viewsCondition, query, dbViews;
|
|
1570
1685
|
var _this = this;
|
|
1571
|
-
return
|
|
1686
|
+
return __generator(this, function (_a) {
|
|
1572
1687
|
switch (_a.label) {
|
|
1573
1688
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
1574
1689
|
case 1:
|
|
@@ -1579,7 +1694,7 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1579
1694
|
case 2:
|
|
1580
1695
|
currentDatabase = _a.sent();
|
|
1581
1696
|
viewsCondition = viewNames.map(function (tableName) {
|
|
1582
|
-
var _a =
|
|
1697
|
+
var _a = __read(tableName.split("."), 2), database = _a[0], name = _a[1];
|
|
1583
1698
|
if (!name) {
|
|
1584
1699
|
name = database;
|
|
1585
1700
|
database = _this.driver.database || currentDatabase;
|
|
@@ -1606,10 +1721,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1606
1721
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
1607
1722
|
*/
|
|
1608
1723
|
MysqlQueryRunner.prototype.loadTables = function (tableNames) {
|
|
1609
|
-
return
|
|
1610
|
-
var currentDatabase,
|
|
1724
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1725
|
+
var currentDatabase, statsSubquerySql, kcuSubquerySql, rcSubquerySql, tablesSql, columnsSql, collationsSql, primaryKeySql, indicesSql, foreignKeysSql, _a, dbTables, dbColumns, dbPrimaryKeys, dbCollations, dbIndices, dbForeignKeys, isMariaDb, dbVersion;
|
|
1611
1726
|
var _this = this;
|
|
1612
|
-
return
|
|
1727
|
+
return __generator(this, function (_b) {
|
|
1613
1728
|
switch (_b.label) {
|
|
1614
1729
|
case 0:
|
|
1615
1730
|
// if no tables given then no need to proceed
|
|
@@ -1618,42 +1733,50 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1618
1733
|
return [4 /*yield*/, this.getCurrentDatabase()];
|
|
1619
1734
|
case 1:
|
|
1620
1735
|
currentDatabase = _b.sent();
|
|
1621
|
-
|
|
1622
|
-
var _a =
|
|
1736
|
+
statsSubquerySql = tableNames.map(function (tableName) {
|
|
1737
|
+
var _a = __read(tableName.split("."), 2), database = _a[0], name = _a[1];
|
|
1623
1738
|
if (!name) {
|
|
1624
1739
|
name = database;
|
|
1625
1740
|
database = _this.driver.database || currentDatabase;
|
|
1626
1741
|
}
|
|
1627
|
-
return "
|
|
1628
|
-
}).join("
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
primaryKeySql = "SELECT * FROM `INFORMATION_SCHEMA`.`KEY_COLUMN_USAGE` WHERE `CONSTRAINT_NAME` = 'PRIMARY' AND (" + tablesCondition + ")";
|
|
1632
|
-
collationsSql = "SELECT `SCHEMA_NAME`, `DEFAULT_CHARACTER_SET_NAME` as `CHARSET`, `DEFAULT_COLLATION_NAME` AS `COLLATION` FROM `INFORMATION_SCHEMA`.`SCHEMATA`";
|
|
1633
|
-
indicesCondition = tableNames.map(function (tableName) {
|
|
1634
|
-
var _a = tslib_1.__read(tableName.split("."), 2), database = _a[0], name = _a[1];
|
|
1742
|
+
return "\n SELECT\n *\n FROM `INFORMATION_SCHEMA`.`STATISTICS`\n WHERE\n `TABLE_SCHEMA` = '" + database + "'\n AND\n `TABLE_NAME` = '" + name + "'\n ";
|
|
1743
|
+
}).join(" UNION ");
|
|
1744
|
+
kcuSubquerySql = tableNames.map(function (tableName) {
|
|
1745
|
+
var _a = __read(tableName.split("."), 2), database = _a[0], name = _a[1];
|
|
1635
1746
|
if (!name) {
|
|
1636
1747
|
name = database;
|
|
1637
1748
|
database = _this.driver.database || currentDatabase;
|
|
1638
1749
|
}
|
|
1639
|
-
return "
|
|
1640
|
-
}).join("
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
("WHERE (" + indicesCondition + ") AND `s`.`INDEX_NAME` != 'PRIMARY' AND `rc`.`CONSTRAINT_NAME` IS NULL");
|
|
1644
|
-
foreignKeysCondition = tableNames.map(function (tableName) {
|
|
1645
|
-
var _a = tslib_1.__read(tableName.split("."), 2), database = _a[0], name = _a[1];
|
|
1750
|
+
return "\n SELECT\n *\n FROM `INFORMATION_SCHEMA`.`KEY_COLUMN_USAGE` `kcu`\n WHERE\n `kcu`.`TABLE_SCHEMA` = '" + database + "'\n AND\n `kcu`.`TABLE_NAME` = '" + name + "'\n ";
|
|
1751
|
+
}).join(" UNION ");
|
|
1752
|
+
rcSubquerySql = tableNames.map(function (tableName) {
|
|
1753
|
+
var _a = __read(tableName.split("."), 2), database = _a[0], name = _a[1];
|
|
1646
1754
|
if (!name) {
|
|
1647
1755
|
name = database;
|
|
1648
1756
|
database = _this.driver.database || currentDatabase;
|
|
1649
1757
|
}
|
|
1650
|
-
return "
|
|
1651
|
-
}).join("
|
|
1652
|
-
|
|
1653
|
-
"
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1758
|
+
return "\n SELECT\n *\n FROM `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS`\n WHERE\n `CONSTRAINT_SCHEMA` = '" + database + "'\n AND\n `TABLE_NAME` = '" + name + "'\n ";
|
|
1759
|
+
}).join(" UNION ");
|
|
1760
|
+
tablesSql = tableNames.map(function (tableName) {
|
|
1761
|
+
var _a = __read(tableName.split("."), 2), database = _a[0], name = _a[1];
|
|
1762
|
+
if (!name) {
|
|
1763
|
+
name = database;
|
|
1764
|
+
database = _this.driver.database || currentDatabase;
|
|
1765
|
+
}
|
|
1766
|
+
return "\n SELECT\n `TABLE_SCHEMA`,\n `TABLE_NAME`\n FROM\n `INFORMATION_SCHEMA`.`TABLES`\n WHERE\n `TABLE_SCHEMA` = '" + database + "'\n AND\n `TABLE_NAME` = '" + name + "'\n ";
|
|
1767
|
+
}).join(" UNION ");
|
|
1768
|
+
columnsSql = tableNames.map(function (tableName) {
|
|
1769
|
+
var _a = __read(tableName.split("."), 2), database = _a[0], name = _a[1];
|
|
1770
|
+
if (!name) {
|
|
1771
|
+
name = database;
|
|
1772
|
+
database = _this.driver.database || currentDatabase;
|
|
1773
|
+
}
|
|
1774
|
+
return "\n SELECT\n *\n FROM\n `INFORMATION_SCHEMA`.`COLUMNS`\n WHERE\n `TABLE_SCHEMA` = '" + database + "'\n AND\n `TABLE_NAME` = '" + name + "'\n ";
|
|
1775
|
+
}).join(" UNION ");
|
|
1776
|
+
collationsSql = "\n SELECT\n `SCHEMA_NAME`,\n `DEFAULT_CHARACTER_SET_NAME` as `CHARSET`,\n `DEFAULT_COLLATION_NAME` AS `COLLATION`\n FROM `INFORMATION_SCHEMA`.`SCHEMATA`\n ";
|
|
1777
|
+
primaryKeySql = "SELECT * FROM (" + kcuSubquerySql + ") `kcu` WHERE `CONSTRAINT_NAME` = 'PRIMARY'";
|
|
1778
|
+
indicesSql = "\n SELECT\n `s`.*\n FROM (" + statsSubquerySql + ") `s`\n LEFT JOIN (" + rcSubquerySql + ") `rc`\n ON\n `s`.`INDEX_NAME` = `rc`.`CONSTRAINT_NAME`\n AND\n `s`.`TABLE_SCHEMA` = `rc`.`CONSTRAINT_SCHEMA`\n WHERE\n `s`.`INDEX_NAME` != 'PRIMARY'\n AND\n `rc`.`CONSTRAINT_NAME` IS NULL\n ";
|
|
1779
|
+
foreignKeysSql = "\n SELECT\n `kcu`.`TABLE_SCHEMA`,\n `kcu`.`TABLE_NAME`,\n `kcu`.`CONSTRAINT_NAME`,\n `kcu`.`COLUMN_NAME`,\n `kcu`.`REFERENCED_TABLE_SCHEMA`,\n `kcu`.`REFERENCED_TABLE_NAME`,\n `kcu`.`REFERENCED_COLUMN_NAME`,\n `rc`.`DELETE_RULE` `ON_DELETE`,\n `rc`.`UPDATE_RULE` `ON_UPDATE`\n FROM (" + kcuSubquerySql + ") `kcu`\n INNER JOIN (" + rcSubquerySql + ") `rc`\n ON\n `rc`.`CONSTRAINT_SCHEMA` = `kcu`.`CONSTRAINT_SCHEMA`\n AND\n `rc`.`TABLE_NAME` = `kcu`.`TABLE_NAME`\n AND\n `rc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME`\n ";
|
|
1657
1780
|
return [4 /*yield*/, Promise.all([
|
|
1658
1781
|
this.query(tablesSql),
|
|
1659
1782
|
this.query(columnsSql),
|
|
@@ -1663,7 +1786,7 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1663
1786
|
this.query(foreignKeysSql)
|
|
1664
1787
|
])];
|
|
1665
1788
|
case 2:
|
|
1666
|
-
_a =
|
|
1789
|
+
_a = __read.apply(void 0, [_b.sent(), 6]), dbTables = _a[0], dbColumns = _a[1], dbPrimaryKeys = _a[2], dbCollations = _a[3], dbIndices = _a[4], dbForeignKeys = _a[5];
|
|
1667
1790
|
// if tables were not found in the db, no need to proceed
|
|
1668
1791
|
if (!dbTables.length)
|
|
1669
1792
|
return [2 /*return*/, []];
|
|
@@ -1672,10 +1795,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1672
1795
|
case 3:
|
|
1673
1796
|
dbVersion = _b.sent();
|
|
1674
1797
|
// create tables for loaded tables
|
|
1675
|
-
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return
|
|
1798
|
+
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return __awaiter(_this, void 0, void 0, function () {
|
|
1676
1799
|
var table, dbCollation, defaultCollation, defaultCharset, db, tableFullName, tableForeignKeyConstraints, tableIndexConstraints;
|
|
1677
1800
|
var _this = this;
|
|
1678
|
-
return
|
|
1801
|
+
return __generator(this, function (_a) {
|
|
1679
1802
|
table = new Table();
|
|
1680
1803
|
dbCollation = dbCollations.find(function (coll) { return coll["SCHEMA_NAME"] === dbTable["TABLE_SCHEMA"]; });
|
|
1681
1804
|
defaultCollation = dbCollation["COLLATION"];
|
|
@@ -1708,6 +1831,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1708
1831
|
var tableColumn = new TableColumn();
|
|
1709
1832
|
tableColumn.name = dbColumn["COLUMN_NAME"];
|
|
1710
1833
|
tableColumn.type = dbColumn["DATA_TYPE"].toLowerCase();
|
|
1834
|
+
tableColumn.zerofill = dbColumn["COLUMN_TYPE"].indexOf("zerofill") !== -1;
|
|
1835
|
+
tableColumn.unsigned = tableColumn.zerofill ? true : dbColumn["COLUMN_TYPE"].indexOf("unsigned") !== -1;
|
|
1711
1836
|
if (_this.driver.withWidthColumnTypes.indexOf(tableColumn.type) !== -1) {
|
|
1712
1837
|
var width = dbColumn["COLUMN_TYPE"].substring(dbColumn["COLUMN_TYPE"].indexOf("(") + 1, dbColumn["COLUMN_TYPE"].indexOf(")"));
|
|
1713
1838
|
tableColumn.width = width && !_this.isDefaultColumnWidth(table, tableColumn, parseInt(width)) ? parseInt(width) : undefined;
|
|
@@ -1731,7 +1856,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1731
1856
|
tableColumn.default = "'" + dbColumn["COLUMN_DEFAULT"] + "'";
|
|
1732
1857
|
}
|
|
1733
1858
|
if (dbColumn["EXTRA"].indexOf("on update") !== -1) {
|
|
1734
|
-
|
|
1859
|
+
// New versions of MariaDB return expressions in lowercase. We need to set it in
|
|
1860
|
+
// uppercase so the comparison in MysqlDriver#compareExtraValues does not fail.
|
|
1861
|
+
tableColumn.onUpdate = dbColumn["EXTRA"].substring(dbColumn["EXTRA"].indexOf("on update") + 10).toUpperCase();
|
|
1735
1862
|
}
|
|
1736
1863
|
if (dbColumn["GENERATION_EXPRESSION"]) {
|
|
1737
1864
|
tableColumn.asExpression = dbColumn["GENERATION_EXPRESSION"];
|
|
@@ -1742,12 +1869,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1742
1869
|
tableColumn.isPrimary = dbPrimaryKeys.some(function (dbPrimaryKey) {
|
|
1743
1870
|
return _this.driver.buildTableName(dbPrimaryKey["TABLE_NAME"], undefined, dbPrimaryKey["TABLE_SCHEMA"]) === tableFullName && dbPrimaryKey["COLUMN_NAME"] === tableColumn.name;
|
|
1744
1871
|
});
|
|
1745
|
-
tableColumn.zerofill = dbColumn["COLUMN_TYPE"].indexOf("zerofill") !== -1;
|
|
1746
|
-
tableColumn.unsigned = tableColumn.zerofill ? true : dbColumn["COLUMN_TYPE"].indexOf("unsigned") !== -1;
|
|
1747
1872
|
tableColumn.isGenerated = dbColumn["EXTRA"].indexOf("auto_increment") !== -1;
|
|
1748
1873
|
if (tableColumn.isGenerated)
|
|
1749
1874
|
tableColumn.generationStrategy = "increment";
|
|
1750
|
-
tableColumn.comment = dbColumn["COLUMN_COMMENT"];
|
|
1875
|
+
tableColumn.comment = (typeof dbColumn["COLUMN_COMMENT"] === "string" && dbColumn["COLUMN_COMMENT"].length === 0) ? undefined : dbColumn["COLUMN_COMMENT"];
|
|
1751
1876
|
if (dbColumn["CHARACTER_SET_NAME"])
|
|
1752
1877
|
tableColumn.charset = dbColumn["CHARACTER_SET_NAME"] === defaultCharset ? undefined : dbColumn["CHARACTER_SET_NAME"];
|
|
1753
1878
|
if (dbColumn["COLLATION_NAME"])
|
|
@@ -1913,15 +2038,15 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1913
2038
|
}
|
|
1914
2039
|
};
|
|
1915
2040
|
MysqlQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
1916
|
-
return
|
|
2041
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1917
2042
|
var currentDatabase, expression, _a, query, parameters;
|
|
1918
|
-
return
|
|
2043
|
+
return __generator(this, function (_b) {
|
|
1919
2044
|
switch (_b.label) {
|
|
1920
2045
|
case 0: return [4 /*yield*/, this.getCurrentDatabase()];
|
|
1921
2046
|
case 1:
|
|
1922
2047
|
currentDatabase = _b.sent();
|
|
1923
2048
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
1924
|
-
_a =
|
|
2049
|
+
_a = __read(this.connection.createQueryBuilder()
|
|
1925
2050
|
.insert()
|
|
1926
2051
|
.into(this.getTypeormMetadataTableName())
|
|
1927
2052
|
.values({ type: "VIEW", schema: currentDatabase, name: view.name, value: expression })
|
|
@@ -1941,16 +2066,16 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1941
2066
|
* Builds remove view sql.
|
|
1942
2067
|
*/
|
|
1943
2068
|
MysqlQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
|
|
1944
|
-
return
|
|
2069
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1945
2070
|
var currentDatabase, viewName, qb, _a, query, parameters;
|
|
1946
|
-
return
|
|
2071
|
+
return __generator(this, function (_b) {
|
|
1947
2072
|
switch (_b.label) {
|
|
1948
2073
|
case 0: return [4 /*yield*/, this.getCurrentDatabase()];
|
|
1949
2074
|
case 1:
|
|
1950
2075
|
currentDatabase = _b.sent();
|
|
1951
2076
|
viewName = viewOrPath instanceof View ? viewOrPath.name : viewOrPath;
|
|
1952
2077
|
qb = this.connection.createQueryBuilder();
|
|
1953
|
-
_a =
|
|
2078
|
+
_a = __read(qb.delete()
|
|
1954
2079
|
.from(this.getTypeormMetadataTableName())
|
|
1955
2080
|
.where(qb.escape("type") + " = 'VIEW'")
|
|
1956
2081
|
.andWhere(qb.escape("schema") + " = :schema", { schema: currentDatabase })
|
|
@@ -2024,6 +2149,19 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
2024
2149
|
tableName: tableName.indexOf(".") !== -1 ? tableName.split(".")[1] : tableName
|
|
2025
2150
|
};
|
|
2026
2151
|
};
|
|
2152
|
+
/**
|
|
2153
|
+
* Escapes a given comment so it's safe to include in a query.
|
|
2154
|
+
*/
|
|
2155
|
+
MysqlQueryRunner.prototype.escapeComment = function (comment) {
|
|
2156
|
+
if (comment === undefined || comment.length === 0) {
|
|
2157
|
+
return "''";
|
|
2158
|
+
}
|
|
2159
|
+
comment = comment
|
|
2160
|
+
.replace("\\", "\\\\") // MySQL allows escaping characters via backslashes
|
|
2161
|
+
.replace("'", "''")
|
|
2162
|
+
.replace("\0", ""); // Null bytes aren't allowed in comments
|
|
2163
|
+
return "'" + comment + "'";
|
|
2164
|
+
};
|
|
2027
2165
|
/**
|
|
2028
2166
|
* Escapes given table or view path.
|
|
2029
2167
|
*/
|
|
@@ -2066,8 +2204,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
2066
2204
|
c += " PRIMARY KEY";
|
|
2067
2205
|
if (column.isGenerated && column.generationStrategy === "increment") // don't use skipPrimary here since updates can update already exist primary without auto inc.
|
|
2068
2206
|
c += " AUTO_INCREMENT";
|
|
2069
|
-
if (column.comment)
|
|
2070
|
-
c += " COMMENT
|
|
2207
|
+
if (column.comment !== undefined && column.comment.length > 0)
|
|
2208
|
+
c += " COMMENT " + this.escapeComment(column.comment);
|
|
2071
2209
|
if (column.default !== undefined && column.default !== null)
|
|
2072
2210
|
c += " DEFAULT " + column.default;
|
|
2073
2211
|
if (column.onUpdate)
|
|
@@ -2075,9 +2213,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
2075
2213
|
return c;
|
|
2076
2214
|
};
|
|
2077
2215
|
MysqlQueryRunner.prototype.getVersion = function () {
|
|
2078
|
-
return
|
|
2216
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2079
2217
|
var result;
|
|
2080
|
-
return
|
|
2218
|
+
return __generator(this, function (_a) {
|
|
2081
2219
|
switch (_a.label) {
|
|
2082
2220
|
case 0: return [4 /*yield*/, this.query("SELECT VERSION() AS `version`")];
|
|
2083
2221
|
case 1:
|
|
@@ -2087,6 +2225,34 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
2087
2225
|
});
|
|
2088
2226
|
});
|
|
2089
2227
|
};
|
|
2228
|
+
/**
|
|
2229
|
+
* Checks if column display width is by default.
|
|
2230
|
+
*/
|
|
2231
|
+
MysqlQueryRunner.prototype.isDefaultColumnWidth = function (table, column, width) {
|
|
2232
|
+
// if table have metadata, we check if length is specified in column metadata
|
|
2233
|
+
if (this.connection.hasMetadata(table.name)) {
|
|
2234
|
+
var metadata = this.connection.getMetadata(table.name);
|
|
2235
|
+
var columnMetadata = metadata.findColumnWithDatabaseName(column.name);
|
|
2236
|
+
if (columnMetadata && columnMetadata.width)
|
|
2237
|
+
return false;
|
|
2238
|
+
}
|
|
2239
|
+
var defaultWidthForType = this.connection.driver.dataTypeDefaults
|
|
2240
|
+
&& this.connection.driver.dataTypeDefaults[column.type]
|
|
2241
|
+
&& this.connection.driver.dataTypeDefaults[column.type].width;
|
|
2242
|
+
if (defaultWidthForType) {
|
|
2243
|
+
// In MariaDB & MySQL 5.7, the default widths of certain numeric types are 1 less than
|
|
2244
|
+
// the usual defaults when the column is unsigned.
|
|
2245
|
+
var typesWithReducedUnsignedDefault = ["int", "tinyint", "smallint", "mediumint"];
|
|
2246
|
+
var needsAdjustment = typesWithReducedUnsignedDefault.indexOf(column.type) !== -1;
|
|
2247
|
+
if (column.unsigned && needsAdjustment) {
|
|
2248
|
+
return (defaultWidthForType - 1) === width;
|
|
2249
|
+
}
|
|
2250
|
+
else {
|
|
2251
|
+
return defaultWidthForType === width;
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
return false;
|
|
2255
|
+
};
|
|
2090
2256
|
return MysqlQueryRunner;
|
|
2091
2257
|
}(BaseQueryRunner));
|
|
2092
2258
|
export { MysqlQueryRunner };
|