typeorm 0.2.24 → 0.2.28
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 +12 -8
- package/browser/cache/DbQueryResultCache.js +14 -14
- package/browser/cache/DbQueryResultCache.js.map +1 -1
- package/browser/cache/RedisQueryResultCache.js +20 -15
- 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 +66 -42
- 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 +3 -1
- package/browser/connection/ConnectionOptions.js.map +1 -1
- package/browser/connection/ConnectionOptionsReader.js +47 -42
- 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 +2 -1
- package/browser/decorator/columns/ViewColumn.js +2 -2
- package/browser/decorator/columns/ViewColumn.js.map +1 -1
- package/browser/decorator/entity/ChildEntity.d.ts +1 -1
- package/browser/decorator/entity/ChildEntity.js.map +1 -1
- package/browser/decorator/entity/Entity.d.ts +2 -2
- package/browser/decorator/entity/Entity.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/options/ViewColumnOptions.d.ts +9 -0
- package/browser/decorator/options/ViewColumnOptions.js +3 -0
- package/browser/decorator/options/ViewColumnOptions.js.map +1 -0
- 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 +6 -0
- package/browser/driver/DriverFactory.js.map +1 -1
- package/browser/driver/DriverUtils.d.ts +2 -2
- package/browser/driver/DriverUtils.js +8 -4
- 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 +6 -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 +230 -143
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +27 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js +3 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -0
- 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 +51 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +142 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -0
- 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 +18 -13
- package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.d.ts +3 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +420 -192
- 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 +5 -5
- package/browser/driver/expo/ExpoDriver.js.map +1 -1
- package/browser/driver/expo/ExpoQueryRunner.js +10 -10
- package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/MongoDriver.d.ts +6 -1
- package/browser/driver/mongodb/MongoDriver.js +9 -4
- package/browser/driver/mongodb/MongoDriver.js.map +1 -1
- package/browser/driver/mongodb/MongoQueryRunner.d.ts +1 -0
- package/browser/driver/mongodb/MongoQueryRunner.js +175 -175
- package/browser/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/typings.d.ts +4 -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 +16 -9
- package/browser/driver/mysql/MysqlDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.d.ts +7 -1
- package/browser/driver/mysql/MysqlQueryRunner.js +246 -149
- 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 +195 -128
- package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/postgres/PostgresConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.d.ts +9 -0
- package/browser/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresDriver.d.ts +19 -4
- package/browser/driver/postgres/PostgresDriver.js +194 -124
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.d.ts +3 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +416 -196
- 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 +6 -6
- 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/SapConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/sap/SapConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/sap/SapDriver.d.ts +6 -1
- package/browser/driver/sap/SapDriver.js +25 -15
- package/browser/driver/sap/SapDriver.js.map +1 -1
- package/browser/driver/sap/SapQueryRunner.d.ts +3 -1
- package/browser/driver/sap/SapQueryRunner.js +224 -156
- 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 +30 -18
- package/browser/driver/sqlite/SqliteDriver.js.map +1 -1
- package/browser/driver/sqlite/SqliteQueryRunner.js +33 -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 +134 -120
- 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 +15 -16
- package/browser/driver/sqljs/SqljsDriver.js.map +1 -1
- package/browser/driver/sqljs/SqljsQueryRunner.js +11 -7
- 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 +237 -170
- 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 +42 -257
- package/browser/entity-manager/EntityManager.js +39 -39
- package/browser/entity-manager/EntityManager.js.map +1 -1
- package/browser/entity-manager/MongoEntityManager.d.ts +46 -46
- package/browser/entity-manager/MongoEntityManager.js +17 -17
- 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 +2 -2
- package/browser/find-options/FindOneOptions.js.map +1 -1
- package/browser/find-options/FindOperator.d.ts +6 -3
- package/browser/find-options/FindOperator.js +22 -45
- package/browser/find-options/FindOperator.js.map +1 -1
- package/browser/find-options/FindOptionsUtils.d.ts +2 -2
- package/browser/find-options/FindOptionsUtils.js +1 -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/In.d.ts +1 -1
- package/browser/find-options/operator/In.js.map +1 -1
- package/browser/find-options/operator/Raw.d.ts +1 -1
- package/browser/find-options/operator/Raw.js.map +1 -1
- package/browser/index.d.ts +8 -11
- package/browser/index.js +8 -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/LoggerOptions.d.ts +9 -0
- package/browser/logger/LoggerOptions.js.map +1 -1
- package/browser/metadata/ColumnMetadata.js +15 -16
- 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 -5
- package/browser/metadata/EntityMetadata.js +15 -16
- package/browser/metadata/EntityMetadata.js.map +1 -1
- package/browser/metadata/RelationMetadata.js +12 -12
- package/browser/metadata/RelationMetadata.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 +14 -12
- package/browser/metadata-builder/EntityMetadataBuilder.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.d.ts +5 -0
- package/browser/naming-strategy/DefaultNamingStrategy.js +8 -6
- package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/browser/naming-strategy/NamingStrategyInterface.d.ts +11 -0
- package/browser/naming-strategy/NamingStrategyInterface.js.map +1 -1
- package/browser/persistence/EntityPersistExecutor.js +64 -46
- package/browser/persistence/EntityPersistExecutor.js.map +1 -1
- package/browser/persistence/Subject.js +2 -2
- package/browser/persistence/Subject.js.map +1 -1
- package/browser/persistence/SubjectChangedColumnsComputer.js +11 -7
- package/browser/persistence/SubjectChangedColumnsComputer.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/subject-builder/ManyToManySubjectBuilder.js +2 -3
- package/browser/persistence/subject-builder/ManyToManySubjectBuilder.js.map +1 -1
- package/browser/persistence/subject-builder/OneToManySubjectBuilder.js +1 -1
- package/browser/persistence/subject-builder/OneToManySubjectBuilder.js.map +1 -1
- package/browser/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js +1 -1
- package/browser/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.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 +10 -5
- package/browser/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/InsertQueryBuilder.d.ts +2 -3
- package/browser/query-builder/InsertQueryBuilder.js +23 -9
- 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 +11 -15
- package/browser/query-builder/QueryBuilder.js +92 -31
- 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 +1 -1
- 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 +5 -4
- package/browser/query-builder/SelectQueryBuilder.js +77 -41
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-builder/SoftDeleteQueryBuilder.d.ts +2 -3
- package/browser/query-builder/SoftDeleteQueryBuilder.js +7 -7
- package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/UpdateQueryBuilder.js +22 -8
- 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 +4 -7
- 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 +1 -0
- package/browser/repository/AbstractRepository.js.map +1 -1
- package/browser/repository/BaseEntity.d.ts +17 -1
- package/browser/repository/BaseEntity.js +24 -6
- 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.d.ts +1 -1
- package/browser/repository/Repository.js +4 -4
- package/browser/repository/Repository.js.map +1 -1
- package/browser/repository/TreeRepository.js +4 -4
- 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/util/ApplyValueTransformers.js.map +1 -1
- package/browser/util/DateUtils.js +3 -3
- 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.d.ts +4 -0
- package/browser/util/OrmUtils.js +19 -4
- package/browser/util/OrmUtils.js.map +1 -1
- package/browser/util/StringUtils.js +1 -1
- package/browser/util/StringUtils.js.map +1 -1
- package/cache/DbQueryResultCache.js +1 -1
- package/cache/DbQueryResultCache.js.map +1 -1
- package/cache/RedisQueryResultCache.js +7 -2
- package/cache/RedisQueryResultCache.js.map +1 -1
- package/cli.js +2 -1
- package/cli.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 +4 -4
- package/commands/CommandUtils.js.map +1 -1
- package/commands/EntityCreateCommand.js +4 -4
- package/commands/EntityCreateCommand.js.map +1 -1
- package/commands/InitCommand.js +15 -5
- package/commands/InitCommand.js.map +1 -1
- package/commands/MigrationCreateCommand.js +6 -6
- package/commands/MigrationCreateCommand.js.map +1 -1
- package/commands/MigrationGenerateCommand.d.ts +11 -1
- package/commands/MigrationGenerateCommand.js +42 -10
- package/commands/MigrationGenerateCommand.js.map +1 -1
- package/commands/MigrationRevertCommand.js +2 -2
- package/commands/MigrationRevertCommand.js.map +1 -1
- package/commands/MigrationRunCommand.js +3 -3
- package/commands/MigrationRunCommand.js.map +1 -1
- package/commands/MigrationShowCommand.js +3 -3
- package/commands/MigrationShowCommand.js.map +1 -1
- package/commands/QueryCommand.js +5 -5
- 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 +3 -3
- 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 +48 -24
- package/connection/Connection.js.map +1 -1
- package/connection/ConnectionOptions.d.ts +3 -1
- package/connection/ConnectionOptions.js.map +1 -1
- package/connection/ConnectionOptionsReader.js +38 -33
- 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 +2 -1
- package/decorator/columns/ViewColumn.js +2 -2
- package/decorator/columns/ViewColumn.js.map +1 -1
- package/decorator/entity/ChildEntity.d.ts +1 -1
- package/decorator/entity/ChildEntity.js.map +1 -1
- package/decorator/entity/Entity.d.ts +2 -2
- package/decorator/entity/Entity.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/options/ViewColumnOptions.d.ts +9 -0
- package/decorator/options/ViewColumnOptions.js +4 -0
- package/decorator/options/ViewColumnOptions.js.map +1 -0
- 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 +6 -0
- package/driver/DriverFactory.js.map +1 -1
- package/driver/DriverUtils.d.ts +2 -2
- package/driver/DriverUtils.js +6 -2
- 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 +6 -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 +106 -19
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +27 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js +4 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -0
- 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 +51 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +144 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -0
- 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 +6 -1
- package/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/driver/cockroachdb/CockroachQueryRunner.d.ts +2 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +303 -75
- 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 +1 -1
- package/driver/expo/ExpoDriver.js.map +1 -1
- package/driver/mongodb/MongoDriver.d.ts +6 -1
- package/driver/mongodb/MongoDriver.js +6 -1
- package/driver/mongodb/MongoDriver.js.map +1 -1
- package/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/driver/mongodb/typings.d.ts +4 -1
- package/driver/mongodb/typings.js.map +1 -1
- package/driver/mysql/MysqlDriver.d.ts +7 -2
- package/driver/mysql/MysqlDriver.js +10 -3
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.d.ts +6 -1
- package/driver/mysql/MysqlQueryRunner.js +122 -25
- 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 +87 -20
- package/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/driver/postgres/PostgresConnectionCredentialsOptions.d.ts +1 -1
- package/driver/postgres/PostgresConnectionCredentialsOptions.js.map +1 -1
- package/driver/postgres/PostgresConnectionOptions.d.ts +9 -0
- package/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/driver/postgres/PostgresDriver.d.ts +19 -4
- package/driver/postgres/PostgresDriver.js +179 -109
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.d.ts +2 -1
- package/driver/postgres/PostgresQueryRunner.js +288 -68
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/react-native/ReactNativeDriver.d.ts +2 -1
- package/driver/react-native/ReactNativeDriver.js +2 -2
- package/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/driver/sap/SapConnectionCredentialsOptions.d.ts +1 -1
- package/driver/sap/SapConnectionCredentialsOptions.js.map +1 -1
- package/driver/sap/SapDriver.d.ts +6 -1
- package/driver/sap/SapDriver.js +19 -9
- package/driver/sap/SapDriver.js.map +1 -1
- package/driver/sap/SapQueryRunner.d.ts +2 -1
- package/driver/sap/SapQueryRunner.js +91 -23
- 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 +24 -12
- package/driver/sqlite/SqliteDriver.js.map +1 -1
- package/driver/sqlite/SqliteQueryRunner.js +29 -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 +17 -3
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqljs/SqljsDriver.d.ts +2 -1
- package/driver/sqljs/SqljsDriver.js +1 -2
- package/driver/sqljs/SqljsDriver.js.map +1 -1
- package/driver/sqljs/SqljsQueryRunner.js +5 -1
- 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 +91 -24
- 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 +42 -257
- package/entity-manager/EntityManager.js +10 -10
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-manager/MongoEntityManager.d.ts +46 -46
- 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 +2 -2
- package/find-options/FindOneOptions.js.map +1 -1
- package/find-options/FindOperator.d.ts +6 -3
- package/find-options/FindOperator.js +22 -45
- package/find-options/FindOperator.js.map +1 -1
- package/find-options/FindOptionsUtils.d.ts +2 -2
- package/find-options/FindOptionsUtils.js +1 -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/In.d.ts +1 -1
- package/find-options/operator/In.js.map +1 -1
- package/find-options/operator/Raw.d.ts +1 -1
- package/find-options/operator/Raw.js.map +1 -1
- package/index.d.ts +8 -11
- package/index.js +1 -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/LoggerOptions.d.ts +9 -0
- package/logger/LoggerOptions.js.map +1 -1
- package/metadata/ColumnMetadata.js +10 -11
- package/metadata/ColumnMetadata.js.map +1 -1
- package/metadata/EntityMetadata.d.ts +1 -5
- package/metadata/EntityMetadata.js +13 -14
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/RelationMetadata.js +7 -7
- package/metadata/RelationMetadata.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 +8 -6
- package/metadata-builder/EntityMetadataBuilder.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/naming-strategy/DefaultNamingStrategy.d.ts +5 -0
- package/naming-strategy/DefaultNamingStrategy.js +2 -0
- package/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/naming-strategy/NamingStrategyInterface.d.ts +11 -0
- package/naming-strategy/NamingStrategyInterface.js.map +1 -1
- package/package.json +72 -51
- package/persistence/EntityPersistExecutor.js +60 -42
- package/persistence/EntityPersistExecutor.js.map +1 -1
- package/persistence/SubjectChangedColumnsComputer.js +11 -7
- package/persistence/SubjectChangedColumnsComputer.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/subject-builder/ManyToManySubjectBuilder.js +2 -3
- package/persistence/subject-builder/ManyToManySubjectBuilder.js.map +1 -1
- package/persistence/subject-builder/OneToManySubjectBuilder.js +1 -1
- package/persistence/subject-builder/OneToManySubjectBuilder.js.map +1 -1
- package/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js +1 -1
- package/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.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 +44 -43
- 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 +5 -0
- package/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/query-builder/InsertQueryBuilder.d.ts +2 -3
- package/query-builder/InsertQueryBuilder.js +18 -4
- package/query-builder/InsertQueryBuilder.js.map +1 -1
- package/query-builder/QueryBuilder.d.ts +11 -15
- package/query-builder/QueryBuilder.js +84 -23
- package/query-builder/QueryBuilder.js.map +1 -1
- package/query-builder/QueryExpressionMap.d.ts +1 -1
- 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 +4 -4
- package/query-builder/SelectQueryBuilder.js +41 -5
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-builder/SoftDeleteQueryBuilder.d.ts +2 -3
- package/query-builder/SoftDeleteQueryBuilder.js +2 -2
- package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/query-builder/UpdateQueryBuilder.js +17 -3
- package/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js +1 -4
- 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/repository/AbstractRepository.js.map +1 -1
- package/repository/BaseEntity.d.ts +17 -1
- package/repository/BaseEntity.js +20 -2
- package/repository/BaseEntity.js.map +1 -1
- package/repository/MongoRepository.js.map +1 -1
- package/repository/Repository.d.ts +1 -1
- package/repository/Repository.js +2 -2
- package/repository/Repository.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/typeorm-class-transformer-shim.js +16 -2
- package/typeorm-model-shim.js +18 -0
- package/util/ApplyValueTransformers.js.map +1 -1
- package/util/DateUtils.js +1 -1
- 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.d.ts +4 -0
- package/util/OrmUtils.js +17 -2
- package/util/OrmUtils.js.map +1 -1
- package/util/StringUtils.js +3 -2
- package/util/StringUtils.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,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { __awaiter, __extends, __generator, __read, __spread, __values } from "tslib";
|
|
2
2
|
import { QueryFailedError } from "../../error/QueryFailedError";
|
|
3
3
|
import { QueryRunnerAlreadyReleasedError } from "../../error/QueryRunnerAlreadyReleasedError";
|
|
4
4
|
import { TransactionAlreadyStartedError } from "../../error/TransactionAlreadyStartedError";
|
|
5
5
|
import { TransactionNotStartedError } from "../../error/TransactionNotStartedError";
|
|
6
|
-
import { PromiseUtils } from "../../index";
|
|
7
6
|
import { BaseQueryRunner } from "../../query-runner/BaseQueryRunner";
|
|
8
7
|
import { Table } from "../../schema-builder/table/Table";
|
|
9
8
|
import { TableCheck } from "../../schema-builder/table/TableCheck";
|
|
@@ -20,12 +19,11 @@ import { MssqlParameter } from "./MssqlParameter";
|
|
|
20
19
|
* Runs queries on a single SQL Server database connection.
|
|
21
20
|
*/
|
|
22
21
|
var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
23
|
-
|
|
22
|
+
__extends(SqlServerQueryRunner, _super);
|
|
24
23
|
// -------------------------------------------------------------------------
|
|
25
24
|
// Constructor
|
|
26
25
|
// -------------------------------------------------------------------------
|
|
27
26
|
function SqlServerQueryRunner(driver, mode) {
|
|
28
|
-
if (mode === void 0) { mode = "master"; }
|
|
29
27
|
var _this = _super.call(this) || this;
|
|
30
28
|
// -------------------------------------------------------------------------
|
|
31
29
|
// Protected Properties
|
|
@@ -66,17 +64,17 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
66
64
|
* Starts transaction.
|
|
67
65
|
*/
|
|
68
66
|
SqlServerQueryRunner.prototype.startTransaction = function (isolationLevel) {
|
|
69
|
-
return
|
|
67
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
70
68
|
var _this = this;
|
|
71
|
-
return
|
|
69
|
+
return __generator(this, function (_a) {
|
|
72
70
|
if (this.isReleased)
|
|
73
71
|
throw new QueryRunnerAlreadyReleasedError();
|
|
74
72
|
if (this.isTransactionActive)
|
|
75
73
|
throw new TransactionAlreadyStartedError();
|
|
76
|
-
return [2 /*return*/, new Promise(function (ok, fail) { return
|
|
74
|
+
return [2 /*return*/, new Promise(function (ok, fail) { return __awaiter(_this, void 0, void 0, function () {
|
|
77
75
|
var pool, transactionCallback;
|
|
78
76
|
var _this = this;
|
|
79
|
-
return
|
|
77
|
+
return __generator(this, function (_a) {
|
|
80
78
|
switch (_a.label) {
|
|
81
79
|
case 0:
|
|
82
80
|
this.isTransactionActive = true;
|
|
@@ -113,9 +111,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
113
111
|
* Error will be thrown if transaction was not started.
|
|
114
112
|
*/
|
|
115
113
|
SqlServerQueryRunner.prototype.commitTransaction = function () {
|
|
116
|
-
return
|
|
114
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
117
115
|
var _this = this;
|
|
118
|
-
return
|
|
116
|
+
return __generator(this, function (_a) {
|
|
119
117
|
if (this.isReleased)
|
|
120
118
|
throw new QueryRunnerAlreadyReleasedError();
|
|
121
119
|
if (!this.isTransactionActive)
|
|
@@ -138,9 +136,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
138
136
|
* Error will be thrown if transaction was not started.
|
|
139
137
|
*/
|
|
140
138
|
SqlServerQueryRunner.prototype.rollbackTransaction = function () {
|
|
141
|
-
return
|
|
139
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
142
140
|
var _this = this;
|
|
143
|
-
return
|
|
141
|
+
return __generator(this, function (_a) {
|
|
144
142
|
if (this.isReleased)
|
|
145
143
|
throw new QueryRunnerAlreadyReleasedError();
|
|
146
144
|
if (!this.isTransactionActive)
|
|
@@ -162,27 +160,27 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
162
160
|
* Executes a given SQL query.
|
|
163
161
|
*/
|
|
164
162
|
SqlServerQueryRunner.prototype.query = function (query, parameters) {
|
|
165
|
-
return
|
|
163
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
166
164
|
var waitingOkay, waitingPromise, otherWaitingPromises, promise;
|
|
167
165
|
var _this = this;
|
|
168
|
-
return
|
|
166
|
+
return __generator(this, function (_a) {
|
|
169
167
|
switch (_a.label) {
|
|
170
168
|
case 0:
|
|
171
169
|
if (this.isReleased)
|
|
172
170
|
throw new QueryRunnerAlreadyReleasedError();
|
|
173
171
|
waitingPromise = new Promise(function (ok) { return waitingOkay = ok; });
|
|
174
172
|
if (!this.queryResponsibilityChain.length) return [3 /*break*/, 2];
|
|
175
|
-
otherWaitingPromises =
|
|
173
|
+
otherWaitingPromises = __spread(this.queryResponsibilityChain);
|
|
176
174
|
this.queryResponsibilityChain.push(waitingPromise);
|
|
177
175
|
return [4 /*yield*/, Promise.all(otherWaitingPromises)];
|
|
178
176
|
case 1:
|
|
179
177
|
_a.sent();
|
|
180
178
|
_a.label = 2;
|
|
181
179
|
case 2:
|
|
182
|
-
promise = new Promise(function (ok, fail) { return
|
|
180
|
+
promise = new Promise(function (ok, fail) { return __awaiter(_this, void 0, void 0, function () {
|
|
183
181
|
var pool, request_1, queryStartTime_1, err_1;
|
|
184
182
|
var _this = this;
|
|
185
|
-
return
|
|
183
|
+
return __generator(this, function (_a) {
|
|
186
184
|
switch (_a.label) {
|
|
187
185
|
case 0:
|
|
188
186
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -261,27 +259,27 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
261
259
|
* Returns raw data stream.
|
|
262
260
|
*/
|
|
263
261
|
SqlServerQueryRunner.prototype.stream = function (query, parameters, onEnd, onError) {
|
|
264
|
-
return
|
|
262
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
265
263
|
var waitingOkay, waitingPromise, otherWaitingPromises, promise;
|
|
266
264
|
var _this = this;
|
|
267
|
-
return
|
|
265
|
+
return __generator(this, function (_a) {
|
|
268
266
|
switch (_a.label) {
|
|
269
267
|
case 0:
|
|
270
268
|
if (this.isReleased)
|
|
271
269
|
throw new QueryRunnerAlreadyReleasedError();
|
|
272
270
|
waitingPromise = new Promise(function (ok) { return waitingOkay = ok; });
|
|
273
271
|
if (!this.queryResponsibilityChain.length) return [3 /*break*/, 2];
|
|
274
|
-
otherWaitingPromises =
|
|
272
|
+
otherWaitingPromises = __spread(this.queryResponsibilityChain);
|
|
275
273
|
this.queryResponsibilityChain.push(waitingPromise);
|
|
276
274
|
return [4 /*yield*/, Promise.all(otherWaitingPromises)];
|
|
277
275
|
case 1:
|
|
278
276
|
_a.sent();
|
|
279
277
|
_a.label = 2;
|
|
280
278
|
case 2:
|
|
281
|
-
promise = new Promise(function (ok, fail) { return
|
|
279
|
+
promise = new Promise(function (ok, fail) { return __awaiter(_this, void 0, void 0, function () {
|
|
282
280
|
var pool, request;
|
|
283
281
|
var _this = this;
|
|
284
|
-
return
|
|
282
|
+
return __generator(this, function (_a) {
|
|
285
283
|
switch (_a.label) {
|
|
286
284
|
case 0:
|
|
287
285
|
this.driver.connection.logger.logQuery(query, parameters, this);
|
|
@@ -338,9 +336,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
338
336
|
* Returns all available database names including system databases.
|
|
339
337
|
*/
|
|
340
338
|
SqlServerQueryRunner.prototype.getDatabases = function () {
|
|
341
|
-
return
|
|
339
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
342
340
|
var results;
|
|
343
|
-
return
|
|
341
|
+
return __generator(this, function (_a) {
|
|
344
342
|
switch (_a.label) {
|
|
345
343
|
case 0: return [4 /*yield*/, this.query("EXEC sp_databases")];
|
|
346
344
|
case 1:
|
|
@@ -355,9 +353,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
355
353
|
* If database parameter specified, returns schemas of that database.
|
|
356
354
|
*/
|
|
357
355
|
SqlServerQueryRunner.prototype.getSchemas = function (database) {
|
|
358
|
-
return
|
|
356
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
359
357
|
var query, results;
|
|
360
|
-
return
|
|
358
|
+
return __generator(this, function (_a) {
|
|
361
359
|
switch (_a.label) {
|
|
362
360
|
case 0:
|
|
363
361
|
query = database ? "SELECT * FROM \"" + database + "\".\"sys\".\"schema\"" : "SELECT * FROM \"sys\".\"schemas\"";
|
|
@@ -373,9 +371,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
373
371
|
* Checks if database with the given name exist.
|
|
374
372
|
*/
|
|
375
373
|
SqlServerQueryRunner.prototype.hasDatabase = function (database) {
|
|
376
|
-
return
|
|
374
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
377
375
|
var result, dbId;
|
|
378
|
-
return
|
|
376
|
+
return __generator(this, function (_a) {
|
|
379
377
|
switch (_a.label) {
|
|
380
378
|
case 0: return [4 /*yield*/, this.query("SELECT DB_ID('" + database + "') as \"db_id\"")];
|
|
381
379
|
case 1:
|
|
@@ -390,9 +388,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
390
388
|
* Checks if schema with the given name exist.
|
|
391
389
|
*/
|
|
392
390
|
SqlServerQueryRunner.prototype.hasSchema = function (schema) {
|
|
393
|
-
return
|
|
391
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
394
392
|
var result, schemaId;
|
|
395
|
-
return
|
|
393
|
+
return __generator(this, function (_a) {
|
|
396
394
|
switch (_a.label) {
|
|
397
395
|
case 0: return [4 /*yield*/, this.query("SELECT SCHEMA_ID('" + schema + "') as \"schema_id\"")];
|
|
398
396
|
case 1:
|
|
@@ -407,9 +405,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
407
405
|
* Checks if table with the given name exist in the database.
|
|
408
406
|
*/
|
|
409
407
|
SqlServerQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
410
|
-
return
|
|
408
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
411
409
|
var parsedTableName, schema, sql, result;
|
|
412
|
-
return
|
|
410
|
+
return __generator(this, function (_a) {
|
|
413
411
|
switch (_a.label) {
|
|
414
412
|
case 0:
|
|
415
413
|
parsedTableName = this.parseTableName(tableOrName);
|
|
@@ -427,14 +425,14 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
427
425
|
* Checks if column exist in the table.
|
|
428
426
|
*/
|
|
429
427
|
SqlServerQueryRunner.prototype.hasColumn = function (tableOrName, columnName) {
|
|
430
|
-
return
|
|
428
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
431
429
|
var parsedTableName, schema, sql, result;
|
|
432
|
-
return
|
|
430
|
+
return __generator(this, function (_a) {
|
|
433
431
|
switch (_a.label) {
|
|
434
432
|
case 0:
|
|
435
433
|
parsedTableName = this.parseTableName(tableOrName);
|
|
436
434
|
schema = parsedTableName.schema === "SCHEMA_NAME()" ? parsedTableName.schema : "'" + parsedTableName.schema + "'";
|
|
437
|
-
sql = "SELECT * FROM \"" + parsedTableName.database + "\".\"INFORMATION_SCHEMA\".\"
|
|
435
|
+
sql = "SELECT * FROM \"" + parsedTableName.database + "\".\"INFORMATION_SCHEMA\".\"COLUMNS\" WHERE \"TABLE_NAME\" = '" + parsedTableName.name + "' AND \"COLUMN_NAME\" = '" + columnName + "' AND \"TABLE_SCHEMA\" = " + schema;
|
|
438
436
|
return [4 /*yield*/, this.query(sql)];
|
|
439
437
|
case 1:
|
|
440
438
|
result = _a.sent();
|
|
@@ -447,9 +445,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
447
445
|
* Creates a new database.
|
|
448
446
|
*/
|
|
449
447
|
SqlServerQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
450
|
-
return
|
|
448
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
451
449
|
var up, down;
|
|
452
|
-
return
|
|
450
|
+
return __generator(this, function (_a) {
|
|
453
451
|
switch (_a.label) {
|
|
454
452
|
case 0:
|
|
455
453
|
up = ifNotExist ? "IF DB_ID('" + database + "') IS NULL CREATE DATABASE \"" + database + "\"" : "CREATE DATABASE \"" + database + "\"";
|
|
@@ -466,9 +464,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
466
464
|
* Drops database.
|
|
467
465
|
*/
|
|
468
466
|
SqlServerQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
469
|
-
return
|
|
467
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
470
468
|
var up, down;
|
|
471
|
-
return
|
|
469
|
+
return __generator(this, function (_a) {
|
|
472
470
|
switch (_a.label) {
|
|
473
471
|
case 0:
|
|
474
472
|
up = ifExist ? "IF DB_ID('" + database + "') IS NOT NULL DROP DATABASE \"" + database + "\"" : "DROP DATABASE \"" + database + "\"";
|
|
@@ -486,9 +484,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
486
484
|
* If database name also specified (e.g. 'dbName.schemaName') schema will be created in specified database.
|
|
487
485
|
*/
|
|
488
486
|
SqlServerQueryRunner.prototype.createSchema = function (schemaPath, ifNotExist) {
|
|
489
|
-
return
|
|
487
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
490
488
|
var upQueries, downQueries, upQuery, dbName, schema, currentDB, upQuery;
|
|
491
|
-
return
|
|
489
|
+
return __generator(this, function (_a) {
|
|
492
490
|
switch (_a.label) {
|
|
493
491
|
case 0:
|
|
494
492
|
upQueries = [];
|
|
@@ -525,9 +523,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
525
523
|
* If database name also specified (e.g. 'dbName.schemaName') schema will be dropped in specified database.
|
|
526
524
|
*/
|
|
527
525
|
SqlServerQueryRunner.prototype.dropSchema = function (schemaPath, ifExist) {
|
|
528
|
-
return
|
|
526
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
529
527
|
var upQueries, downQueries, upQuery, dbName, schema, currentDB, upQuery;
|
|
530
|
-
return
|
|
528
|
+
return __generator(this, function (_a) {
|
|
531
529
|
switch (_a.label) {
|
|
532
530
|
case 0:
|
|
533
531
|
upQueries = [];
|
|
@@ -566,10 +564,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
566
564
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
567
565
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
568
566
|
if (createIndices === void 0) { createIndices = true; }
|
|
569
|
-
return
|
|
567
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
570
568
|
var isTableExist, upQueries, downQueries;
|
|
571
569
|
var _this = this;
|
|
572
|
-
return
|
|
570
|
+
return __generator(this, function (_a) {
|
|
573
571
|
switch (_a.label) {
|
|
574
572
|
case 0:
|
|
575
573
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -611,10 +609,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
611
609
|
SqlServerQueryRunner.prototype.dropTable = function (tableOrName, ifExist, dropForeignKeys, dropIndices) {
|
|
612
610
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
613
611
|
if (dropIndices === void 0) { dropIndices = true; }
|
|
614
|
-
return
|
|
612
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
615
613
|
var isTableExist, createForeignKeys, table, _a, upQueries, downQueries;
|
|
616
614
|
var _this = this;
|
|
617
|
-
return
|
|
615
|
+
return __generator(this, function (_b) {
|
|
618
616
|
switch (_b.label) {
|
|
619
617
|
case 0:
|
|
620
618
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -663,9 +661,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
663
661
|
* Creates a new view.
|
|
664
662
|
*/
|
|
665
663
|
SqlServerQueryRunner.prototype.createView = function (view) {
|
|
666
|
-
return
|
|
664
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
667
665
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
668
|
-
return
|
|
666
|
+
return __generator(this, function (_e) {
|
|
669
667
|
switch (_e.label) {
|
|
670
668
|
case 0:
|
|
671
669
|
upQueries = [];
|
|
@@ -692,9 +690,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
692
690
|
* Drops the view.
|
|
693
691
|
*/
|
|
694
692
|
SqlServerQueryRunner.prototype.dropView = function (target) {
|
|
695
|
-
return
|
|
693
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
696
694
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
697
|
-
return
|
|
695
|
+
return __generator(this, function (_e) {
|
|
698
696
|
switch (_e.label) {
|
|
699
697
|
case 0:
|
|
700
698
|
viewName = target instanceof View ? target.name : target;
|
|
@@ -725,10 +723,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
725
723
|
* Renames a table.
|
|
726
724
|
*/
|
|
727
725
|
SqlServerQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
728
|
-
return
|
|
726
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
729
727
|
var upQueries, downQueries, oldTable, _a, newTable, dbName, schemaName, oldTableName, splittedName, currentDB, columnNames, oldPkName, newPkName;
|
|
730
728
|
var _this = this;
|
|
731
|
-
return
|
|
729
|
+
return __generator(this, function (_b) {
|
|
732
730
|
switch (_b.label) {
|
|
733
731
|
case 0:
|
|
734
732
|
upQueries = [];
|
|
@@ -827,9 +825,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
827
825
|
* Creates a new column from the column in the table.
|
|
828
826
|
*/
|
|
829
827
|
SqlServerQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
830
|
-
return
|
|
828
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
831
829
|
var table, _a, clonedTable, upQueries, downQueries, primaryColumns, pkName_1, columnNames_1, pkName, columnNames, columnIndex, uniqueConstraint, defaultName;
|
|
832
|
-
return
|
|
830
|
+
return __generator(this, function (_b) {
|
|
833
831
|
switch (_b.label) {
|
|
834
832
|
case 0:
|
|
835
833
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -896,14 +894,37 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
896
894
|
* Creates a new columns from the column in the table.
|
|
897
895
|
*/
|
|
898
896
|
SqlServerQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
899
|
-
return
|
|
900
|
-
var
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
897
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
898
|
+
var columns_1, columns_1_1, column, e_1_1;
|
|
899
|
+
var e_1, _a;
|
|
900
|
+
return __generator(this, function (_b) {
|
|
901
|
+
switch (_b.label) {
|
|
902
|
+
case 0:
|
|
903
|
+
_b.trys.push([0, 5, 6, 7]);
|
|
904
|
+
columns_1 = __values(columns), columns_1_1 = columns_1.next();
|
|
905
|
+
_b.label = 1;
|
|
904
906
|
case 1:
|
|
905
|
-
|
|
906
|
-
|
|
907
|
+
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
908
|
+
column = columns_1_1.value;
|
|
909
|
+
return [4 /*yield*/, this.addColumn(tableOrName, column)];
|
|
910
|
+
case 2:
|
|
911
|
+
_b.sent();
|
|
912
|
+
_b.label = 3;
|
|
913
|
+
case 3:
|
|
914
|
+
columns_1_1 = columns_1.next();
|
|
915
|
+
return [3 /*break*/, 1];
|
|
916
|
+
case 4: return [3 /*break*/, 7];
|
|
917
|
+
case 5:
|
|
918
|
+
e_1_1 = _b.sent();
|
|
919
|
+
e_1 = { error: e_1_1 };
|
|
920
|
+
return [3 /*break*/, 7];
|
|
921
|
+
case 6:
|
|
922
|
+
try {
|
|
923
|
+
if (columns_1_1 && !columns_1_1.done && (_a = columns_1.return)) _a.call(columns_1);
|
|
924
|
+
}
|
|
925
|
+
finally { if (e_1) throw e_1.error; }
|
|
926
|
+
return [7 /*endfinally*/];
|
|
927
|
+
case 7: return [2 /*return*/];
|
|
907
928
|
}
|
|
908
929
|
});
|
|
909
930
|
});
|
|
@@ -912,9 +933,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
912
933
|
* Renames column in the given table.
|
|
913
934
|
*/
|
|
914
935
|
SqlServerQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
915
|
-
return
|
|
936
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
916
937
|
var table, _a, oldColumn, newColumn;
|
|
917
|
-
return
|
|
938
|
+
return __generator(this, function (_b) {
|
|
918
939
|
switch (_b.label) {
|
|
919
940
|
case 0:
|
|
920
941
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -949,10 +970,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
949
970
|
* Changes a column in the table.
|
|
950
971
|
*/
|
|
951
972
|
SqlServerQueryRunner.prototype.changeColumn = function (tableOrName, oldTableColumnOrName, newColumn) {
|
|
952
|
-
return
|
|
973
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
953
974
|
var table, _a, clonedTable, upQueries, downQueries, oldColumn, dbName_1, schemaName_1, splittedName, currentDB, primaryColumns, columnNames, oldPkName, newPkName, oldDefaultName, newDefaultName, oldTableColumn, primaryColumns, pkName, columnNames, column, pkName, columnNames, primaryColumn, column, pkName, columnNames, uniqueConstraint, uniqueConstraint, defaultName, defaultName;
|
|
954
975
|
var _this = this;
|
|
955
|
-
return
|
|
976
|
+
return __generator(this, function (_b) {
|
|
956
977
|
switch (_b.label) {
|
|
957
978
|
case 0:
|
|
958
979
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1170,14 +1191,37 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1170
1191
|
* Changes a column in the table.
|
|
1171
1192
|
*/
|
|
1172
1193
|
SqlServerQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
1173
|
-
return
|
|
1174
|
-
var
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1194
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1195
|
+
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_2_1;
|
|
1196
|
+
var e_2, _b;
|
|
1197
|
+
return __generator(this, function (_c) {
|
|
1198
|
+
switch (_c.label) {
|
|
1199
|
+
case 0:
|
|
1200
|
+
_c.trys.push([0, 5, 6, 7]);
|
|
1201
|
+
changedColumns_1 = __values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1202
|
+
_c.label = 1;
|
|
1178
1203
|
case 1:
|
|
1179
|
-
|
|
1180
|
-
|
|
1204
|
+
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
1205
|
+
_a = changedColumns_1_1.value, oldColumn = _a.oldColumn, newColumn = _a.newColumn;
|
|
1206
|
+
return [4 /*yield*/, this.changeColumn(tableOrName, oldColumn, newColumn)];
|
|
1207
|
+
case 2:
|
|
1208
|
+
_c.sent();
|
|
1209
|
+
_c.label = 3;
|
|
1210
|
+
case 3:
|
|
1211
|
+
changedColumns_1_1 = changedColumns_1.next();
|
|
1212
|
+
return [3 /*break*/, 1];
|
|
1213
|
+
case 4: return [3 /*break*/, 7];
|
|
1214
|
+
case 5:
|
|
1215
|
+
e_2_1 = _c.sent();
|
|
1216
|
+
e_2 = { error: e_2_1 };
|
|
1217
|
+
return [3 /*break*/, 7];
|
|
1218
|
+
case 6:
|
|
1219
|
+
try {
|
|
1220
|
+
if (changedColumns_1_1 && !changedColumns_1_1.done && (_b = changedColumns_1.return)) _b.call(changedColumns_1);
|
|
1221
|
+
}
|
|
1222
|
+
finally { if (e_2) throw e_2.error; }
|
|
1223
|
+
return [7 /*endfinally*/];
|
|
1224
|
+
case 7: return [2 /*return*/];
|
|
1181
1225
|
}
|
|
1182
1226
|
});
|
|
1183
1227
|
});
|
|
@@ -1186,9 +1230,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1186
1230
|
* Drops column in the table.
|
|
1187
1231
|
*/
|
|
1188
1232
|
SqlServerQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1189
|
-
return
|
|
1233
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1190
1234
|
var table, _a, column, clonedTable, upQueries, downQueries, pkName, columnNames, tableColumn, pkName_2, columnNames_2, columnIndex, columnCheck, columnUnique, defaultName;
|
|
1191
|
-
return
|
|
1235
|
+
return __generator(this, function (_b) {
|
|
1192
1236
|
switch (_b.label) {
|
|
1193
1237
|
case 0:
|
|
1194
1238
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1262,14 +1306,37 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1262
1306
|
* Drops the columns in the table.
|
|
1263
1307
|
*/
|
|
1264
1308
|
SqlServerQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1265
|
-
return
|
|
1266
|
-
var
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1309
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1310
|
+
var columns_2, columns_2_1, column, e_3_1;
|
|
1311
|
+
var e_3, _a;
|
|
1312
|
+
return __generator(this, function (_b) {
|
|
1313
|
+
switch (_b.label) {
|
|
1314
|
+
case 0:
|
|
1315
|
+
_b.trys.push([0, 5, 6, 7]);
|
|
1316
|
+
columns_2 = __values(columns), columns_2_1 = columns_2.next();
|
|
1317
|
+
_b.label = 1;
|
|
1270
1318
|
case 1:
|
|
1271
|
-
|
|
1272
|
-
|
|
1319
|
+
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
1320
|
+
column = columns_2_1.value;
|
|
1321
|
+
return [4 /*yield*/, this.dropColumn(tableOrName, column)];
|
|
1322
|
+
case 2:
|
|
1323
|
+
_b.sent();
|
|
1324
|
+
_b.label = 3;
|
|
1325
|
+
case 3:
|
|
1326
|
+
columns_2_1 = columns_2.next();
|
|
1327
|
+
return [3 /*break*/, 1];
|
|
1328
|
+
case 4: return [3 /*break*/, 7];
|
|
1329
|
+
case 5:
|
|
1330
|
+
e_3_1 = _b.sent();
|
|
1331
|
+
e_3 = { error: e_3_1 };
|
|
1332
|
+
return [3 /*break*/, 7];
|
|
1333
|
+
case 6:
|
|
1334
|
+
try {
|
|
1335
|
+
if (columns_2_1 && !columns_2_1.done && (_a = columns_2.return)) _a.call(columns_2);
|
|
1336
|
+
}
|
|
1337
|
+
finally { if (e_3) throw e_3.error; }
|
|
1338
|
+
return [7 /*endfinally*/];
|
|
1339
|
+
case 7: return [2 /*return*/];
|
|
1273
1340
|
}
|
|
1274
1341
|
});
|
|
1275
1342
|
});
|
|
@@ -1278,9 +1345,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1278
1345
|
* Creates a new primary key.
|
|
1279
1346
|
*/
|
|
1280
1347
|
SqlServerQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1281
|
-
return
|
|
1348
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1282
1349
|
var table, _a, clonedTable, up, down;
|
|
1283
|
-
return
|
|
1350
|
+
return __generator(this, function (_b) {
|
|
1284
1351
|
switch (_b.label) {
|
|
1285
1352
|
case 0:
|
|
1286
1353
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1313,9 +1380,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1313
1380
|
* Updates composite primary keys.
|
|
1314
1381
|
*/
|
|
1315
1382
|
SqlServerQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1316
|
-
return
|
|
1383
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1317
1384
|
var table, _a, clonedTable, columnNames, upQueries, downQueries, primaryColumns, pkName_3, columnNamesString_1, pkName, columnNamesString;
|
|
1318
|
-
return
|
|
1385
|
+
return __generator(this, function (_b) {
|
|
1319
1386
|
switch (_b.label) {
|
|
1320
1387
|
case 0:
|
|
1321
1388
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1359,9 +1426,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1359
1426
|
* Drops a primary key.
|
|
1360
1427
|
*/
|
|
1361
1428
|
SqlServerQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1362
|
-
return
|
|
1429
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1363
1430
|
var table, _a, up, down;
|
|
1364
|
-
return
|
|
1431
|
+
return __generator(this, function (_b) {
|
|
1365
1432
|
switch (_b.label) {
|
|
1366
1433
|
case 0:
|
|
1367
1434
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1390,9 +1457,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1390
1457
|
* Creates a new unique constraint.
|
|
1391
1458
|
*/
|
|
1392
1459
|
SqlServerQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1393
|
-
return
|
|
1460
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1394
1461
|
var table, _a, up, down;
|
|
1395
|
-
return
|
|
1462
|
+
return __generator(this, function (_b) {
|
|
1396
1463
|
switch (_b.label) {
|
|
1397
1464
|
case 0:
|
|
1398
1465
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1422,10 +1489,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1422
1489
|
* Creates a new unique constraints.
|
|
1423
1490
|
*/
|
|
1424
1491
|
SqlServerQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1425
|
-
return
|
|
1492
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1426
1493
|
var promises;
|
|
1427
1494
|
var _this = this;
|
|
1428
|
-
return
|
|
1495
|
+
return __generator(this, function (_a) {
|
|
1429
1496
|
switch (_a.label) {
|
|
1430
1497
|
case 0:
|
|
1431
1498
|
promises = uniqueConstraints.map(function (uniqueConstraint) { return _this.createUniqueConstraint(tableOrName, uniqueConstraint); });
|
|
@@ -1441,9 +1508,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1441
1508
|
* Drops unique constraint.
|
|
1442
1509
|
*/
|
|
1443
1510
|
SqlServerQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1444
|
-
return
|
|
1511
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1445
1512
|
var table, _a, uniqueConstraint, up, down;
|
|
1446
|
-
return
|
|
1513
|
+
return __generator(this, function (_b) {
|
|
1447
1514
|
switch (_b.label) {
|
|
1448
1515
|
case 0:
|
|
1449
1516
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1473,10 +1540,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1473
1540
|
* Drops an unique constraints.
|
|
1474
1541
|
*/
|
|
1475
1542
|
SqlServerQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1476
|
-
return
|
|
1543
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1477
1544
|
var promises;
|
|
1478
1545
|
var _this = this;
|
|
1479
|
-
return
|
|
1546
|
+
return __generator(this, function (_a) {
|
|
1480
1547
|
switch (_a.label) {
|
|
1481
1548
|
case 0:
|
|
1482
1549
|
promises = uniqueConstraints.map(function (uniqueConstraint) { return _this.dropUniqueConstraint(tableOrName, uniqueConstraint); });
|
|
@@ -1492,9 +1559,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1492
1559
|
* Creates a new check constraint.
|
|
1493
1560
|
*/
|
|
1494
1561
|
SqlServerQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1495
|
-
return
|
|
1562
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1496
1563
|
var table, _a, up, down;
|
|
1497
|
-
return
|
|
1564
|
+
return __generator(this, function (_b) {
|
|
1498
1565
|
switch (_b.label) {
|
|
1499
1566
|
case 0:
|
|
1500
1567
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1524,10 +1591,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1524
1591
|
* Creates a new check constraints.
|
|
1525
1592
|
*/
|
|
1526
1593
|
SqlServerQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1527
|
-
return
|
|
1594
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1528
1595
|
var promises;
|
|
1529
1596
|
var _this = this;
|
|
1530
|
-
return
|
|
1597
|
+
return __generator(this, function (_a) {
|
|
1531
1598
|
switch (_a.label) {
|
|
1532
1599
|
case 0:
|
|
1533
1600
|
promises = checkConstraints.map(function (checkConstraint) { return _this.createCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1543,9 +1610,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1543
1610
|
* Drops check constraint.
|
|
1544
1611
|
*/
|
|
1545
1612
|
SqlServerQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1546
|
-
return
|
|
1613
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1547
1614
|
var table, _a, checkConstraint, up, down;
|
|
1548
|
-
return
|
|
1615
|
+
return __generator(this, function (_b) {
|
|
1549
1616
|
switch (_b.label) {
|
|
1550
1617
|
case 0:
|
|
1551
1618
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1575,10 +1642,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1575
1642
|
* Drops check constraints.
|
|
1576
1643
|
*/
|
|
1577
1644
|
SqlServerQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1578
|
-
return
|
|
1645
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1579
1646
|
var promises;
|
|
1580
1647
|
var _this = this;
|
|
1581
|
-
return
|
|
1648
|
+
return __generator(this, function (_a) {
|
|
1582
1649
|
switch (_a.label) {
|
|
1583
1650
|
case 0:
|
|
1584
1651
|
promises = checkConstraints.map(function (checkConstraint) { return _this.dropCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1594,8 +1661,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1594
1661
|
* Creates a new exclusion constraint.
|
|
1595
1662
|
*/
|
|
1596
1663
|
SqlServerQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1597
|
-
return
|
|
1598
|
-
return
|
|
1664
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1665
|
+
return __generator(this, function (_a) {
|
|
1599
1666
|
throw new Error("SqlServer does not support exclusion constraints.");
|
|
1600
1667
|
});
|
|
1601
1668
|
});
|
|
@@ -1604,8 +1671,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1604
1671
|
* Creates a new exclusion constraints.
|
|
1605
1672
|
*/
|
|
1606
1673
|
SqlServerQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1607
|
-
return
|
|
1608
|
-
return
|
|
1674
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1675
|
+
return __generator(this, function (_a) {
|
|
1609
1676
|
throw new Error("SqlServer does not support exclusion constraints.");
|
|
1610
1677
|
});
|
|
1611
1678
|
});
|
|
@@ -1614,8 +1681,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1614
1681
|
* Drops exclusion constraint.
|
|
1615
1682
|
*/
|
|
1616
1683
|
SqlServerQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1617
|
-
return
|
|
1618
|
-
return
|
|
1684
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1685
|
+
return __generator(this, function (_a) {
|
|
1619
1686
|
throw new Error("SqlServer does not support exclusion constraints.");
|
|
1620
1687
|
});
|
|
1621
1688
|
});
|
|
@@ -1624,8 +1691,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1624
1691
|
* Drops exclusion constraints.
|
|
1625
1692
|
*/
|
|
1626
1693
|
SqlServerQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1627
|
-
return
|
|
1628
|
-
return
|
|
1694
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1695
|
+
return __generator(this, function (_a) {
|
|
1629
1696
|
throw new Error("SqlServer does not support exclusion constraints.");
|
|
1630
1697
|
});
|
|
1631
1698
|
});
|
|
@@ -1634,9 +1701,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1634
1701
|
* Creates a new foreign key.
|
|
1635
1702
|
*/
|
|
1636
1703
|
SqlServerQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1637
|
-
return
|
|
1704
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1638
1705
|
var table, _a, up, down;
|
|
1639
|
-
return
|
|
1706
|
+
return __generator(this, function (_b) {
|
|
1640
1707
|
switch (_b.label) {
|
|
1641
1708
|
case 0:
|
|
1642
1709
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1666,10 +1733,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1666
1733
|
* Creates a new foreign keys.
|
|
1667
1734
|
*/
|
|
1668
1735
|
SqlServerQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1669
|
-
return
|
|
1736
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1670
1737
|
var promises;
|
|
1671
1738
|
var _this = this;
|
|
1672
|
-
return
|
|
1739
|
+
return __generator(this, function (_a) {
|
|
1673
1740
|
switch (_a.label) {
|
|
1674
1741
|
case 0:
|
|
1675
1742
|
promises = foreignKeys.map(function (foreignKey) { return _this.createForeignKey(tableOrName, foreignKey); });
|
|
@@ -1685,9 +1752,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1685
1752
|
* Drops a foreign key from the table.
|
|
1686
1753
|
*/
|
|
1687
1754
|
SqlServerQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1688
|
-
return
|
|
1755
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1689
1756
|
var table, _a, foreignKey, up, down;
|
|
1690
|
-
return
|
|
1757
|
+
return __generator(this, function (_b) {
|
|
1691
1758
|
switch (_b.label) {
|
|
1692
1759
|
case 0:
|
|
1693
1760
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1717,10 +1784,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1717
1784
|
* Drops a foreign keys from the table.
|
|
1718
1785
|
*/
|
|
1719
1786
|
SqlServerQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1720
|
-
return
|
|
1787
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1721
1788
|
var promises;
|
|
1722
1789
|
var _this = this;
|
|
1723
|
-
return
|
|
1790
|
+
return __generator(this, function (_a) {
|
|
1724
1791
|
switch (_a.label) {
|
|
1725
1792
|
case 0:
|
|
1726
1793
|
promises = foreignKeys.map(function (foreignKey) { return _this.dropForeignKey(tableOrName, foreignKey); });
|
|
@@ -1736,9 +1803,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1736
1803
|
* Creates a new index.
|
|
1737
1804
|
*/
|
|
1738
1805
|
SqlServerQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
1739
|
-
return
|
|
1806
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1740
1807
|
var table, _a, up, down;
|
|
1741
|
-
return
|
|
1808
|
+
return __generator(this, function (_b) {
|
|
1742
1809
|
switch (_b.label) {
|
|
1743
1810
|
case 0:
|
|
1744
1811
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1768,10 +1835,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1768
1835
|
* Creates a new indices
|
|
1769
1836
|
*/
|
|
1770
1837
|
SqlServerQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
1771
|
-
return
|
|
1838
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1772
1839
|
var promises;
|
|
1773
1840
|
var _this = this;
|
|
1774
|
-
return
|
|
1841
|
+
return __generator(this, function (_a) {
|
|
1775
1842
|
switch (_a.label) {
|
|
1776
1843
|
case 0:
|
|
1777
1844
|
promises = indices.map(function (index) { return _this.createIndex(tableOrName, index); });
|
|
@@ -1787,9 +1854,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1787
1854
|
* Drops an index.
|
|
1788
1855
|
*/
|
|
1789
1856
|
SqlServerQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
1790
|
-
return
|
|
1857
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1791
1858
|
var table, _a, index, up, down;
|
|
1792
|
-
return
|
|
1859
|
+
return __generator(this, function (_b) {
|
|
1793
1860
|
switch (_b.label) {
|
|
1794
1861
|
case 0:
|
|
1795
1862
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1819,10 +1886,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1819
1886
|
* Drops an indices from the table.
|
|
1820
1887
|
*/
|
|
1821
1888
|
SqlServerQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
1822
|
-
return
|
|
1889
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1823
1890
|
var promises;
|
|
1824
1891
|
var _this = this;
|
|
1825
|
-
return
|
|
1892
|
+
return __generator(this, function (_a) {
|
|
1826
1893
|
switch (_a.label) {
|
|
1827
1894
|
case 0:
|
|
1828
1895
|
promises = indices.map(function (index) { return _this.dropIndex(tableOrName, index); });
|
|
@@ -1839,8 +1906,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1839
1906
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
1840
1907
|
*/
|
|
1841
1908
|
SqlServerQueryRunner.prototype.clearTable = function (tablePath) {
|
|
1842
|
-
return
|
|
1843
|
-
return
|
|
1909
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1910
|
+
return __generator(this, function (_a) {
|
|
1844
1911
|
switch (_a.label) {
|
|
1845
1912
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tablePath))];
|
|
1846
1913
|
case 1:
|
|
@@ -1854,10 +1921,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1854
1921
|
* Removes all tables from the currently connected database.
|
|
1855
1922
|
*/
|
|
1856
1923
|
SqlServerQueryRunner.prototype.clearDatabase = function (database) {
|
|
1857
|
-
return
|
|
1924
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1858
1925
|
var isDatabaseExist, allViewsSql, allViewsResults, allTablesSql, allTablesResults, error_1, rollbackError_1;
|
|
1859
1926
|
var _this = this;
|
|
1860
|
-
return
|
|
1927
|
+
return __generator(this, function (_a) {
|
|
1861
1928
|
switch (_a.label) {
|
|
1862
1929
|
case 0:
|
|
1863
1930
|
if (!database) return [3 /*break*/, 2];
|
|
@@ -1892,10 +1959,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1892
1959
|
return [4 /*yield*/, this.query(allTablesSql)];
|
|
1893
1960
|
case 7:
|
|
1894
1961
|
allTablesResults = _a.sent();
|
|
1895
|
-
return [4 /*yield*/, Promise.all(allTablesResults.map(function (tablesResult) { return
|
|
1962
|
+
return [4 /*yield*/, Promise.all(allTablesResults.map(function (tablesResult) { return __awaiter(_this, void 0, void 0, function () {
|
|
1896
1963
|
var dropForeignKeySql, dropFkQueries;
|
|
1897
1964
|
var _this = this;
|
|
1898
|
-
return
|
|
1965
|
+
return __generator(this, function (_a) {
|
|
1899
1966
|
switch (_a.label) {
|
|
1900
1967
|
case 0:
|
|
1901
1968
|
dropForeignKeySql = "SELECT 'ALTER TABLE \"" + tablesResult["TABLE_CATALOG"] + "\".\"' + OBJECT_SCHEMA_NAME(\"fk\".\"parent_object_id\", DB_ID('" + tablesResult["TABLE_CATALOG"] + "')) + '\".\"' + OBJECT_NAME(\"fk\".\"parent_object_id\", DB_ID('" + tablesResult["TABLE_CATALOG"] + "')) + '\" " +
|
|
@@ -1949,9 +2016,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1949
2016
|
* Return current database.
|
|
1950
2017
|
*/
|
|
1951
2018
|
SqlServerQueryRunner.prototype.getCurrentDatabase = function () {
|
|
1952
|
-
return
|
|
2019
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1953
2020
|
var currentDBQuery;
|
|
1954
|
-
return
|
|
2021
|
+
return __generator(this, function (_a) {
|
|
1955
2022
|
switch (_a.label) {
|
|
1956
2023
|
case 0: return [4 /*yield*/, this.query("SELECT DB_NAME() AS \"db_name\"")];
|
|
1957
2024
|
case 1:
|
|
@@ -1965,9 +2032,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1965
2032
|
* Return current schema.
|
|
1966
2033
|
*/
|
|
1967
2034
|
SqlServerQueryRunner.prototype.getCurrentSchema = function () {
|
|
1968
|
-
return
|
|
2035
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1969
2036
|
var currentSchemaQuery;
|
|
1970
|
-
return
|
|
2037
|
+
return __generator(this, function (_a) {
|
|
1971
2038
|
switch (_a.label) {
|
|
1972
2039
|
case 0: return [4 /*yield*/, this.query("SELECT SCHEMA_NAME() AS \"schema_name\"")];
|
|
1973
2040
|
case 1:
|
|
@@ -1978,10 +2045,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1978
2045
|
});
|
|
1979
2046
|
};
|
|
1980
2047
|
SqlServerQueryRunner.prototype.loadViews = function (viewPaths) {
|
|
1981
|
-
return
|
|
2048
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1982
2049
|
var hasTable, currentSchema, currentDatabase, extractTableSchemaAndName, dbNames, viewsCondition, query, dbViews;
|
|
1983
2050
|
var _this = this;
|
|
1984
|
-
return
|
|
2051
|
+
return __generator(this, function (_a) {
|
|
1985
2052
|
switch (_a.label) {
|
|
1986
2053
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
1987
2054
|
case 1:
|
|
@@ -1995,7 +2062,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1995
2062
|
case 3:
|
|
1996
2063
|
currentDatabase = _a.sent();
|
|
1997
2064
|
extractTableSchemaAndName = function (tableName) {
|
|
1998
|
-
var _a =
|
|
2065
|
+
var _a = __read(tableName.split("."), 3), database = _a[0], schema = _a[1], name = _a[2];
|
|
1999
2066
|
// if name is empty, it means that tableName have only schema name and table name or only table name
|
|
2000
2067
|
if (!name) {
|
|
2001
2068
|
// if schema is empty, it means tableName have only name of a table. Otherwise it means that we have "schemaName"."tableName" string.
|
|
@@ -2019,7 +2086,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2019
2086
|
if (this.driver.database && !dbNames.find(function (dbName) { return dbName === _this.driver.database; }))
|
|
2020
2087
|
dbNames.push(this.driver.database);
|
|
2021
2088
|
viewsCondition = viewPaths.map(function (viewPath) {
|
|
2022
|
-
var _a =
|
|
2089
|
+
var _a = __read(extractTableSchemaAndName(viewPath), 2), schema = _a[0], name = _a[1];
|
|
2023
2090
|
return "(\"T\".\"SCHEMA\" = '" + schema + "' AND \"T\".\"NAME\" = '" + name + "')";
|
|
2024
2091
|
}).join(" OR ");
|
|
2025
2092
|
query = dbNames.map(function (dbName) {
|
|
@@ -2045,10 +2112,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2045
2112
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
2046
2113
|
*/
|
|
2047
2114
|
SqlServerQueryRunner.prototype.loadTables = function (tableNames) {
|
|
2048
|
-
return
|
|
2115
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2049
2116
|
var schemaNames, currentSchema, currentDatabase, extractTableSchemaAndName, dbNames, schemaNamesString, tablesCondition, tablesSql, columnsSql, constraintsCondition, constraintsSql, foreignKeysSql, identityColumnsSql, dbCollationsSql, indicesSql, _a, dbTables, dbColumns, dbConstraints, dbForeignKeys, dbIdentityColumns, dbCollations, dbIndices;
|
|
2050
2117
|
var _this = this;
|
|
2051
|
-
return
|
|
2118
|
+
return __generator(this, function (_b) {
|
|
2052
2119
|
switch (_b.label) {
|
|
2053
2120
|
case 0:
|
|
2054
2121
|
// if no tables given then no need to proceed
|
|
@@ -2062,7 +2129,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2062
2129
|
case 2:
|
|
2063
2130
|
currentDatabase = _b.sent();
|
|
2064
2131
|
extractTableSchemaAndName = function (tableName) {
|
|
2065
|
-
var _a =
|
|
2132
|
+
var _a = __read(tableName.split("."), 3), database = _a[0], schema = _a[1], name = _a[2];
|
|
2066
2133
|
// if name is empty, it means that tableName have only schema name and table name or only table name
|
|
2067
2134
|
if (!name) {
|
|
2068
2135
|
// if schema is empty, it means tableName have only name of a table. Otherwise it means that we have "schemaName"."tableName" string.
|
|
@@ -2098,7 +2165,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2098
2165
|
dbNames.push(this.driver.database);
|
|
2099
2166
|
schemaNamesString = schemaNames.map(function (name) { return "'" + name + "'"; }).join(", ");
|
|
2100
2167
|
tablesCondition = tableNames.map(function (tableName) {
|
|
2101
|
-
var _a =
|
|
2168
|
+
var _a = __read(extractTableSchemaAndName(tableName), 2), schema = _a[0], name = _a[1];
|
|
2102
2169
|
return "(\"TABLE_SCHEMA\" = '" + schema + "' AND \"TABLE_NAME\" = '" + name + "')";
|
|
2103
2170
|
}).join(" OR ");
|
|
2104
2171
|
tablesSql = dbNames.map(function (dbName) {
|
|
@@ -2108,7 +2175,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2108
2175
|
return "SELECT * FROM \"" + dbName + "\".\"INFORMATION_SCHEMA\".\"COLUMNS\" WHERE " + tablesCondition;
|
|
2109
2176
|
}).join(" UNION ALL ");
|
|
2110
2177
|
constraintsCondition = tableNames.map(function (tableName) {
|
|
2111
|
-
var _a =
|
|
2178
|
+
var _a = __read(extractTableSchemaAndName(tableName), 2), schema = _a[0], name = _a[1];
|
|
2112
2179
|
return "(\"columnUsages\".\"TABLE_SCHEMA\" = '" + schema + "' AND \"columnUsages\".\"TABLE_NAME\" = '" + name + "' " +
|
|
2113
2180
|
("AND \"tableConstraints\".\"TABLE_SCHEMA\" = '" + schema + "' AND \"tableConstraints\".\"TABLE_NAME\" = '" + name + "')");
|
|
2114
2181
|
}).join(" OR ");
|
|
@@ -2158,14 +2225,14 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2158
2225
|
this.query(indicesSql),
|
|
2159
2226
|
])];
|
|
2160
2227
|
case 3:
|
|
2161
|
-
_a =
|
|
2228
|
+
_a = __read.apply(void 0, [_b.sent(), 7]), dbTables = _a[0], dbColumns = _a[1], dbConstraints = _a[2], dbForeignKeys = _a[3], dbIdentityColumns = _a[4], dbCollations = _a[5], dbIndices = _a[6];
|
|
2162
2229
|
// if tables were not found in the db, no need to proceed
|
|
2163
2230
|
if (!dbTables.length)
|
|
2164
2231
|
return [2 /*return*/, []];
|
|
2165
|
-
return [4 /*yield*/, Promise.all(dbTables.map(function (dbTable) { return
|
|
2232
|
+
return [4 /*yield*/, Promise.all(dbTables.map(function (dbTable) { return __awaiter(_this, void 0, void 0, function () {
|
|
2166
2233
|
var table, db, schema, tableFullName, defaultCollation, tableUniqueConstraints, tableCheckConstraints, tableForeignKeyConstraints, tableIndexConstraints;
|
|
2167
2234
|
var _this = this;
|
|
2168
|
-
return
|
|
2235
|
+
return __generator(this, function (_a) {
|
|
2169
2236
|
table = new Table();
|
|
2170
2237
|
db = dbTable["TABLE_CATALOG"] === currentDatabase ? undefined : dbTable["TABLE_CATALOG"];
|
|
2171
2238
|
schema = dbTable["TABLE_SCHEMA"] === currentSchema && !this.driver.options.schema ? undefined : dbTable["TABLE_SCHEMA"];
|
|
@@ -2176,7 +2243,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2176
2243
|
table.columns = dbColumns
|
|
2177
2244
|
.filter(function (dbColumn) { return _this.driver.buildTableName(dbColumn["TABLE_NAME"], dbColumn["TABLE_SCHEMA"], dbColumn["TABLE_CATALOG"]) === tableFullName; })
|
|
2178
2245
|
.map(function (dbColumn) {
|
|
2179
|
-
var
|
|
2246
|
+
var e_4, _a;
|
|
2180
2247
|
var columnConstraints = dbConstraints.filter(function (dbConstraint) {
|
|
2181
2248
|
return _this.driver.buildTableName(dbConstraint["TABLE_NAME"], dbConstraint["CONSTRAINT_SCHEMA"], dbConstraint["CONSTRAINT_CATALOG"]) === tableFullName
|
|
2182
2249
|
&& dbConstraint["COLUMN_NAME"] === dbColumn["COLUMN_NAME"];
|
|
@@ -2217,7 +2284,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2217
2284
|
if (columnCheckConstraints.length) {
|
|
2218
2285
|
var isEnumRegexp = new RegExp("^\\(\\[" + tableColumn.name + "\\]='[^']+'(?: OR \\[" + tableColumn.name + "\\]='[^']+')*\\)$");
|
|
2219
2286
|
try {
|
|
2220
|
-
for (var columnCheckConstraints_1 =
|
|
2287
|
+
for (var columnCheckConstraints_1 = __values(columnCheckConstraints), columnCheckConstraints_1_1 = columnCheckConstraints_1.next(); !columnCheckConstraints_1_1.done; columnCheckConstraints_1_1 = columnCheckConstraints_1.next()) {
|
|
2221
2288
|
var checkConstraint = columnCheckConstraints_1_1.value;
|
|
2222
2289
|
if (isEnumRegexp.test(checkConstraint["definition"])) {
|
|
2223
2290
|
// This is an enum constraint, make column into an enum
|
|
@@ -2233,12 +2300,12 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2233
2300
|
}
|
|
2234
2301
|
}
|
|
2235
2302
|
}
|
|
2236
|
-
catch (
|
|
2303
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
2237
2304
|
finally {
|
|
2238
2305
|
try {
|
|
2239
2306
|
if (columnCheckConstraints_1_1 && !columnCheckConstraints_1_1.done && (_a = columnCheckConstraints_1.return)) _a.call(columnCheckConstraints_1);
|
|
2240
2307
|
}
|
|
2241
|
-
finally { if (
|
|
2308
|
+
finally { if (e_4) throw e_4.error; }
|
|
2242
2309
|
}
|
|
2243
2310
|
}
|
|
2244
2311
|
}
|
|
@@ -2406,16 +2473,16 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2406
2473
|
}
|
|
2407
2474
|
};
|
|
2408
2475
|
SqlServerQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2409
|
-
return
|
|
2476
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2410
2477
|
var currentSchema, parsedTableName, expression, _a, query, parameters;
|
|
2411
|
-
return
|
|
2478
|
+
return __generator(this, function (_b) {
|
|
2412
2479
|
switch (_b.label) {
|
|
2413
2480
|
case 0: return [4 /*yield*/, this.getCurrentSchema()];
|
|
2414
2481
|
case 1:
|
|
2415
2482
|
currentSchema = _b.sent();
|
|
2416
2483
|
parsedTableName = this.parseTableName(view, currentSchema);
|
|
2417
2484
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2418
|
-
_a =
|
|
2485
|
+
_a = __read(this.connection.createQueryBuilder()
|
|
2419
2486
|
.insert()
|
|
2420
2487
|
.into(this.getTypeormMetadataTableName())
|
|
2421
2488
|
.values({ type: "VIEW", database: parsedTableName.database, schema: parsedTableName.schema, name: parsedTableName.name, value: expression })
|
|
@@ -2435,16 +2502,16 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2435
2502
|
* Builds remove view sql.
|
|
2436
2503
|
*/
|
|
2437
2504
|
SqlServerQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
|
|
2438
|
-
return
|
|
2505
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2439
2506
|
var currentSchema, parsedTableName, qb, _a, query, parameters;
|
|
2440
|
-
return
|
|
2507
|
+
return __generator(this, function (_b) {
|
|
2441
2508
|
switch (_b.label) {
|
|
2442
2509
|
case 0: return [4 /*yield*/, this.getCurrentSchema()];
|
|
2443
2510
|
case 1:
|
|
2444
2511
|
currentSchema = _b.sent();
|
|
2445
2512
|
parsedTableName = this.parseTableName(viewOrPath, currentSchema);
|
|
2446
2513
|
qb = this.connection.createQueryBuilder();
|
|
2447
|
-
_a =
|
|
2514
|
+
_a = __read(qb.delete()
|
|
2448
2515
|
.from(this.getTypeormMetadataTableName())
|
|
2449
2516
|
.where(qb.escape("type") + " = 'VIEW'")
|
|
2450
2517
|
.andWhere(qb.escape("database") + " = :database", { database: parsedTableName.database })
|
|
@@ -2642,7 +2709,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2642
2709
|
case "bigint":
|
|
2643
2710
|
return this.driver.mssql.BigInt;
|
|
2644
2711
|
case "decimal":
|
|
2645
|
-
return (_a = this.driver.mssql).Decimal.apply(_a,
|
|
2712
|
+
return (_a = this.driver.mssql).Decimal.apply(_a, __spread(parameter.params));
|
|
2646
2713
|
case "float":
|
|
2647
2714
|
return this.driver.mssql.Float;
|
|
2648
2715
|
case "int":
|
|
@@ -2650,7 +2717,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2650
2717
|
case "money":
|
|
2651
2718
|
return this.driver.mssql.Money;
|
|
2652
2719
|
case "numeric":
|
|
2653
|
-
return (_b = this.driver.mssql).Numeric.apply(_b,
|
|
2720
|
+
return (_b = this.driver.mssql).Numeric.apply(_b, __spread(parameter.params));
|
|
2654
2721
|
case "smallint":
|
|
2655
2722
|
return this.driver.mssql.SmallInt;
|
|
2656
2723
|
case "smallmoney":
|
|
@@ -2660,29 +2727,29 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2660
2727
|
case "tinyint":
|
|
2661
2728
|
return this.driver.mssql.TinyInt;
|
|
2662
2729
|
case "char":
|
|
2663
|
-
return (_c = this.driver.mssql).Char.apply(_c,
|
|
2730
|
+
return (_c = this.driver.mssql).Char.apply(_c, __spread(parameter.params));
|
|
2664
2731
|
case "nchar":
|
|
2665
|
-
return (_d = this.driver.mssql).NChar.apply(_d,
|
|
2732
|
+
return (_d = this.driver.mssql).NChar.apply(_d, __spread(parameter.params));
|
|
2666
2733
|
case "text":
|
|
2667
2734
|
return this.driver.mssql.Text;
|
|
2668
2735
|
case "ntext":
|
|
2669
2736
|
return this.driver.mssql.Ntext;
|
|
2670
2737
|
case "varchar":
|
|
2671
|
-
return (_e = this.driver.mssql).VarChar.apply(_e,
|
|
2738
|
+
return (_e = this.driver.mssql).VarChar.apply(_e, __spread(parameter.params));
|
|
2672
2739
|
case "nvarchar":
|
|
2673
|
-
return (_f = this.driver.mssql).NVarChar.apply(_f,
|
|
2740
|
+
return (_f = this.driver.mssql).NVarChar.apply(_f, __spread(parameter.params));
|
|
2674
2741
|
case "xml":
|
|
2675
2742
|
return this.driver.mssql.Xml;
|
|
2676
2743
|
case "time":
|
|
2677
|
-
return (_g = this.driver.mssql).Time.apply(_g,
|
|
2744
|
+
return (_g = this.driver.mssql).Time.apply(_g, __spread(parameter.params));
|
|
2678
2745
|
case "date":
|
|
2679
2746
|
return this.driver.mssql.Date;
|
|
2680
2747
|
case "datetime":
|
|
2681
2748
|
return this.driver.mssql.DateTime;
|
|
2682
2749
|
case "datetime2":
|
|
2683
|
-
return (_h = this.driver.mssql).DateTime2.apply(_h,
|
|
2750
|
+
return (_h = this.driver.mssql).DateTime2.apply(_h, __spread(parameter.params));
|
|
2684
2751
|
case "datetimeoffset":
|
|
2685
|
-
return (_j = this.driver.mssql).DateTimeOffset.apply(_j,
|
|
2752
|
+
return (_j = this.driver.mssql).DateTimeOffset.apply(_j, __spread(parameter.params));
|
|
2686
2753
|
case "smalldatetime":
|
|
2687
2754
|
return this.driver.mssql.SmallDateTime;
|
|
2688
2755
|
case "uniqueidentifier":
|
|
@@ -2692,7 +2759,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2692
2759
|
case "binary":
|
|
2693
2760
|
return this.driver.mssql.Binary;
|
|
2694
2761
|
case "varbinary":
|
|
2695
|
-
return (_k = this.driver.mssql).VarBinary.apply(_k,
|
|
2762
|
+
return (_k = this.driver.mssql).VarBinary.apply(_k, __spread(parameter.params));
|
|
2696
2763
|
case "image":
|
|
2697
2764
|
return this.driver.mssql.Image;
|
|
2698
2765
|
case "udt":
|