typeorm 0.2.38 → 0.2.39-dev.d8c5812
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/connection/ConnectionMetadataBuilder.js +4 -4
- package/browser/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/browser/decorator/transaction/Transaction.js +3 -3
- package/browser/decorator/transaction/Transaction.js.map +1 -1
- package/browser/driver/DriverUtils.js +1 -1
- package/browser/driver/DriverUtils.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +2 -2
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachDriver.js +1 -1
- package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +2 -2
- package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.js +2 -2
- package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/browser/driver/oracle/OracleQueryRunner.js +2 -2
- package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresDriver.js +1 -1
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +2 -2
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/sap/SapQueryRunner.js +2 -2
- package/browser/driver/sap/SapQueryRunner.js.map +1 -1
- package/browser/driver/sqlite/SqliteQueryRunner.js +16 -8
- package/browser/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +2 -2
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.js +10 -10
- package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/browser/find-options/FindOptionsUtils.js +1 -1
- package/browser/find-options/FindOptionsUtils.js.map +1 -1
- package/browser/metadata/ColumnMetadata.js +4 -4
- package/browser/metadata/ColumnMetadata.js.map +1 -1
- package/browser/metadata/EmbeddedMetadata.js +1 -1
- package/browser/metadata/EmbeddedMetadata.js.map +1 -1
- package/browser/metadata/EntityMetadata.js +1 -1
- package/browser/metadata/EntityMetadata.js.map +1 -1
- package/browser/metadata/RelationMetadata.js +4 -4
- package/browser/metadata/RelationMetadata.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/browser/naming-strategy/DefaultNamingStrategy.js +5 -5
- package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/browser/persistence/Subject.js +1 -1
- package/browser/persistence/Subject.js.map +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/browser/persistence/SubjectExecutor.js +1 -1
- package/browser/persistence/SubjectExecutor.js.map +1 -1
- package/browser/persistence/SubjectTopoligicalSorter.js +5 -5
- package/browser/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/browser/persistence/tree/ClosureSubjectExecutor.js +4 -4
- package/browser/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
- package/browser/query-builder/InsertQueryBuilder.js +2 -2
- package/browser/query-builder/InsertQueryBuilder.js.map +1 -1
- package/browser/query-builder/QueryBuilder.js +9 -9
- package/browser/query-builder/QueryBuilder.js.map +1 -1
- package/browser/query-builder/RelationLoader.js +2 -2
- package/browser/query-builder/RelationLoader.js.map +1 -1
- package/browser/query-builder/RelationRemover.js +6 -6
- package/browser/query-builder/RelationRemover.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.js +7 -7
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-builder/UpdateQueryBuilder.js +2 -2
- package/browser/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/browser/query-builder/relation-id/RelationIdLoader.js +1 -1
- package/browser/query-builder/relation-id/RelationIdLoader.js.map +1 -1
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js +2 -2
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.js +2 -2
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/query-runner/QueryLock.js +1 -1
- package/browser/query-runner/QueryLock.js.map +1 -1
- package/browser/repository/BaseEntity.js +1 -1
- package/browser/repository/BaseEntity.js.map +1 -1
- package/browser/repository/Repository.js +1 -1
- package/browser/repository/Repository.js.map +1 -1
- package/browser/repository/TreeRepository.js +2 -2
- package/browser/repository/TreeRepository.js.map +1 -1
- package/browser/schema-builder/table/TableCheck.js +1 -1
- package/browser/schema-builder/table/TableCheck.js.map +1 -1
- package/browser/schema-builder/table/TableForeignKey.js +2 -2
- package/browser/schema-builder/table/TableForeignKey.js.map +1 -1
- package/browser/schema-builder/table/TableIndex.js +1 -1
- package/browser/schema-builder/table/TableIndex.js.map +1 -1
- package/browser/schema-builder/table/TableUnique.js +1 -1
- package/browser/schema-builder/table/TableUnique.js.map +1 -1
- package/cache/DbQueryResultCache.js +12 -12
- package/cache/RedisQueryResultCache.js +12 -12
- package/cli.js +1 -6
- package/cli.js.map +1 -1
- package/commands/CacheClearCommand.js +4 -4
- package/commands/CacheClearCommand.js.map +1 -1
- package/commands/CommandUtils.js +10 -10
- package/commands/CommandUtils.js.map +1 -1
- package/commands/EntityCreateCommand.js +3 -3
- package/commands/EntityCreateCommand.js.map +1 -1
- package/commands/InitCommand.js +5 -5
- package/commands/InitCommand.js.map +1 -1
- package/commands/MigrationCreateCommand.js +5 -5
- package/commands/MigrationCreateCommand.js.map +1 -1
- package/commands/MigrationGenerateCommand.js +7 -7
- package/commands/MigrationGenerateCommand.js.map +1 -1
- package/commands/MigrationRevertCommand.js +4 -4
- package/commands/MigrationRevertCommand.js.map +1 -1
- package/commands/MigrationRunCommand.js +5 -5
- package/commands/MigrationRunCommand.js.map +1 -1
- package/commands/MigrationShowCommand.js +5 -5
- package/commands/MigrationShowCommand.js.map +1 -1
- package/commands/QueryCommand.js +4 -4
- package/commands/QueryCommand.js.map +1 -1
- package/commands/SchemaDropCommand.js +4 -4
- package/commands/SchemaDropCommand.js.map +1 -1
- package/commands/SchemaLogCommand.js +5 -5
- package/commands/SchemaLogCommand.js.map +1 -1
- package/commands/SchemaSyncCommand.js +4 -4
- package/commands/SchemaSyncCommand.js.map +1 -1
- package/commands/SubscriberCreateCommand.js +3 -3
- package/commands/SubscriberCreateCommand.js.map +1 -1
- package/commands/VersionCommand.js +3 -3
- package/commands/VersionCommand.js.map +1 -1
- package/connection/Connection.js +19 -19
- package/connection/Connection.js.map +1 -1
- package/connection/ConnectionMetadataBuilder.js +11 -11
- package/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/connection/ConnectionOptionsReader.js +9 -9
- package/connection/ConnectionOptionsReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsEnvReader.js +2 -2
- package/connection/options-reader/ConnectionOptionsXmlReader.js +3 -3
- package/connection/options-reader/ConnectionOptionsXmlReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsYmlReader.js +4 -4
- package/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/decorator/Check.js +1 -1
- package/decorator/Check.js.map +1 -1
- package/decorator/EntityRepository.js +1 -1
- package/decorator/EntityRepository.js.map +1 -1
- package/decorator/Exclusion.js +1 -1
- package/decorator/Exclusion.js.map +1 -1
- package/decorator/Generated.js +1 -1
- package/decorator/Generated.js.map +1 -1
- package/decorator/Index.js +1 -1
- package/decorator/Index.js.map +1 -1
- package/decorator/Unique.js +1 -1
- package/decorator/Unique.js.map +1 -1
- package/decorator/columns/Column.js +4 -4
- package/decorator/columns/Column.js.map +1 -1
- package/decorator/columns/CreateDateColumn.js +1 -1
- package/decorator/columns/CreateDateColumn.js.map +1 -1
- package/decorator/columns/DeleteDateColumn.js +1 -1
- package/decorator/columns/DeleteDateColumn.js.map +1 -1
- package/decorator/columns/ObjectIdColumn.js +1 -1
- package/decorator/columns/ObjectIdColumn.js.map +1 -1
- package/decorator/columns/PrimaryColumn.js +2 -2
- package/decorator/columns/PrimaryColumn.js.map +1 -1
- package/decorator/columns/PrimaryGeneratedColumn.js +2 -2
- package/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/decorator/columns/UpdateDateColumn.js +1 -1
- package/decorator/columns/UpdateDateColumn.js.map +1 -1
- package/decorator/columns/VersionColumn.js +1 -1
- package/decorator/columns/VersionColumn.js.map +1 -1
- package/decorator/columns/ViewColumn.js +1 -1
- package/decorator/columns/ViewColumn.js.map +1 -1
- package/decorator/entity/ChildEntity.js +2 -2
- package/decorator/entity/ChildEntity.js.map +1 -1
- package/decorator/entity/Entity.js +1 -1
- package/decorator/entity/Entity.js.map +1 -1
- package/decorator/entity/TableInheritance.js +1 -1
- package/decorator/entity/TableInheritance.js.map +1 -1
- package/decorator/entity-view/ViewEntity.js +1 -1
- package/decorator/entity-view/ViewEntity.js.map +1 -1
- package/decorator/listeners/AfterInsert.js +1 -1
- package/decorator/listeners/AfterInsert.js.map +1 -1
- package/decorator/listeners/AfterLoad.js +1 -1
- package/decorator/listeners/AfterLoad.js.map +1 -1
- package/decorator/listeners/AfterRemove.js +1 -1
- package/decorator/listeners/AfterRemove.js.map +1 -1
- package/decorator/listeners/AfterUpdate.js +1 -1
- package/decorator/listeners/AfterUpdate.js.map +1 -1
- package/decorator/listeners/BeforeInsert.js +1 -1
- package/decorator/listeners/BeforeInsert.js.map +1 -1
- package/decorator/listeners/BeforeRemove.js +1 -1
- package/decorator/listeners/BeforeRemove.js.map +1 -1
- package/decorator/listeners/BeforeUpdate.js +1 -1
- package/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/decorator/listeners/EventSubscriber.js +1 -1
- package/decorator/listeners/EventSubscriber.js.map +1 -1
- package/decorator/relations/JoinColumn.js +1 -1
- package/decorator/relations/JoinColumn.js.map +1 -1
- package/decorator/relations/JoinTable.js +1 -1
- package/decorator/relations/JoinTable.js.map +1 -1
- package/decorator/relations/ManyToMany.js +1 -1
- package/decorator/relations/ManyToMany.js.map +1 -1
- package/decorator/relations/ManyToOne.js +1 -1
- package/decorator/relations/ManyToOne.js.map +1 -1
- package/decorator/relations/OneToMany.js +1 -1
- package/decorator/relations/OneToMany.js.map +1 -1
- package/decorator/relations/OneToOne.js +1 -1
- package/decorator/relations/OneToOne.js.map +1 -1
- package/decorator/relations/RelationCount.js +1 -1
- package/decorator/relations/RelationCount.js.map +1 -1
- package/decorator/relations/RelationId.js +1 -1
- package/decorator/relations/RelationId.js.map +1 -1
- package/decorator/transaction/Transaction.js +7 -7
- package/decorator/transaction/Transaction.js.map +1 -1
- package/decorator/transaction/TransactionManager.js +1 -1
- package/decorator/transaction/TransactionManager.js.map +1 -1
- package/decorator/transaction/TransactionRepository.js +1 -1
- package/decorator/transaction/TransactionRepository.js.map +1 -1
- package/decorator/tree/Tree.js +1 -1
- package/decorator/tree/Tree.js.map +1 -1
- package/decorator/tree/TreeChildren.js +1 -1
- package/decorator/tree/TreeChildren.js.map +1 -1
- package/decorator/tree/TreeLevelColumn.js +1 -1
- package/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/decorator/tree/TreeParent.js +1 -1
- package/decorator/tree/TreeParent.js.map +1 -1
- package/driver/DriverUtils.js +9 -9
- package/driver/DriverUtils.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiDriver.js +6 -6
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +129 -129
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +8 -8
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +12 -12
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3Driver.js +10 -10
- package/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +5 -5
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/driver/capacitor/CapacitorDriver.js +7 -7
- package/driver/capacitor/CapacitorDriver.js.map +1 -1
- package/driver/capacitor/CapacitorQueryRunner.js +5 -5
- package/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
- package/driver/cockroachdb/CockroachDriver.js +11 -11
- package/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +137 -137
- package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/driver/cordova/CordovaDriver.js +3 -3
- package/driver/cordova/CordovaDriver.js.map +1 -1
- package/driver/cordova/CordovaQueryRunner.js +13 -13
- package/driver/cordova/CordovaQueryRunner.js.map +1 -1
- package/driver/expo/ExpoDriver.js +3 -3
- package/driver/expo/ExpoDriver.js.map +1 -1
- package/driver/expo/ExpoQueryRunner.js +11 -11
- package/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/driver/mongodb/MongoDriver.js +2 -2
- package/driver/mongodb/MongoQueryRunner.js +178 -178
- package/driver/mysql/MysqlDriver.js +5 -5
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.js +130 -130
- package/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/driver/nativescript/NativescriptDriver.js +3 -3
- package/driver/nativescript/NativescriptDriver.js.map +1 -1
- package/driver/nativescript/NativescriptQueryRunner.js +3 -3
- package/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/driver/oracle/OracleDriver.js +8 -8
- package/driver/oracle/OracleQueryRunner.js +125 -125
- package/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/driver/postgres/PostgresDriver.js +19 -19
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.js +150 -150
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/react-native/ReactNativeDriver.js +3 -3
- package/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/driver/react-native/ReactNativeQueryRunner.js +3 -3
- package/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
- package/driver/sap/SapDriver.js +5 -5
- package/driver/sap/SapDriver.js.map +1 -1
- package/driver/sap/SapQueryRunner.js +135 -135
- package/driver/sap/SapQueryRunner.js.map +1 -1
- package/driver/sqlite/SqliteDriver.js +10 -10
- package/driver/sqlite/SqliteDriver.js.map +1 -1
- package/driver/sqlite/SqliteQueryRunner.js +21 -13
- package/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteDriver.js +4 -4
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +121 -121
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqljs/SqljsDriver.js +13 -13
- package/driver/sqljs/SqljsDriver.js.map +1 -1
- package/driver/sqljs/SqljsQueryRunner.js +9 -9
- package/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/driver/sqlserver/SqlServerDriver.js +6 -6
- package/driver/sqlserver/SqlServerQueryRunner.js +152 -152
- package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/entity-manager/EntityManager.js +30 -30
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-manager/MongoEntityManager.js +15 -15
- package/entity-manager/MongoEntityManager.js.map +1 -1
- package/entity-manager/SqljsEntityManager.js +5 -5
- package/entity-manager/SqljsEntityManager.js.map +1 -1
- package/entity-schema/EntitySchemaTransformer.js +1 -1
- package/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/error/AlreadyHasActiveConnectionError.js +1 -1
- package/error/AlreadyHasActiveConnectionError.js.map +1 -1
- package/error/CannotAttachTreeChildrenEntityError.js +1 -1
- package/error/CannotAttachTreeChildrenEntityError.js.map +1 -1
- package/error/CannotConnectAlreadyConnectedError.js +1 -1
- package/error/CannotConnectAlreadyConnectedError.js.map +1 -1
- package/error/CannotCreateEntityIdMapError.js +1 -1
- package/error/CannotCreateEntityIdMapError.js.map +1 -1
- package/error/CannotDetermineEntityError.js +1 -1
- package/error/CannotDetermineEntityError.js.map +1 -1
- package/error/CannotExecuteNotConnectedError.js +1 -1
- package/error/CannotExecuteNotConnectedError.js.map +1 -1
- package/error/CannotGetEntityManagerNotConnectedError.js +1 -1
- package/error/CannotGetEntityManagerNotConnectedError.js.map +1 -1
- package/error/CannotReflectMethodParameterTypeError.js +1 -1
- package/error/CannotReflectMethodParameterTypeError.js.map +1 -1
- package/error/CircularRelationsError.js +1 -1
- package/error/CircularRelationsError.js.map +1 -1
- package/error/ColumnTypeUndefinedError.js +1 -1
- package/error/ColumnTypeUndefinedError.js.map +1 -1
- package/error/ConnectionIsNotSetError.js +1 -1
- package/error/ConnectionIsNotSetError.js.map +1 -1
- package/error/ConnectionNotFoundError.js +1 -1
- package/error/ConnectionNotFoundError.js.map +1 -1
- package/error/CustomRepositoryCannotInheritRepositoryError.js +1 -1
- package/error/CustomRepositoryCannotInheritRepositoryError.js.map +1 -1
- package/error/CustomRepositoryDoesNotHaveEntityError.js +1 -1
- package/error/CustomRepositoryDoesNotHaveEntityError.js.map +1 -1
- package/error/CustomRepositoryNotFoundError.js +1 -1
- package/error/CustomRepositoryNotFoundError.js.map +1 -1
- package/error/DataTypeNotSupportedError.js +1 -1
- package/error/DataTypeNotSupportedError.js.map +1 -1
- package/error/DriverOptionNotSetError.js +1 -1
- package/error/DriverOptionNotSetError.js.map +1 -1
- package/error/DriverPackageNotInstalledError.js +1 -1
- package/error/DriverPackageNotInstalledError.js.map +1 -1
- package/error/EntityColumnNotFound.js +1 -1
- package/error/EntityColumnNotFound.js.map +1 -1
- package/error/EntityMetadataNotFoundError.js +1 -1
- package/error/EntityMetadataNotFoundError.js.map +1 -1
- package/error/EntityNotFoundError.js +1 -1
- package/error/EntityNotFoundError.js.map +1 -1
- package/error/FindRelationsNotFoundError.js +1 -1
- package/error/FindRelationsNotFoundError.js.map +1 -1
- package/error/InitializedRelationError.js +1 -1
- package/error/InitializedRelationError.js.map +1 -1
- package/error/InsertValuesMissingError.js +1 -1
- package/error/InsertValuesMissingError.js.map +1 -1
- package/error/LimitOnUpdateNotSupportedError.js +1 -1
- package/error/LimitOnUpdateNotSupportedError.js.map +1 -1
- package/error/LockNotSupportedOnGivenDriverError.js +1 -1
- package/error/LockNotSupportedOnGivenDriverError.js.map +1 -1
- package/error/MetadataAlreadyExistsError.js +1 -1
- package/error/MetadataAlreadyExistsError.js.map +1 -1
- package/error/MetadataWithSuchNameAlreadyExistsError.js +1 -1
- package/error/MetadataWithSuchNameAlreadyExistsError.js.map +1 -1
- package/error/MissingDeleteDateColumnError.js +1 -1
- package/error/MissingDeleteDateColumnError.js.map +1 -1
- package/error/MissingDriverError.js +1 -1
- package/error/MissingDriverError.js.map +1 -1
- package/error/MissingJoinColumnError.js +1 -1
- package/error/MissingJoinColumnError.js.map +1 -1
- package/error/MissingJoinTableError.js +1 -1
- package/error/MissingJoinTableError.js.map +1 -1
- package/error/MissingPrimaryColumnError.js +1 -1
- package/error/MissingPrimaryColumnError.js.map +1 -1
- package/error/MustBeEntityError.js +1 -1
- package/error/MustBeEntityError.js.map +1 -1
- package/error/NamingStrategyNotFoundError.js +1 -1
- package/error/NamingStrategyNotFoundError.js.map +1 -1
- package/error/NestedSetMultipleRootError.js +1 -1
- package/error/NestedSetMultipleRootError.js.map +1 -1
- package/error/NoConnectionForRepositoryError.js +1 -1
- package/error/NoConnectionForRepositoryError.js.map +1 -1
- package/error/NoConnectionOptionError.js +1 -1
- package/error/NoConnectionOptionError.js.map +1 -1
- package/error/NoNeedToReleaseEntityManagerError.js +1 -1
- package/error/NoNeedToReleaseEntityManagerError.js.map +1 -1
- package/error/NoVersionOrUpdateDateColumnError.js +1 -1
- package/error/NoVersionOrUpdateDateColumnError.js.map +1 -1
- package/error/OffsetWithoutLimitNotSupportedError.js +1 -1
- package/error/OffsetWithoutLimitNotSupportedError.js.map +1 -1
- package/error/OptimisticLockCanNotBeUsedError.js +1 -1
- package/error/OptimisticLockCanNotBeUsedError.js.map +1 -1
- package/error/OptimisticLockVersionMismatchError.js +1 -1
- package/error/OptimisticLockVersionMismatchError.js.map +1 -1
- package/error/PersistedEntityNotFoundError.js +1 -1
- package/error/PersistedEntityNotFoundError.js.map +1 -1
- package/error/PessimisticLockTransactionRequiredError.js +1 -1
- package/error/PessimisticLockTransactionRequiredError.js.map +1 -1
- package/error/PrimaryColumnCannotBeNullableError.js +1 -1
- package/error/PrimaryColumnCannotBeNullableError.js.map +1 -1
- package/error/QueryFailedError.js +3 -3
- package/error/QueryFailedError.js.map +1 -1
- package/error/QueryRunnerAlreadyReleasedError.js +1 -1
- package/error/QueryRunnerAlreadyReleasedError.js.map +1 -1
- package/error/QueryRunnerProviderAlreadyReleasedError.js +1 -1
- package/error/QueryRunnerProviderAlreadyReleasedError.js.map +1 -1
- package/error/RepositoryNotFoundError.js +1 -1
- package/error/RepositoryNotFoundError.js.map +1 -1
- package/error/RepositoryNotTreeError.js +1 -1
- package/error/RepositoryNotTreeError.js.map +1 -1
- package/error/ReturningStatementNotSupportedError.js +1 -1
- package/error/ReturningStatementNotSupportedError.js.map +1 -1
- package/error/SubjectRemovedAndUpdatedError.js +1 -1
- package/error/SubjectRemovedAndUpdatedError.js.map +1 -1
- package/error/SubjectWithoutIdentifierError.js +1 -1
- package/error/SubjectWithoutIdentifierError.js.map +1 -1
- package/error/TransactionAlreadyStartedError.js +1 -1
- package/error/TransactionAlreadyStartedError.js.map +1 -1
- package/error/TransactionNotStartedError.js +1 -1
- package/error/TransactionNotStartedError.js.map +1 -1
- package/error/TreeRepositoryNotSupportedError.js +1 -1
- package/error/TreeRepositoryNotSupportedError.js.map +1 -1
- package/error/TypeORMError.js +1 -1
- package/error/TypeORMError.js.map +1 -1
- package/error/UpdateValuesMissingError.js +1 -1
- package/error/UpdateValuesMissingError.js.map +1 -1
- package/error/UsingJoinColumnIsNotAllowedError.js +1 -1
- package/error/UsingJoinColumnIsNotAllowedError.js.map +1 -1
- package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +1 -1
- package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js.map +1 -1
- package/error/UsingJoinTableIsNotAllowedError.js +1 -1
- package/error/UsingJoinTableIsNotAllowedError.js.map +1 -1
- package/error/UsingJoinTableOnlyOnOneSideAllowedError.js +1 -1
- package/error/UsingJoinTableOnlyOnOneSideAllowedError.js.map +1 -1
- package/error/index.js +62 -62
- package/error/index.js.map +1 -1
- package/find-options/FindOptionsUtils.js +4 -4
- package/find-options/FindOptionsUtils.js.map +1 -1
- package/globals.js +7 -7
- package/globals.js.map +1 -1
- package/index.js +102 -102
- package/index.js.map +1 -1
- package/logger/DebugLogger.js +9 -9
- package/logger/DebugLogger.js.map +1 -1
- package/logger/FileLogger.js +1 -1
- package/logger/FileLogger.js.map +1 -1
- package/metadata/ColumnMetadata.js +4 -4
- package/metadata/ColumnMetadata.js.map +1 -1
- package/metadata/EmbeddedMetadata.js +1 -1
- package/metadata/EmbeddedMetadata.js.map +1 -1
- package/metadata/EntityMetadata.js +2 -2
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/RelationMetadata.js +4 -4
- package/metadata/RelationMetadata.js.map +1 -1
- package/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/migration/MigrationExecutor.js +33 -33
- package/migration/MigrationExecutor.js.map +1 -1
- package/naming-strategy/DefaultNamingStrategy.js +10 -10
- package/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/package.json +1 -239
- package/persistence/EntityPersistExecutor.js +5 -5
- package/persistence/EntityPersistExecutor.js.map +1 -1
- package/persistence/Subject.js +1 -1
- package/persistence/Subject.js.map +1 -1
- package/persistence/SubjectDatabaseEntityLoader.js +6 -6
- package/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/persistence/SubjectExecutor.js +31 -31
- package/persistence/SubjectExecutor.js.map +1 -1
- package/persistence/SubjectTopoligicalSorter.js +5 -5
- package/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/persistence/subject-builder/CascadesSubjectBuilder.js +1 -1
- package/persistence/subject-builder/CascadesSubjectBuilder.js.map +1 -1
- package/persistence/tree/ClosureSubjectExecutor.js +13 -13
- package/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
- package/persistence/tree/MaterializedPathSubjectExecutor.js +5 -5
- package/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/persistence/tree/NestedSetSubjectExecutor.js +14 -14
- package/persistence/tree/NestedSetSubjectExecutor.js.map +1 -1
- package/platform/PlatformTools.js +8 -8
- package/platform/PlatformTools.js.map +1 -1
- package/query-builder/DeleteQueryBuilder.js +4 -4
- package/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/query-builder/InsertQueryBuilder.js +7 -7
- package/query-builder/InsertQueryBuilder.js.map +1 -1
- package/query-builder/JoinAttribute.js +1 -1
- package/query-builder/JoinAttribute.js.map +1 -1
- package/query-builder/QueryBuilder.js +37 -37
- package/query-builder/QueryBuilder.js.map +1 -1
- package/query-builder/QueryBuilderUtils.js +1 -1
- package/query-builder/QueryBuilderUtils.js.map +1 -1
- package/query-builder/QueryExpressionMap.js +3 -3
- package/query-builder/QueryExpressionMap.js.map +1 -1
- package/query-builder/RelationLoader.js +2 -2
- package/query-builder/RelationLoader.js.map +1 -1
- package/query-builder/RelationQueryBuilder.js +13 -13
- package/query-builder/RelationQueryBuilder.js.map +1 -1
- package/query-builder/RelationRemover.js +12 -12
- package/query-builder/RelationRemover.js.map +1 -1
- package/query-builder/RelationUpdater.js +2 -2
- package/query-builder/ReturningResultsEntityUpdator.js +6 -6
- package/query-builder/SelectQueryBuilder.js +36 -36
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-builder/SoftDeleteQueryBuilder.js +4 -4
- package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/query-builder/UpdateQueryBuilder.js +7 -7
- package/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/query-builder/relation-count/RelationCountAttribute.js +2 -2
- package/query-builder/relation-count/RelationCountAttribute.js.map +1 -1
- package/query-builder/relation-count/RelationCountLoader.js +4 -4
- package/query-builder/relation-id/RelationIdAttribute.js +1 -1
- package/query-builder/relation-id/RelationIdAttribute.js.map +1 -1
- package/query-builder/relation-id/RelationIdLoader.js +5 -5
- package/query-builder/relation-id/RelationIdLoader.js.map +1 -1
- package/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +3 -3
- package/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js.map +1 -1
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js +2 -2
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/query-runner/BaseQueryRunner.js +25 -25
- package/query-runner/BaseQueryRunner.js.map +1 -1
- package/query-runner/QueryLock.js +3 -3
- package/query-runner/QueryLock.js.map +1 -1
- package/repository/AbstractRepository.js +1 -1
- package/repository/AbstractRepository.js.map +1 -1
- package/repository/BaseEntity.js +4 -4
- package/repository/BaseEntity.js.map +1 -1
- package/repository/MongoRepository.js +1 -1
- package/repository/MongoRepository.js.map +1 -1
- package/repository/Repository.js +1 -1
- package/repository/Repository.js.map +1 -1
- package/repository/TreeRepository.js +7 -7
- package/repository/TreeRepository.js.map +1 -1
- package/schema-builder/MongoSchemaBuilder.js +2 -2
- package/schema-builder/RdbmsSchemaBuilder.js +95 -95
- package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/schema-builder/table/Table.js +1 -1
- package/schema-builder/table/Table.js.map +1 -1
- package/schema-builder/table/TableCheck.js +1 -1
- package/schema-builder/table/TableCheck.js.map +1 -1
- package/schema-builder/table/TableForeignKey.js +2 -2
- package/schema-builder/table/TableForeignKey.js.map +1 -1
- package/schema-builder/table/TableIndex.js +1 -1
- package/schema-builder/table/TableIndex.js.map +1 -1
- package/schema-builder/table/TableUnique.js +1 -1
- package/schema-builder/table/TableUnique.js.map +1 -1
- package/util/DateUtils.js +1 -1
- package/util/DateUtils.js.map +1 -1
- package/util/DirectoryExportedClassesLoader.js +1 -1
- package/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/util/ObjectUtils.js +2 -2
- package/util/ObjectUtils.js.map +1 -1
- package/util/OrmUtils.js +2 -2
- package/util/OrmUtils.js.map +1 -1
- package/util/StringUtils.js +2 -2
- package/util/StringUtils.js.map +1 -1
|
@@ -26,7 +26,7 @@ var QueryLock_1 = require("../../query-runner/QueryLock");
|
|
|
26
26
|
* Runs queries on a single SQL Server database connection.
|
|
27
27
|
*/
|
|
28
28
|
var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
29
|
-
tslib_1.__extends(SqlServerQueryRunner, _super);
|
|
29
|
+
(0, tslib_1.__extends)(SqlServerQueryRunner, _super);
|
|
30
30
|
// -------------------------------------------------------------------------
|
|
31
31
|
// Constructor
|
|
32
32
|
// -------------------------------------------------------------------------
|
|
@@ -64,10 +64,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
64
64
|
* Starts transaction.
|
|
65
65
|
*/
|
|
66
66
|
SqlServerQueryRunner.prototype.startTransaction = function (isolationLevel) {
|
|
67
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
67
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
68
68
|
var beforeBroadcastResult;
|
|
69
69
|
var _this = this;
|
|
70
|
-
return tslib_1.__generator(this, function (_a) {
|
|
70
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
71
71
|
switch (_a.label) {
|
|
72
72
|
case 0:
|
|
73
73
|
if (this.isReleased)
|
|
@@ -81,10 +81,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
81
81
|
case 1:
|
|
82
82
|
_a.sent();
|
|
83
83
|
_a.label = 2;
|
|
84
|
-
case 2: return [2 /*return*/, new Promise(function (ok, fail) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
84
|
+
case 2: return [2 /*return*/, new Promise(function (ok, fail) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
85
85
|
var pool, transactionCallback, afterBroadcastResult;
|
|
86
86
|
var _this = this;
|
|
87
|
-
return tslib_1.__generator(this, function (_a) {
|
|
87
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
88
88
|
switch (_a.label) {
|
|
89
89
|
case 0:
|
|
90
90
|
this.isTransactionActive = true;
|
|
@@ -129,10 +129,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
129
129
|
* Error will be thrown if transaction was not started.
|
|
130
130
|
*/
|
|
131
131
|
SqlServerQueryRunner.prototype.commitTransaction = function () {
|
|
132
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
132
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
133
133
|
var beforeBroadcastResult;
|
|
134
134
|
var _this = this;
|
|
135
|
-
return tslib_1.__generator(this, function (_a) {
|
|
135
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
136
136
|
switch (_a.label) {
|
|
137
137
|
case 0:
|
|
138
138
|
if (this.isReleased)
|
|
@@ -147,9 +147,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
147
147
|
_a.sent();
|
|
148
148
|
_a.label = 2;
|
|
149
149
|
case 2: return [2 /*return*/, new Promise(function (ok, fail) {
|
|
150
|
-
_this.databaseConnection.commit(function (err) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
150
|
+
_this.databaseConnection.commit(function (err) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
151
151
|
var afterBroadcastResult;
|
|
152
|
-
return tslib_1.__generator(this, function (_a) {
|
|
152
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
153
153
|
switch (_a.label) {
|
|
154
154
|
case 0:
|
|
155
155
|
if (err)
|
|
@@ -180,10 +180,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
180
180
|
* Error will be thrown if transaction was not started.
|
|
181
181
|
*/
|
|
182
182
|
SqlServerQueryRunner.prototype.rollbackTransaction = function () {
|
|
183
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
183
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
184
184
|
var beforeBroadcastResult;
|
|
185
185
|
var _this = this;
|
|
186
|
-
return tslib_1.__generator(this, function (_a) {
|
|
186
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
187
187
|
switch (_a.label) {
|
|
188
188
|
case 0:
|
|
189
189
|
if (this.isReleased)
|
|
@@ -198,9 +198,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
198
198
|
_a.sent();
|
|
199
199
|
_a.label = 2;
|
|
200
200
|
case 2: return [2 /*return*/, new Promise(function (ok, fail) {
|
|
201
|
-
_this.databaseConnection.rollback(function (err) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
201
|
+
_this.databaseConnection.rollback(function (err) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
202
202
|
var afterBroadcastResult;
|
|
203
|
-
return tslib_1.__generator(this, function (_a) {
|
|
203
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
204
204
|
switch (_a.label) {
|
|
205
205
|
case 0:
|
|
206
206
|
if (err)
|
|
@@ -231,10 +231,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
231
231
|
*/
|
|
232
232
|
SqlServerQueryRunner.prototype.query = function (query, parameters, useStructuredResult) {
|
|
233
233
|
if (useStructuredResult === void 0) { useStructuredResult = false; }
|
|
234
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
234
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
235
235
|
var release, pool, request_1, queryStartTime_1, raw, result, queryType, err_1;
|
|
236
236
|
var _this = this;
|
|
237
|
-
return tslib_1.__generator(this, function (_a) {
|
|
237
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
238
238
|
switch (_a.label) {
|
|
239
239
|
case 0:
|
|
240
240
|
if (this.isReleased)
|
|
@@ -324,10 +324,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
324
324
|
* Returns raw data stream.
|
|
325
325
|
*/
|
|
326
326
|
SqlServerQueryRunner.prototype.stream = function (query, parameters, onEnd, onError) {
|
|
327
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
327
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
328
328
|
var release, pool, request, PassThrough;
|
|
329
329
|
var _this = this;
|
|
330
|
-
return tslib_1.__generator(this, function (_a) {
|
|
330
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
331
331
|
switch (_a.label) {
|
|
332
332
|
case 0:
|
|
333
333
|
if (this.isReleased)
|
|
@@ -377,9 +377,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
377
377
|
* Returns all available database names including system databases.
|
|
378
378
|
*/
|
|
379
379
|
SqlServerQueryRunner.prototype.getDatabases = function () {
|
|
380
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
380
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
381
381
|
var results;
|
|
382
|
-
return tslib_1.__generator(this, function (_a) {
|
|
382
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
383
383
|
switch (_a.label) {
|
|
384
384
|
case 0: return [4 /*yield*/, this.query("EXEC sp_databases")];
|
|
385
385
|
case 1:
|
|
@@ -394,9 +394,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
394
394
|
* If database parameter specified, returns schemas of that database.
|
|
395
395
|
*/
|
|
396
396
|
SqlServerQueryRunner.prototype.getSchemas = function (database) {
|
|
397
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
397
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
398
398
|
var query, results;
|
|
399
|
-
return tslib_1.__generator(this, function (_a) {
|
|
399
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
400
400
|
switch (_a.label) {
|
|
401
401
|
case 0:
|
|
402
402
|
query = database ? "SELECT * FROM \"" + database + "\".\"sys\".\"schema\"" : "SELECT * FROM \"sys\".\"schemas\"";
|
|
@@ -412,9 +412,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
412
412
|
* Checks if database with the given name exist.
|
|
413
413
|
*/
|
|
414
414
|
SqlServerQueryRunner.prototype.hasDatabase = function (database) {
|
|
415
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
415
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
416
416
|
var result, dbId;
|
|
417
|
-
return tslib_1.__generator(this, function (_a) {
|
|
417
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
418
418
|
switch (_a.label) {
|
|
419
419
|
case 0: return [4 /*yield*/, this.query("SELECT DB_ID('" + database + "') as \"db_id\"")];
|
|
420
420
|
case 1:
|
|
@@ -429,9 +429,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
429
429
|
* Loads currently using database
|
|
430
430
|
*/
|
|
431
431
|
SqlServerQueryRunner.prototype.getCurrentDatabase = function () {
|
|
432
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
432
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
433
433
|
var currentDBQuery;
|
|
434
|
-
return tslib_1.__generator(this, function (_a) {
|
|
434
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
435
435
|
switch (_a.label) {
|
|
436
436
|
case 0: return [4 /*yield*/, this.query("SELECT DB_NAME() AS \"db_name\"")];
|
|
437
437
|
case 1:
|
|
@@ -445,9 +445,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
445
445
|
* Checks if schema with the given name exist.
|
|
446
446
|
*/
|
|
447
447
|
SqlServerQueryRunner.prototype.hasSchema = function (schema) {
|
|
448
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
448
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
449
449
|
var result, schemaId;
|
|
450
|
-
return tslib_1.__generator(this, function (_a) {
|
|
450
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
451
451
|
switch (_a.label) {
|
|
452
452
|
case 0: return [4 /*yield*/, this.query("SELECT SCHEMA_ID('" + schema + "') as \"schema_id\"")];
|
|
453
453
|
case 1:
|
|
@@ -462,9 +462,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
462
462
|
* Loads currently using database schema
|
|
463
463
|
*/
|
|
464
464
|
SqlServerQueryRunner.prototype.getCurrentSchema = function () {
|
|
465
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
465
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
466
466
|
var currentSchemaQuery;
|
|
467
|
-
return tslib_1.__generator(this, function (_a) {
|
|
467
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
468
468
|
switch (_a.label) {
|
|
469
469
|
case 0: return [4 /*yield*/, this.query("SELECT SCHEMA_NAME() AS \"schema_name\"")];
|
|
470
470
|
case 1:
|
|
@@ -478,9 +478,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
478
478
|
* Checks if table with the given name exist in the database.
|
|
479
479
|
*/
|
|
480
480
|
SqlServerQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
481
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
481
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
482
482
|
var parsedTableName, _a, _b, sql, result;
|
|
483
|
-
return tslib_1.__generator(this, function (_c) {
|
|
483
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
484
484
|
switch (_c.label) {
|
|
485
485
|
case 0:
|
|
486
486
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -511,9 +511,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
511
511
|
* Checks if column exist in the table.
|
|
512
512
|
*/
|
|
513
513
|
SqlServerQueryRunner.prototype.hasColumn = function (tableOrName, columnName) {
|
|
514
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
514
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
515
515
|
var parsedTableName, _a, _b, sql, result;
|
|
516
|
-
return tslib_1.__generator(this, function (_c) {
|
|
516
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
517
517
|
switch (_c.label) {
|
|
518
518
|
case 0:
|
|
519
519
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -544,9 +544,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
544
544
|
* Creates a new database.
|
|
545
545
|
*/
|
|
546
546
|
SqlServerQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
547
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
547
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
548
548
|
var up, down;
|
|
549
|
-
return tslib_1.__generator(this, function (_a) {
|
|
549
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
550
550
|
switch (_a.label) {
|
|
551
551
|
case 0:
|
|
552
552
|
up = ifNotExist ? "IF DB_ID('" + database + "') IS NULL CREATE DATABASE \"" + database + "\"" : "CREATE DATABASE \"" + database + "\"";
|
|
@@ -563,9 +563,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
563
563
|
* Drops database.
|
|
564
564
|
*/
|
|
565
565
|
SqlServerQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
566
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
566
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
567
567
|
var up, down;
|
|
568
|
-
return tslib_1.__generator(this, function (_a) {
|
|
568
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
569
569
|
switch (_a.label) {
|
|
570
570
|
case 0:
|
|
571
571
|
up = ifExist ? "IF DB_ID('" + database + "') IS NOT NULL DROP DATABASE \"" + database + "\"" : "DROP DATABASE \"" + database + "\"";
|
|
@@ -583,9 +583,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
583
583
|
* If database name also specified (e.g. 'dbName.schemaName') schema will be created in specified database.
|
|
584
584
|
*/
|
|
585
585
|
SqlServerQueryRunner.prototype.createSchema = function (schemaPath, ifNotExist) {
|
|
586
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
586
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
587
587
|
var upQueries, downQueries, upQuery, dbName, schema, currentDB, upQuery;
|
|
588
|
-
return tslib_1.__generator(this, function (_a) {
|
|
588
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
589
589
|
switch (_a.label) {
|
|
590
590
|
case 0:
|
|
591
591
|
upQueries = [];
|
|
@@ -622,9 +622,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
622
622
|
* If database name also specified (e.g. 'dbName.schemaName') schema will be dropped in specified database.
|
|
623
623
|
*/
|
|
624
624
|
SqlServerQueryRunner.prototype.dropSchema = function (schemaPath, ifExist) {
|
|
625
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
625
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
626
626
|
var upQueries, downQueries, upQuery, dbName, schema, currentDB, upQuery;
|
|
627
|
-
return tslib_1.__generator(this, function (_a) {
|
|
627
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
628
628
|
switch (_a.label) {
|
|
629
629
|
case 0:
|
|
630
630
|
upQueries = [];
|
|
@@ -663,10 +663,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
663
663
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
664
664
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
665
665
|
if (createIndices === void 0) { createIndices = true; }
|
|
666
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
666
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
667
667
|
var isTableExist, upQueries, downQueries;
|
|
668
668
|
var _this = this;
|
|
669
|
-
return tslib_1.__generator(this, function (_a) {
|
|
669
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
670
670
|
switch (_a.label) {
|
|
671
671
|
case 0:
|
|
672
672
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -708,10 +708,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
708
708
|
SqlServerQueryRunner.prototype.dropTable = function (tableOrName, ifExist, dropForeignKeys, dropIndices) {
|
|
709
709
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
710
710
|
if (dropIndices === void 0) { dropIndices = true; }
|
|
711
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
711
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
712
712
|
var isTableExist, createForeignKeys, table, _a, upQueries, downQueries;
|
|
713
713
|
var _this = this;
|
|
714
|
-
return tslib_1.__generator(this, function (_b) {
|
|
714
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
715
715
|
switch (_b.label) {
|
|
716
716
|
case 0:
|
|
717
717
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -760,9 +760,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
760
760
|
* Creates a new view.
|
|
761
761
|
*/
|
|
762
762
|
SqlServerQueryRunner.prototype.createView = function (view) {
|
|
763
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
763
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
764
764
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
765
|
-
return tslib_1.__generator(this, function (_e) {
|
|
765
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
766
766
|
switch (_e.label) {
|
|
767
767
|
case 0:
|
|
768
768
|
upQueries = [];
|
|
@@ -789,9 +789,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
789
789
|
* Drops the view.
|
|
790
790
|
*/
|
|
791
791
|
SqlServerQueryRunner.prototype.dropView = function (target) {
|
|
792
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
792
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
793
793
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
794
|
-
return tslib_1.__generator(this, function (_e) {
|
|
794
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
795
795
|
switch (_e.label) {
|
|
796
796
|
case 0:
|
|
797
797
|
viewName = target instanceof View_1.View ? target.name : target;
|
|
@@ -822,10 +822,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
822
822
|
* Renames a table.
|
|
823
823
|
*/
|
|
824
824
|
SqlServerQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
825
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
825
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
826
826
|
var upQueries, downQueries, oldTable, _a, newTable, dbName, schemaName, oldTableName, splittedName, currentDB, columnNames, oldPkName, newPkName;
|
|
827
827
|
var _this = this;
|
|
828
|
-
return tslib_1.__generator(this, function (_b) {
|
|
828
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
829
829
|
switch (_b.label) {
|
|
830
830
|
case 0:
|
|
831
831
|
upQueries = [];
|
|
@@ -924,9 +924,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
924
924
|
* Creates a new column from the column in the table.
|
|
925
925
|
*/
|
|
926
926
|
SqlServerQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
927
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
927
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
928
928
|
var table, _a, clonedTable, upQueries, downQueries, primaryColumns, pkName_1, columnNames_1, pkName, columnNames, columnIndex, uniqueConstraint, defaultName;
|
|
929
|
-
return tslib_1.__generator(this, function (_b) {
|
|
929
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
930
930
|
switch (_b.label) {
|
|
931
931
|
case 0:
|
|
932
932
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -993,14 +993,14 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
993
993
|
* Creates a new columns from the column in the table.
|
|
994
994
|
*/
|
|
995
995
|
SqlServerQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
996
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
996
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
997
997
|
var columns_1, columns_1_1, column, e_1_1;
|
|
998
998
|
var e_1, _a;
|
|
999
|
-
return tslib_1.__generator(this, function (_b) {
|
|
999
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1000
1000
|
switch (_b.label) {
|
|
1001
1001
|
case 0:
|
|
1002
1002
|
_b.trys.push([0, 5, 6, 7]);
|
|
1003
|
-
columns_1 = tslib_1.__values(columns), columns_1_1 = columns_1.next();
|
|
1003
|
+
columns_1 = (0, tslib_1.__values)(columns), columns_1_1 = columns_1.next();
|
|
1004
1004
|
_b.label = 1;
|
|
1005
1005
|
case 1:
|
|
1006
1006
|
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1032,9 +1032,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1032
1032
|
* Renames column in the given table.
|
|
1033
1033
|
*/
|
|
1034
1034
|
SqlServerQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
1035
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1035
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1036
1036
|
var table, _a, oldColumn, newColumn;
|
|
1037
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1037
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1038
1038
|
switch (_b.label) {
|
|
1039
1039
|
case 0:
|
|
1040
1040
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1069,10 +1069,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1069
1069
|
* Changes a column in the table.
|
|
1070
1070
|
*/
|
|
1071
1071
|
SqlServerQueryRunner.prototype.changeColumn = function (tableOrName, oldTableColumnOrName, newColumn) {
|
|
1072
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1072
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1073
1073
|
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;
|
|
1074
1074
|
var _this = this;
|
|
1075
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1075
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1076
1076
|
switch (_b.label) {
|
|
1077
1077
|
case 0:
|
|
1078
1078
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1290,14 +1290,14 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1290
1290
|
* Changes a column in the table.
|
|
1291
1291
|
*/
|
|
1292
1292
|
SqlServerQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
1293
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1293
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1294
1294
|
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_2_1;
|
|
1295
1295
|
var e_2, _b;
|
|
1296
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1296
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1297
1297
|
switch (_c.label) {
|
|
1298
1298
|
case 0:
|
|
1299
1299
|
_c.trys.push([0, 5, 6, 7]);
|
|
1300
|
-
changedColumns_1 = tslib_1.__values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1300
|
+
changedColumns_1 = (0, tslib_1.__values)(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1301
1301
|
_c.label = 1;
|
|
1302
1302
|
case 1:
|
|
1303
1303
|
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1329,9 +1329,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1329
1329
|
* Drops column in the table.
|
|
1330
1330
|
*/
|
|
1331
1331
|
SqlServerQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1332
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1332
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1333
1333
|
var table, _a, column, clonedTable, upQueries, downQueries, pkName, columnNames, tableColumn, pkName_2, columnNames_2, columnIndex, columnCheck, columnUnique, defaultName;
|
|
1334
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1334
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1335
1335
|
switch (_b.label) {
|
|
1336
1336
|
case 0:
|
|
1337
1337
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1405,14 +1405,14 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1405
1405
|
* Drops the columns in the table.
|
|
1406
1406
|
*/
|
|
1407
1407
|
SqlServerQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1408
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1408
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1409
1409
|
var columns_2, columns_2_1, column, e_3_1;
|
|
1410
1410
|
var e_3, _a;
|
|
1411
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1411
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1412
1412
|
switch (_b.label) {
|
|
1413
1413
|
case 0:
|
|
1414
1414
|
_b.trys.push([0, 5, 6, 7]);
|
|
1415
|
-
columns_2 = tslib_1.__values(columns), columns_2_1 = columns_2.next();
|
|
1415
|
+
columns_2 = (0, tslib_1.__values)(columns), columns_2_1 = columns_2.next();
|
|
1416
1416
|
_b.label = 1;
|
|
1417
1417
|
case 1:
|
|
1418
1418
|
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1444,9 +1444,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1444
1444
|
* Creates a new primary key.
|
|
1445
1445
|
*/
|
|
1446
1446
|
SqlServerQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1447
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1447
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1448
1448
|
var table, _a, clonedTable, up, down;
|
|
1449
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1449
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1450
1450
|
switch (_b.label) {
|
|
1451
1451
|
case 0:
|
|
1452
1452
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1479,9 +1479,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1479
1479
|
* Updates composite primary keys.
|
|
1480
1480
|
*/
|
|
1481
1481
|
SqlServerQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1482
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1482
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1483
1483
|
var table, _a, clonedTable, columnNames, upQueries, downQueries, primaryColumns, pkName_3, columnNamesString_1, pkName, columnNamesString;
|
|
1484
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1484
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1485
1485
|
switch (_b.label) {
|
|
1486
1486
|
case 0:
|
|
1487
1487
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1525,9 +1525,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1525
1525
|
* Drops a primary key.
|
|
1526
1526
|
*/
|
|
1527
1527
|
SqlServerQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1528
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1528
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1529
1529
|
var table, _a, up, down;
|
|
1530
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1530
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1531
1531
|
switch (_b.label) {
|
|
1532
1532
|
case 0:
|
|
1533
1533
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1556,9 +1556,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1556
1556
|
* Creates a new unique constraint.
|
|
1557
1557
|
*/
|
|
1558
1558
|
SqlServerQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1559
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1559
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1560
1560
|
var table, _a, up, down;
|
|
1561
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1561
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1562
1562
|
switch (_b.label) {
|
|
1563
1563
|
case 0:
|
|
1564
1564
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1588,10 +1588,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1588
1588
|
* Creates a new unique constraints.
|
|
1589
1589
|
*/
|
|
1590
1590
|
SqlServerQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1591
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1591
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1592
1592
|
var promises;
|
|
1593
1593
|
var _this = this;
|
|
1594
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1594
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1595
1595
|
switch (_a.label) {
|
|
1596
1596
|
case 0:
|
|
1597
1597
|
promises = uniqueConstraints.map(function (uniqueConstraint) { return _this.createUniqueConstraint(tableOrName, uniqueConstraint); });
|
|
@@ -1607,9 +1607,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1607
1607
|
* Drops unique constraint.
|
|
1608
1608
|
*/
|
|
1609
1609
|
SqlServerQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1610
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1610
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1611
1611
|
var table, _a, uniqueConstraint, up, down;
|
|
1612
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1612
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1613
1613
|
switch (_b.label) {
|
|
1614
1614
|
case 0:
|
|
1615
1615
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1639,10 +1639,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1639
1639
|
* Drops an unique constraints.
|
|
1640
1640
|
*/
|
|
1641
1641
|
SqlServerQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1642
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1642
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1643
1643
|
var promises;
|
|
1644
1644
|
var _this = this;
|
|
1645
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1645
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1646
1646
|
switch (_a.label) {
|
|
1647
1647
|
case 0:
|
|
1648
1648
|
promises = uniqueConstraints.map(function (uniqueConstraint) { return _this.dropUniqueConstraint(tableOrName, uniqueConstraint); });
|
|
@@ -1658,9 +1658,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1658
1658
|
* Creates a new check constraint.
|
|
1659
1659
|
*/
|
|
1660
1660
|
SqlServerQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1661
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1661
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1662
1662
|
var table, _a, up, down;
|
|
1663
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1663
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1664
1664
|
switch (_b.label) {
|
|
1665
1665
|
case 0:
|
|
1666
1666
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1690,10 +1690,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1690
1690
|
* Creates a new check constraints.
|
|
1691
1691
|
*/
|
|
1692
1692
|
SqlServerQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1693
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1693
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1694
1694
|
var promises;
|
|
1695
1695
|
var _this = this;
|
|
1696
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1696
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1697
1697
|
switch (_a.label) {
|
|
1698
1698
|
case 0:
|
|
1699
1699
|
promises = checkConstraints.map(function (checkConstraint) { return _this.createCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1709,9 +1709,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1709
1709
|
* Drops check constraint.
|
|
1710
1710
|
*/
|
|
1711
1711
|
SqlServerQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1712
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1712
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1713
1713
|
var table, _a, checkConstraint, up, down;
|
|
1714
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1714
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1715
1715
|
switch (_b.label) {
|
|
1716
1716
|
case 0:
|
|
1717
1717
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1741,10 +1741,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1741
1741
|
* Drops check constraints.
|
|
1742
1742
|
*/
|
|
1743
1743
|
SqlServerQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1744
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1744
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1745
1745
|
var promises;
|
|
1746
1746
|
var _this = this;
|
|
1747
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1747
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1748
1748
|
switch (_a.label) {
|
|
1749
1749
|
case 0:
|
|
1750
1750
|
promises = checkConstraints.map(function (checkConstraint) { return _this.dropCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1760,8 +1760,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1760
1760
|
* Creates a new exclusion constraint.
|
|
1761
1761
|
*/
|
|
1762
1762
|
SqlServerQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1763
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1764
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1763
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1764
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1765
1765
|
throw new error_1.TypeORMError("SqlServer does not support exclusion constraints.");
|
|
1766
1766
|
});
|
|
1767
1767
|
});
|
|
@@ -1770,8 +1770,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1770
1770
|
* Creates a new exclusion constraints.
|
|
1771
1771
|
*/
|
|
1772
1772
|
SqlServerQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1773
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1774
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1773
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1774
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1775
1775
|
throw new error_1.TypeORMError("SqlServer does not support exclusion constraints.");
|
|
1776
1776
|
});
|
|
1777
1777
|
});
|
|
@@ -1780,8 +1780,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1780
1780
|
* Drops exclusion constraint.
|
|
1781
1781
|
*/
|
|
1782
1782
|
SqlServerQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1783
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1784
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1783
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1784
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1785
1785
|
throw new error_1.TypeORMError("SqlServer does not support exclusion constraints.");
|
|
1786
1786
|
});
|
|
1787
1787
|
});
|
|
@@ -1790,8 +1790,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1790
1790
|
* Drops exclusion constraints.
|
|
1791
1791
|
*/
|
|
1792
1792
|
SqlServerQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1793
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1794
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1793
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1794
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1795
1795
|
throw new error_1.TypeORMError("SqlServer does not support exclusion constraints.");
|
|
1796
1796
|
});
|
|
1797
1797
|
});
|
|
@@ -1800,9 +1800,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1800
1800
|
* Creates a new foreign key.
|
|
1801
1801
|
*/
|
|
1802
1802
|
SqlServerQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1803
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1803
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1804
1804
|
var table, _a, metadata, up, down;
|
|
1805
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1805
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1806
1806
|
switch (_b.label) {
|
|
1807
1807
|
case 0:
|
|
1808
1808
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1835,10 +1835,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1835
1835
|
* Creates a new foreign keys.
|
|
1836
1836
|
*/
|
|
1837
1837
|
SqlServerQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1838
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1838
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1839
1839
|
var promises;
|
|
1840
1840
|
var _this = this;
|
|
1841
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1841
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1842
1842
|
switch (_a.label) {
|
|
1843
1843
|
case 0:
|
|
1844
1844
|
promises = foreignKeys.map(function (foreignKey) { return _this.createForeignKey(tableOrName, foreignKey); });
|
|
@@ -1854,9 +1854,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1854
1854
|
* Drops a foreign key from the table.
|
|
1855
1855
|
*/
|
|
1856
1856
|
SqlServerQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1857
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1857
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1858
1858
|
var table, _a, foreignKey, up, down;
|
|
1859
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1859
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1860
1860
|
switch (_b.label) {
|
|
1861
1861
|
case 0:
|
|
1862
1862
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1886,10 +1886,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1886
1886
|
* Drops a foreign keys from the table.
|
|
1887
1887
|
*/
|
|
1888
1888
|
SqlServerQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1889
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1889
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1890
1890
|
var promises;
|
|
1891
1891
|
var _this = this;
|
|
1892
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1892
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1893
1893
|
switch (_a.label) {
|
|
1894
1894
|
case 0:
|
|
1895
1895
|
promises = foreignKeys.map(function (foreignKey) { return _this.dropForeignKey(tableOrName, foreignKey); });
|
|
@@ -1905,9 +1905,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1905
1905
|
* Creates a new index.
|
|
1906
1906
|
*/
|
|
1907
1907
|
SqlServerQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
1908
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1908
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1909
1909
|
var table, _a, up, down;
|
|
1910
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1910
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1911
1911
|
switch (_b.label) {
|
|
1912
1912
|
case 0:
|
|
1913
1913
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1937,10 +1937,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1937
1937
|
* Creates a new indices
|
|
1938
1938
|
*/
|
|
1939
1939
|
SqlServerQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
1940
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1940
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1941
1941
|
var promises;
|
|
1942
1942
|
var _this = this;
|
|
1943
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1943
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1944
1944
|
switch (_a.label) {
|
|
1945
1945
|
case 0:
|
|
1946
1946
|
promises = indices.map(function (index) { return _this.createIndex(tableOrName, index); });
|
|
@@ -1956,9 +1956,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1956
1956
|
* Drops an index.
|
|
1957
1957
|
*/
|
|
1958
1958
|
SqlServerQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
1959
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1959
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1960
1960
|
var table, _a, index, up, down;
|
|
1961
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1961
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1962
1962
|
switch (_b.label) {
|
|
1963
1963
|
case 0:
|
|
1964
1964
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1988,10 +1988,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
1988
1988
|
* Drops an indices from the table.
|
|
1989
1989
|
*/
|
|
1990
1990
|
SqlServerQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
1991
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1991
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1992
1992
|
var promises;
|
|
1993
1993
|
var _this = this;
|
|
1994
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1994
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1995
1995
|
switch (_a.label) {
|
|
1996
1996
|
case 0:
|
|
1997
1997
|
promises = indices.map(function (index) { return _this.dropIndex(tableOrName, index); });
|
|
@@ -2008,8 +2008,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2008
2008
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
2009
2009
|
*/
|
|
2010
2010
|
SqlServerQueryRunner.prototype.clearTable = function (tablePath) {
|
|
2011
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2012
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2011
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2012
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2013
2013
|
switch (_a.label) {
|
|
2014
2014
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tablePath))];
|
|
2015
2015
|
case 1:
|
|
@@ -2023,10 +2023,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2023
2023
|
* Removes all tables from the currently connected database.
|
|
2024
2024
|
*/
|
|
2025
2025
|
SqlServerQueryRunner.prototype.clearDatabase = function (database) {
|
|
2026
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2026
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2027
2027
|
var isDatabaseExist, allViewsSql, allViewsResults, allTablesSql, allTablesResults, tablesByCatalog, foreignKeysSql, foreignKeys, error_2, rollbackError_1;
|
|
2028
2028
|
var _this = this;
|
|
2029
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2029
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2030
2030
|
switch (_a.label) {
|
|
2031
2031
|
case 0:
|
|
2032
2032
|
if (!database) return [3 /*break*/, 2];
|
|
@@ -2069,7 +2069,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2069
2069
|
return c;
|
|
2070
2070
|
}, {});
|
|
2071
2071
|
foreignKeysSql = Object.entries(tablesByCatalog).map(function (_a) {
|
|
2072
|
-
var _b = tslib_1.__read(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2072
|
+
var _b = (0, tslib_1.__read)(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2073
2073
|
var conditions = tables.map(function (_a) {
|
|
2074
2074
|
var TABLE_SCHEMA = _a.TABLE_SCHEMA, TABLE_NAME = _a.TABLE_NAME;
|
|
2075
2075
|
return "(\"fk\".\"referenced_object_id\" = OBJECT_ID('\"" + TABLE_CATALOG + "\".\"" + TABLE_SCHEMA + "\".\"" + TABLE_NAME + "\"'))";
|
|
@@ -2081,8 +2081,8 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2081
2081
|
foreignKeys = _a.sent();
|
|
2082
2082
|
return [4 /*yield*/, Promise.all(foreignKeys.map(function (_a) {
|
|
2083
2083
|
var TABLE_CATALOG = _a.TABLE_CATALOG, TABLE_SCHEMA = _a.TABLE_SCHEMA, TABLE_NAME = _a.TABLE_NAME, CONSTRAINT_NAME = _a.CONSTRAINT_NAME;
|
|
2084
|
-
return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
2085
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2084
|
+
return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2085
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2086
2086
|
switch (_b.label) {
|
|
2087
2087
|
case 0:
|
|
2088
2088
|
// Disable the constraint first.
|
|
@@ -2139,10 +2139,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2139
2139
|
// Protected Methods
|
|
2140
2140
|
// -------------------------------------------------------------------------
|
|
2141
2141
|
SqlServerQueryRunner.prototype.loadViews = function (viewPaths) {
|
|
2142
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2142
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2143
2143
|
var hasTable, currentSchema, currentDatabase, dbNames, viewsCondition, query, dbViews;
|
|
2144
2144
|
var _this = this;
|
|
2145
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2145
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2146
2146
|
switch (_a.label) {
|
|
2147
2147
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
2148
2148
|
case 1:
|
|
@@ -2196,10 +2196,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2196
2196
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
2197
2197
|
*/
|
|
2198
2198
|
SqlServerQueryRunner.prototype.loadTables = function (tableNames) {
|
|
2199
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2199
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2200
2200
|
var currentSchema, currentDatabase, dbTables, databasesSql, dbDatabases, tablesSql, _a, _b, _c, _d, tableNamesByCatalog, tablesSql, _e, _f, _g, _h, dbTablesByCatalog, columnsSql, constraintsSql, foreignKeysSql, identityColumnsSql, dbCollationsSql, indicesSql, _j, dbColumns, dbConstraints, dbForeignKeys, dbIdentityColumns, dbCollations, dbIndices;
|
|
2201
2201
|
var _this = this;
|
|
2202
|
-
return tslib_1.__generator(this, function (_k) {
|
|
2202
|
+
return (0, tslib_1.__generator)(this, function (_k) {
|
|
2203
2203
|
switch (_k.label) {
|
|
2204
2204
|
case 0:
|
|
2205
2205
|
// if no tables given then no need to proceed
|
|
@@ -2227,13 +2227,13 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2227
2227
|
_d = [[]];
|
|
2228
2228
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2229
2229
|
case 4:
|
|
2230
|
-
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2230
|
+
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2231
2231
|
return [3 /*break*/, 7];
|
|
2232
2232
|
case 5:
|
|
2233
2233
|
tableNamesByCatalog = tableNames
|
|
2234
2234
|
.map(function (tableName) { return _this.driver.parseTableName(tableName); })
|
|
2235
2235
|
.reduce(function (c, _a) {
|
|
2236
|
-
var database = _a.database, other = tslib_1.__rest(_a, ["database"]);
|
|
2236
|
+
var database = _a.database, other = (0, tslib_1.__rest)(_a, ["database"]);
|
|
2237
2237
|
database = database || currentDatabase;
|
|
2238
2238
|
c[database] = c[database] || [];
|
|
2239
2239
|
c[database].push({
|
|
@@ -2243,7 +2243,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2243
2243
|
return c;
|
|
2244
2244
|
}, {});
|
|
2245
2245
|
tablesSql = Object.entries(tableNamesByCatalog).map(function (_a) {
|
|
2246
|
-
var _b = tslib_1.__read(_a, 2), database = _b[0], tables = _b[1];
|
|
2246
|
+
var _b = (0, tslib_1.__read)(_a, 2), database = _b[0], tables = _b[1];
|
|
2247
2247
|
var tablesCondition = tables
|
|
2248
2248
|
.map(function (_a) {
|
|
2249
2249
|
var schema = _a.schema, tableName = _a.tableName;
|
|
@@ -2257,7 +2257,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2257
2257
|
_h = [[]];
|
|
2258
2258
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2259
2259
|
case 6:
|
|
2260
|
-
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2260
|
+
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2261
2261
|
_k.label = 7;
|
|
2262
2262
|
case 7:
|
|
2263
2263
|
// if tables were not found in the db, no need to proceed
|
|
@@ -2265,13 +2265,13 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2265
2265
|
return [2 /*return*/, []];
|
|
2266
2266
|
}
|
|
2267
2267
|
dbTablesByCatalog = dbTables.reduce(function (c, _a) {
|
|
2268
|
-
var TABLE_CATALOG = _a.TABLE_CATALOG, other = tslib_1.__rest(_a, ["TABLE_CATALOG"]);
|
|
2268
|
+
var TABLE_CATALOG = _a.TABLE_CATALOG, other = (0, tslib_1.__rest)(_a, ["TABLE_CATALOG"]);
|
|
2269
2269
|
c[TABLE_CATALOG] = c[TABLE_CATALOG] || [];
|
|
2270
2270
|
c[TABLE_CATALOG].push(other);
|
|
2271
2271
|
return c;
|
|
2272
2272
|
}, {});
|
|
2273
2273
|
columnsSql = Object.entries(dbTablesByCatalog).map(function (_a) {
|
|
2274
|
-
var _b = tslib_1.__read(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2274
|
+
var _b = (0, tslib_1.__read)(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2275
2275
|
var condition = tables.map(function (_a) {
|
|
2276
2276
|
var TABLE_SCHEMA = _a.TABLE_SCHEMA, TABLE_NAME = _a.TABLE_NAME;
|
|
2277
2277
|
return "(\"TABLE_SCHEMA\" = '" + TABLE_SCHEMA + "' AND \"TABLE_NAME\" = '" + TABLE_NAME + "')";
|
|
@@ -2279,7 +2279,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2279
2279
|
return "SELECT * FROM \"" + TABLE_CATALOG + "\".\"INFORMATION_SCHEMA\".\"COLUMNS\" WHERE (" + condition + ")";
|
|
2280
2280
|
}).join(" UNION ALL ");
|
|
2281
2281
|
constraintsSql = Object.entries(dbTablesByCatalog).map(function (_a) {
|
|
2282
|
-
var _b = tslib_1.__read(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2282
|
+
var _b = (0, tslib_1.__read)(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2283
2283
|
var conditions = tables.map(function (_a) {
|
|
2284
2284
|
var TABLE_NAME = _a.TABLE_NAME, TABLE_SCHEMA = _a.TABLE_SCHEMA;
|
|
2285
2285
|
return "(\"columnUsages\".\"TABLE_SCHEMA\" = '" + TABLE_SCHEMA + "' AND \"columnUsages\".\"TABLE_NAME\" = '" + TABLE_NAME + "')";
|
|
@@ -2299,7 +2299,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2299
2299
|
"\"tableConstraints\".\"CONSTRAINT_TYPE\" IN ('PRIMARY KEY', 'UNIQUE', 'CHECK')";
|
|
2300
2300
|
}).join(" UNION ALL ");
|
|
2301
2301
|
foreignKeysSql = Object.entries(dbTablesByCatalog).map(function (_a) {
|
|
2302
|
-
var _b = tslib_1.__read(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2302
|
+
var _b = (0, tslib_1.__read)(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2303
2303
|
var conditions = tables.map(function (_a) {
|
|
2304
2304
|
var TABLE_NAME = _a.TABLE_NAME, TABLE_SCHEMA = _a.TABLE_SCHEMA;
|
|
2305
2305
|
return "(\"s1\".\"name\" = '" + TABLE_SCHEMA + "' AND \"t1\".\"name\" = '" + TABLE_NAME + "')";
|
|
@@ -2318,7 +2318,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2318
2318
|
("WHERE (" + conditions + ")");
|
|
2319
2319
|
}).join(" UNION ALL ");
|
|
2320
2320
|
identityColumnsSql = Object.entries(dbTablesByCatalog).map(function (_a) {
|
|
2321
|
-
var _b = tslib_1.__read(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2321
|
+
var _b = (0, tslib_1.__read)(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2322
2322
|
var conditions = tables.map(function (_a) {
|
|
2323
2323
|
var TABLE_NAME = _a.TABLE_NAME, TABLE_SCHEMA = _a.TABLE_SCHEMA;
|
|
2324
2324
|
return "(\"TABLE_SCHEMA\" = '" + TABLE_SCHEMA + "' AND \"TABLE_NAME\" = '" + TABLE_NAME + "')";
|
|
@@ -2331,7 +2331,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2331
2331
|
}).join(" UNION ALL ");
|
|
2332
2332
|
dbCollationsSql = "SELECT \"NAME\", \"COLLATION_NAME\" FROM \"sys\".\"databases\"";
|
|
2333
2333
|
indicesSql = Object.entries(dbTablesByCatalog).map(function (_a) {
|
|
2334
|
-
var _b = tslib_1.__read(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2334
|
+
var _b = (0, tslib_1.__read)(_a, 2), TABLE_CATALOG = _b[0], tables = _b[1];
|
|
2335
2335
|
var conditions = tables.map(function (_a) {
|
|
2336
2336
|
var TABLE_NAME = _a.TABLE_NAME, TABLE_SCHEMA = _a.TABLE_SCHEMA;
|
|
2337
2337
|
return "(\"s\".\"name\" = '" + TABLE_SCHEMA + "' AND \"t\".\"name\" = '" + TABLE_NAME + "')";
|
|
@@ -2357,10 +2357,10 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2357
2357
|
])];
|
|
2358
2358
|
case 8:
|
|
2359
2359
|
_j = tslib_1.__read.apply(void 0, [_k.sent(), 6]), dbColumns = _j[0], dbConstraints = _j[1], dbForeignKeys = _j[2], dbIdentityColumns = _j[3], dbCollations = _j[4], dbIndices = _j[5];
|
|
2360
|
-
return [4 /*yield*/, Promise.all(dbTables.map(function (dbTable) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
2360
|
+
return [4 /*yield*/, Promise.all(dbTables.map(function (dbTable) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2361
2361
|
var table, getSchemaFromKey, db, schema, defaultCollation, tableUniqueConstraints, tableCheckConstraints, tableForeignKeyConstraints, tableIndexConstraints;
|
|
2362
2362
|
var _this = this;
|
|
2363
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2363
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2364
2364
|
table = new Table_1.Table();
|
|
2365
2365
|
getSchemaFromKey = function (dbObject, key) {
|
|
2366
2366
|
return dbObject[key] === currentSchema && (!_this.driver.options.schema || _this.driver.options.schema === currentSchema)
|
|
@@ -2422,7 +2422,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2422
2422
|
if (columnCheckConstraints.length) {
|
|
2423
2423
|
try {
|
|
2424
2424
|
// const isEnumRegexp = new RegExp("^\\(\\[" + tableColumn.name + "\\]='[^']+'(?: OR \\[" + tableColumn.name + "\\]='[^']+')*\\)$");
|
|
2425
|
-
for (var columnCheckConstraints_1 = tslib_1.__values(columnCheckConstraints), columnCheckConstraints_1_1 = columnCheckConstraints_1.next(); !columnCheckConstraints_1_1.done; columnCheckConstraints_1_1 = columnCheckConstraints_1.next()) {
|
|
2425
|
+
for (var columnCheckConstraints_1 = (0, tslib_1.__values)(columnCheckConstraints), columnCheckConstraints_1_1 = columnCheckConstraints_1.next(); !columnCheckConstraints_1_1.done; columnCheckConstraints_1_1 = columnCheckConstraints_1.next()) {
|
|
2426
2426
|
var checkConstraint = columnCheckConstraints_1_1.value;
|
|
2427
2427
|
if (_this.isEnumCheckConstraint(checkConstraint["CONSTRAINT_NAME"])) {
|
|
2428
2428
|
// This is an enum constraint, make column into an enum
|
|
@@ -2617,9 +2617,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2617
2617
|
}
|
|
2618
2618
|
};
|
|
2619
2619
|
SqlServerQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2620
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2620
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2621
2621
|
var parsedTableName, _a, expression, _b, query, parameters;
|
|
2622
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2622
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2623
2623
|
switch (_c.label) {
|
|
2624
2624
|
case 0:
|
|
2625
2625
|
parsedTableName = this.driver.parseTableName(view);
|
|
@@ -2631,7 +2631,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2631
2631
|
_c.label = 2;
|
|
2632
2632
|
case 2:
|
|
2633
2633
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2634
|
-
_b = tslib_1.__read(this.connection.createQueryBuilder()
|
|
2634
|
+
_b = (0, tslib_1.__read)(this.connection.createQueryBuilder()
|
|
2635
2635
|
.insert()
|
|
2636
2636
|
.into(this.getTypeormMetadataTableName())
|
|
2637
2637
|
.values({ type: "VIEW", database: parsedTableName.database, schema: parsedTableName.schema, name: parsedTableName.tableName, value: expression })
|
|
@@ -2651,9 +2651,9 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2651
2651
|
* Builds remove view sql.
|
|
2652
2652
|
*/
|
|
2653
2653
|
SqlServerQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
|
|
2654
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2654
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2655
2655
|
var parsedTableName, _a, qb, _b, query, parameters;
|
|
2656
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2656
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2657
2657
|
switch (_c.label) {
|
|
2658
2658
|
case 0:
|
|
2659
2659
|
parsedTableName = this.driver.parseTableName(viewOrPath);
|
|
@@ -2665,7 +2665,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2665
2665
|
_c.label = 2;
|
|
2666
2666
|
case 2:
|
|
2667
2667
|
qb = this.connection.createQueryBuilder();
|
|
2668
|
-
_b = tslib_1.__read(qb.delete()
|
|
2668
|
+
_b = (0, tslib_1.__read)(qb.delete()
|
|
2669
2669
|
.from(this.getTypeormMetadataTableName())
|
|
2670
2670
|
.where(qb.escape("type") + " = 'VIEW'")
|
|
2671
2671
|
.andWhere(qb.escape("database") + " = :database", { database: parsedTableName.database })
|
|
@@ -2838,7 +2838,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2838
2838
|
case "bigint":
|
|
2839
2839
|
return this.driver.mssql.BigInt;
|
|
2840
2840
|
case "decimal":
|
|
2841
|
-
return (_a = this.driver.mssql).Decimal.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(parameter.params)));
|
|
2841
|
+
return (_a = this.driver.mssql).Decimal.apply(_a, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(parameter.params), false));
|
|
2842
2842
|
case "float":
|
|
2843
2843
|
return this.driver.mssql.Float;
|
|
2844
2844
|
case "int":
|
|
@@ -2846,7 +2846,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2846
2846
|
case "money":
|
|
2847
2847
|
return this.driver.mssql.Money;
|
|
2848
2848
|
case "numeric":
|
|
2849
|
-
return (_b = this.driver.mssql).Numeric.apply(_b, tslib_1.__spreadArray([], tslib_1.__read(parameter.params)));
|
|
2849
|
+
return (_b = this.driver.mssql).Numeric.apply(_b, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(parameter.params), false));
|
|
2850
2850
|
case "smallint":
|
|
2851
2851
|
return this.driver.mssql.SmallInt;
|
|
2852
2852
|
case "smallmoney":
|
|
@@ -2857,25 +2857,25 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2857
2857
|
return this.driver.mssql.TinyInt;
|
|
2858
2858
|
case "char":
|
|
2859
2859
|
case "nchar":
|
|
2860
|
-
return (_c = this.driver.mssql).NChar.apply(_c, tslib_1.__spreadArray([], tslib_1.__read(parameter.params)));
|
|
2860
|
+
return (_c = this.driver.mssql).NChar.apply(_c, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(parameter.params), false));
|
|
2861
2861
|
case "text":
|
|
2862
2862
|
case "ntext":
|
|
2863
2863
|
return this.driver.mssql.Ntext;
|
|
2864
2864
|
case "varchar":
|
|
2865
2865
|
case "nvarchar":
|
|
2866
|
-
return (_d = this.driver.mssql).NVarChar.apply(_d, tslib_1.__spreadArray([], tslib_1.__read(parameter.params)));
|
|
2866
|
+
return (_d = this.driver.mssql).NVarChar.apply(_d, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(parameter.params), false));
|
|
2867
2867
|
case "xml":
|
|
2868
2868
|
return this.driver.mssql.Xml;
|
|
2869
2869
|
case "time":
|
|
2870
|
-
return (_e = this.driver.mssql).Time.apply(_e, tslib_1.__spreadArray([], tslib_1.__read(parameter.params)));
|
|
2870
|
+
return (_e = this.driver.mssql).Time.apply(_e, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(parameter.params), false));
|
|
2871
2871
|
case "date":
|
|
2872
2872
|
return this.driver.mssql.Date;
|
|
2873
2873
|
case "datetime":
|
|
2874
2874
|
return this.driver.mssql.DateTime;
|
|
2875
2875
|
case "datetime2":
|
|
2876
|
-
return (_f = this.driver.mssql).DateTime2.apply(_f, tslib_1.__spreadArray([], tslib_1.__read(parameter.params)));
|
|
2876
|
+
return (_f = this.driver.mssql).DateTime2.apply(_f, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(parameter.params), false));
|
|
2877
2877
|
case "datetimeoffset":
|
|
2878
|
-
return (_g = this.driver.mssql).DateTimeOffset.apply(_g, tslib_1.__spreadArray([], tslib_1.__read(parameter.params)));
|
|
2878
|
+
return (_g = this.driver.mssql).DateTimeOffset.apply(_g, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(parameter.params), false));
|
|
2879
2879
|
case "smalldatetime":
|
|
2880
2880
|
return this.driver.mssql.SmallDateTime;
|
|
2881
2881
|
case "uniqueidentifier":
|
|
@@ -2885,7 +2885,7 @@ var SqlServerQueryRunner = /** @class */ (function (_super) {
|
|
|
2885
2885
|
case "binary":
|
|
2886
2886
|
return this.driver.mssql.Binary;
|
|
2887
2887
|
case "varbinary":
|
|
2888
|
-
return (_h = this.driver.mssql).VarBinary.apply(_h, tslib_1.__spreadArray([], tslib_1.__read(parameter.params)));
|
|
2888
|
+
return (_h = this.driver.mssql).VarBinary.apply(_h, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(parameter.params), false));
|
|
2889
2889
|
case "image":
|
|
2890
2890
|
return this.driver.mssql.Image;
|
|
2891
2891
|
case "udt":
|