typeorm 0.2.38 → 0.2.39-dev.2c861af
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -59
- package/browser/connection/ConnectionMetadataBuilder.js +4 -4
- package/browser/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/browser/connection/ConnectionOptionsReader.js +2 -1
- package/browser/connection/ConnectionOptionsReader.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/entity-view/ViewEntity.js +1 -0
- package/browser/decorator/entity-view/ViewEntity.js.map +1 -1
- package/browser/decorator/options/ViewEntityOptions.d.ts +5 -0
- package/browser/decorator/options/ViewEntityOptions.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/AuroraDataApiConnectionOptions.d.ts +5 -0
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js +6 -5
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +19 -48
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +5 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +2 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +17 -46
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +5 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js +4 -3
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachConnectionOptions.d.ts +10 -0
- package/browser/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachDriver.js +5 -4
- package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +46 -77
- package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/browser/driver/cordova/CordovaConnectionOptions.d.ts +5 -0
- package/browser/driver/cordova/CordovaConnectionOptions.js.map +1 -1
- package/browser/driver/cordova/CordovaDriver.js +2 -1
- package/browser/driver/cordova/CordovaDriver.js.map +1 -1
- package/browser/driver/expo/ExpoQueryRunner.js +12 -43
- package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/MongoConnectionOptions.d.ts +5 -0
- package/browser/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/browser/driver/mongodb/MongoDriver.js +2 -1
- package/browser/driver/mongodb/MongoDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlConnectionOptions.d.ts +6 -0
- package/browser/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/browser/driver/mysql/MysqlDriver.js +4 -2
- package/browser/driver/mysql/MysqlDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.js +24 -54
- package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/browser/driver/nativescript/NativescriptQueryRunner.js +45 -37
- package/browser/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/browser/driver/oracle/OracleConnectionOptions.d.ts +5 -0
- package/browser/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/browser/driver/oracle/OracleDriver.js +5 -4
- package/browser/driver/oracle/OracleDriver.js.map +1 -1
- package/browser/driver/oracle/OracleQueryRunner.js +20 -48
- package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.d.ts +10 -0
- package/browser/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresDriver.js +6 -5
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +21 -51
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/react-native/ReactNativeConnectionOptions.d.ts +5 -0
- package/browser/driver/react-native/ReactNativeConnectionOptions.js.map +1 -1
- package/browser/driver/react-native/ReactNativeDriver.js +2 -1
- package/browser/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/browser/driver/sap/SapConnectionOptions.d.ts +16 -6
- package/browser/driver/sap/SapConnectionOptions.js.map +1 -1
- package/browser/driver/sap/SapDriver.js +6 -3
- package/browser/driver/sap/SapDriver.js.map +1 -1
- package/browser/driver/sap/SapQueryRunner.js +20 -50
- package/browser/driver/sap/SapQueryRunner.js.map +1 -1
- package/browser/driver/sqlite/SqliteConnectionOptions.d.ts +5 -0
- package/browser/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/browser/driver/sqlite/SqliteDriver.js +4 -3
- package/browser/driver/sqlite/SqliteDriver.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 +19 -49
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqljs/SqljsConnectionOptions.d.ts +5 -0
- package/browser/driver/sqljs/SqljsConnectionOptions.js.map +1 -1
- package/browser/driver/sqljs/SqljsDriver.js +4 -2
- package/browser/driver/sqljs/SqljsDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/browser/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerDriver.js +7 -6
- package/browser/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.js +84 -116
- package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/browser/entity-manager/MongoEntityManager.js +8 -13
- package/browser/entity-manager/MongoEntityManager.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.d.ts +5 -0
- package/browser/metadata/EntityMetadata.js +2 -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-args/TableMetadataArgs.d.ts +4 -0
- package/browser/metadata-args/TableMetadataArgs.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/DeleteQueryBuilder.js +3 -10
- package/browser/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/InsertQueryBuilder.js +4 -6
- 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 +14 -14
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-builder/SoftDeleteQueryBuilder.js +3 -10
- package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/UpdateQueryBuilder.js +5 -12
- 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/RdbmsSchemaBuilder.js +223 -148
- package/browser/schema-builder/RdbmsSchemaBuilder.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/browser/schema-builder/util/ViewUtils.d.ts +7 -0
- package/browser/schema-builder/util/ViewUtils.js +25 -0
- package/browser/schema-builder/util/ViewUtils.js.map +1 -0
- package/browser/subscriber/Broadcaster.d.ts +23 -2
- package/browser/subscriber/Broadcaster.js +35 -2
- package/browser/subscriber/Broadcaster.js.map +1 -1
- package/browser/subscriber/BroadcasterResult.d.ts +4 -0
- package/browser/subscriber/BroadcasterResult.js +19 -0
- package/browser/subscriber/BroadcasterResult.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 +11 -10
- 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 +2 -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/options/ViewEntityOptions.d.ts +5 -0
- package/decorator/options/ViewEntityOptions.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/AuroraDataApiConnectionOptions.d.ts +5 -0
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiDriver.js +12 -11
- package/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +146 -175
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +5 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +10 -9
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +29 -58
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +5 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3Driver.js +12 -11
- 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/CockroachConnectionOptions.d.ts +10 -0
- package/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/driver/cockroachdb/CockroachDriver.js +15 -14
- package/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +180 -211
- package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/driver/cordova/CordovaConnectionOptions.d.ts +5 -0
- package/driver/cordova/CordovaConnectionOptions.js.map +1 -1
- package/driver/cordova/CordovaDriver.js +5 -4
- 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 +23 -54
- package/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/driver/mongodb/MongoConnectionOptions.d.ts +5 -0
- package/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/driver/mongodb/MongoDriver.js +4 -3
- package/driver/mongodb/MongoDriver.js.map +1 -1
- package/driver/mongodb/MongoQueryRunner.js +178 -178
- package/driver/mysql/MysqlConnectionOptions.d.ts +6 -0
- package/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/driver/mysql/MysqlDriver.js +9 -7
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.js +152 -182
- 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 +48 -40
- package/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/driver/oracle/OracleConnectionOptions.d.ts +5 -0
- package/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/driver/oracle/OracleDriver.js +13 -12
- package/driver/oracle/OracleDriver.js.map +1 -1
- package/driver/oracle/OracleQueryRunner.js +143 -171
- package/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/driver/postgres/PostgresConnectionOptions.d.ts +10 -0
- package/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/driver/postgres/PostgresDriver.js +24 -23
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.js +169 -199
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/react-native/ReactNativeConnectionOptions.d.ts +5 -0
- package/driver/react-native/ReactNativeConnectionOptions.js.map +1 -1
- package/driver/react-native/ReactNativeDriver.js +5 -4
- 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/SapConnectionOptions.d.ts +16 -6
- package/driver/sap/SapConnectionOptions.js.map +1 -1
- package/driver/sap/SapDriver.js +11 -8
- package/driver/sap/SapDriver.js.map +1 -1
- package/driver/sap/SapQueryRunner.js +153 -183
- package/driver/sap/SapQueryRunner.js.map +1 -1
- package/driver/sqlite/SqliteConnectionOptions.d.ts +5 -0
- package/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/driver/sqlite/SqliteDriver.js +12 -11
- 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 +138 -168
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqljs/SqljsConnectionOptions.d.ts +5 -0
- package/driver/sqljs/SqljsConnectionOptions.js.map +1 -1
- package/driver/sqljs/SqljsDriver.js +17 -15
- 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/SqlServerConnectionOptions.d.ts +5 -0
- package/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/driver/sqlserver/SqlServerDriver.js +13 -12
- package/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/driver/sqlserver/SqlServerQueryRunner.js +220 -252
- 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 +23 -28
- 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.d.ts +5 -0
- package/metadata/EntityMetadata.js +3 -2
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/RelationMetadata.js +4 -4
- package/metadata/RelationMetadata.js.map +1 -1
- package/metadata-args/TableMetadataArgs.d.ts +4 -0
- package/metadata-args/TableMetadataArgs.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 +7 -14
- package/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/query-builder/InsertQueryBuilder.js +9 -11
- 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 +43 -43
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-builder/SoftDeleteQueryBuilder.js +7 -14
- package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/query-builder/UpdateQueryBuilder.js +10 -17
- 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 +311 -236
- 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/schema-builder/util/ViewUtils.d.ts +7 -0
- package/schema-builder/util/ViewUtils.js +28 -0
- package/schema-builder/util/ViewUtils.js.map +1 -0
- package/subscriber/Broadcaster.d.ts +23 -2
- package/subscriber/Broadcaster.js +35 -2
- package/subscriber/Broadcaster.js.map +1 -1
- package/subscriber/BroadcasterResult.d.ts +4 -0
- package/subscriber/BroadcasterResult.js +19 -0
- package/subscriber/BroadcasterResult.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
|
@@ -19,13 +19,12 @@ var BaseQueryRunner_1 = require("../../query-runner/BaseQueryRunner");
|
|
|
19
19
|
var OrmUtils_1 = require("../../util/OrmUtils");
|
|
20
20
|
var TableCheck_1 = require("../../schema-builder/table/TableCheck");
|
|
21
21
|
var TableExclusion_1 = require("../../schema-builder/table/TableExclusion");
|
|
22
|
-
var BroadcasterResult_1 = require("../../subscriber/BroadcasterResult");
|
|
23
22
|
var error_1 = require("../../error");
|
|
24
23
|
/**
|
|
25
24
|
* Runs queries on a single postgres database connection.
|
|
26
25
|
*/
|
|
27
26
|
var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
28
|
-
tslib_1.__extends(CockroachQueryRunner, _super);
|
|
27
|
+
(0, tslib_1.__extends)(CockroachQueryRunner, _super);
|
|
29
28
|
// -------------------------------------------------------------------------
|
|
30
29
|
// Constructor
|
|
31
30
|
// -------------------------------------------------------------------------
|
|
@@ -60,7 +59,7 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
60
59
|
return this.databaseConnectionPromise;
|
|
61
60
|
if (this.mode === "slave" && this.driver.isReplicated) {
|
|
62
61
|
this.databaseConnectionPromise = this.driver.obtainSlaveConnection().then(function (_a) {
|
|
63
|
-
var _b = tslib_1.__read(_a, 2), connection = _b[0], release = _b[1];
|
|
62
|
+
var _b = (0, tslib_1.__read)(_a, 2), connection = _b[0], release = _b[1];
|
|
64
63
|
_this.driver.connectedQueryRunners.push(_this);
|
|
65
64
|
_this.databaseConnection = connection;
|
|
66
65
|
_this.releaseCallback = release;
|
|
@@ -69,7 +68,7 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
69
68
|
}
|
|
70
69
|
else { // master
|
|
71
70
|
this.databaseConnectionPromise = this.driver.obtainMasterConnection().then(function (_a) {
|
|
72
|
-
var _b = tslib_1.__read(_a, 2), connection = _b[0], release = _b[1];
|
|
71
|
+
var _b = (0, tslib_1.__read)(_a, 2), connection = _b[0], release = _b[1];
|
|
73
72
|
_this.driver.connectedQueryRunners.push(_this);
|
|
74
73
|
_this.databaseConnection = connection;
|
|
75
74
|
_this.releaseCallback = release;
|
|
@@ -95,43 +94,33 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
95
94
|
* Starts transaction.
|
|
96
95
|
*/
|
|
97
96
|
CockroachQueryRunner.prototype.startTransaction = function (isolationLevel) {
|
|
98
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
99
|
-
|
|
100
|
-
return tslib_1.__generator(this, function (_a) {
|
|
97
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
98
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
101
99
|
switch (_a.label) {
|
|
102
100
|
case 0:
|
|
103
101
|
if (this.isTransactionActive)
|
|
104
102
|
throw new TransactionAlreadyStartedError_1.TransactionAlreadyStartedError();
|
|
105
|
-
|
|
106
|
-
this.broadcaster.broadcastBeforeTransactionStartEvent(beforeBroadcastResult);
|
|
107
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
108
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
103
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionStart')];
|
|
109
104
|
case 1:
|
|
110
105
|
_a.sent();
|
|
111
|
-
_a.label = 2;
|
|
112
|
-
case 2:
|
|
113
106
|
this.isTransactionActive = true;
|
|
114
107
|
return [4 /*yield*/, this.query("START TRANSACTION")];
|
|
115
|
-
case
|
|
108
|
+
case 2:
|
|
116
109
|
_a.sent();
|
|
117
110
|
return [4 /*yield*/, this.query("SAVEPOINT cockroach_restart")];
|
|
118
|
-
case
|
|
111
|
+
case 3:
|
|
119
112
|
_a.sent();
|
|
120
|
-
if (!isolationLevel) return [3 /*break*/,
|
|
113
|
+
if (!isolationLevel) return [3 /*break*/, 5];
|
|
121
114
|
return [4 /*yield*/, this.query("SET TRANSACTION ISOLATION LEVEL " + isolationLevel)];
|
|
122
|
-
case
|
|
115
|
+
case 4:
|
|
123
116
|
_a.sent();
|
|
124
|
-
_a.label =
|
|
125
|
-
case
|
|
117
|
+
_a.label = 5;
|
|
118
|
+
case 5:
|
|
126
119
|
this.storeQueries = true;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 8];
|
|
130
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
131
|
-
case 7:
|
|
120
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionStart')];
|
|
121
|
+
case 6:
|
|
132
122
|
_a.sent();
|
|
133
|
-
|
|
134
|
-
case 8: return [2 /*return*/];
|
|
123
|
+
return [2 /*return*/];
|
|
135
124
|
}
|
|
136
125
|
});
|
|
137
126
|
});
|
|
@@ -141,81 +130,71 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
141
130
|
* Error will be thrown if transaction was not started.
|
|
142
131
|
*/
|
|
143
132
|
CockroachQueryRunner.prototype.commitTransaction = function () {
|
|
144
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
145
|
-
var
|
|
133
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
134
|
+
var e_1, _a, _b, q, e_2_1;
|
|
146
135
|
var e_2, _c;
|
|
147
|
-
return tslib_1.__generator(this, function (_d) {
|
|
136
|
+
return (0, tslib_1.__generator)(this, function (_d) {
|
|
148
137
|
switch (_d.label) {
|
|
149
138
|
case 0:
|
|
150
139
|
if (!this.isTransactionActive)
|
|
151
140
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
152
|
-
|
|
153
|
-
this.broadcaster.broadcastBeforeTransactionCommitEvent(beforeBroadcastResult);
|
|
154
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
155
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
141
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionCommit')];
|
|
156
142
|
case 1:
|
|
157
143
|
_d.sent();
|
|
144
|
+
this.storeQueries = false;
|
|
158
145
|
_d.label = 2;
|
|
159
146
|
case 2:
|
|
160
|
-
|
|
161
|
-
_d.label = 3;
|
|
162
|
-
case 3:
|
|
163
|
-
_d.trys.push([3, 6, , 18]);
|
|
147
|
+
_d.trys.push([2, 5, , 17]);
|
|
164
148
|
return [4 /*yield*/, this.query("RELEASE SAVEPOINT cockroach_restart")];
|
|
165
|
-
case
|
|
149
|
+
case 3:
|
|
166
150
|
_d.sent();
|
|
167
151
|
return [4 /*yield*/, this.query("COMMIT")];
|
|
168
|
-
case
|
|
152
|
+
case 4:
|
|
169
153
|
_d.sent();
|
|
170
154
|
this.queries = [];
|
|
171
155
|
this.isTransactionActive = false;
|
|
172
|
-
return [3 /*break*/,
|
|
173
|
-
case
|
|
156
|
+
return [3 /*break*/, 17];
|
|
157
|
+
case 5:
|
|
174
158
|
e_1 = _d.sent();
|
|
175
|
-
if (!(e_1.code === "40001")) return [3 /*break*/,
|
|
159
|
+
if (!(e_1.code === "40001")) return [3 /*break*/, 16];
|
|
176
160
|
return [4 /*yield*/, this.query("ROLLBACK TO SAVEPOINT cockroach_restart")];
|
|
177
|
-
case
|
|
161
|
+
case 6:
|
|
178
162
|
_d.sent();
|
|
163
|
+
_d.label = 7;
|
|
164
|
+
case 7:
|
|
165
|
+
_d.trys.push([7, 12, 13, 14]);
|
|
166
|
+
_a = (0, tslib_1.__values)(this.queries), _b = _a.next();
|
|
179
167
|
_d.label = 8;
|
|
180
168
|
case 8:
|
|
181
|
-
|
|
182
|
-
_a = tslib_1.__values(this.queries), _b = _a.next();
|
|
183
|
-
_d.label = 9;
|
|
184
|
-
case 9:
|
|
185
|
-
if (!!_b.done) return [3 /*break*/, 12];
|
|
169
|
+
if (!!_b.done) return [3 /*break*/, 11];
|
|
186
170
|
q = _b.value;
|
|
187
171
|
return [4 /*yield*/, this.query(q.query, q.parameters)];
|
|
188
|
-
case
|
|
172
|
+
case 9:
|
|
189
173
|
_d.sent();
|
|
190
|
-
_d.label =
|
|
191
|
-
case
|
|
174
|
+
_d.label = 10;
|
|
175
|
+
case 10:
|
|
192
176
|
_b = _a.next();
|
|
193
|
-
return [3 /*break*/,
|
|
194
|
-
case
|
|
195
|
-
case
|
|
177
|
+
return [3 /*break*/, 8];
|
|
178
|
+
case 11: return [3 /*break*/, 14];
|
|
179
|
+
case 12:
|
|
196
180
|
e_2_1 = _d.sent();
|
|
197
181
|
e_2 = { error: e_2_1 };
|
|
198
|
-
return [3 /*break*/,
|
|
199
|
-
case
|
|
182
|
+
return [3 /*break*/, 14];
|
|
183
|
+
case 13:
|
|
200
184
|
try {
|
|
201
185
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
202
186
|
}
|
|
203
187
|
finally { if (e_2) throw e_2.error; }
|
|
204
188
|
return [7 /*endfinally*/];
|
|
205
|
-
case
|
|
206
|
-
case
|
|
189
|
+
case 14: return [4 /*yield*/, this.commitTransaction()];
|
|
190
|
+
case 15:
|
|
207
191
|
_d.sent();
|
|
208
|
-
_d.label =
|
|
209
|
-
case
|
|
192
|
+
_d.label = 16;
|
|
193
|
+
case 16: return [3 /*break*/, 17];
|
|
194
|
+
case 17: return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionCommit')];
|
|
210
195
|
case 18:
|
|
211
|
-
afterBroadcastResult = new BroadcasterResult_1.BroadcasterResult();
|
|
212
|
-
this.broadcaster.broadcastAfterTransactionCommitEvent(afterBroadcastResult);
|
|
213
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 20];
|
|
214
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
215
|
-
case 19:
|
|
216
196
|
_d.sent();
|
|
217
|
-
|
|
218
|
-
case 20: return [2 /*return*/];
|
|
197
|
+
return [2 /*return*/];
|
|
219
198
|
}
|
|
220
199
|
});
|
|
221
200
|
});
|
|
@@ -225,35 +204,25 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
225
204
|
* Error will be thrown if transaction was not started.
|
|
226
205
|
*/
|
|
227
206
|
CockroachQueryRunner.prototype.rollbackTransaction = function () {
|
|
228
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
229
|
-
|
|
230
|
-
return tslib_1.__generator(this, function (_a) {
|
|
207
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
208
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
231
209
|
switch (_a.label) {
|
|
232
210
|
case 0:
|
|
233
211
|
if (!this.isTransactionActive)
|
|
234
212
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
235
|
-
|
|
236
|
-
this.broadcaster.broadcastBeforeTransactionRollbackEvent(beforeBroadcastResult);
|
|
237
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
238
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
213
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionRollback')];
|
|
239
214
|
case 1:
|
|
240
215
|
_a.sent();
|
|
241
|
-
_a.label = 2;
|
|
242
|
-
case 2:
|
|
243
216
|
this.storeQueries = false;
|
|
244
217
|
return [4 /*yield*/, this.query("ROLLBACK")];
|
|
245
|
-
case
|
|
218
|
+
case 2:
|
|
246
219
|
_a.sent();
|
|
247
220
|
this.queries = [];
|
|
248
221
|
this.isTransactionActive = false;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
252
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
253
|
-
case 4:
|
|
222
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionRollback')];
|
|
223
|
+
case 3:
|
|
254
224
|
_a.sent();
|
|
255
|
-
|
|
256
|
-
case 5: return [2 /*return*/];
|
|
225
|
+
return [2 /*return*/];
|
|
257
226
|
}
|
|
258
227
|
});
|
|
259
228
|
});
|
|
@@ -266,10 +235,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
266
235
|
if (useStructuredResult === void 0) { useStructuredResult = false; }
|
|
267
236
|
if (this.isReleased)
|
|
268
237
|
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
269
|
-
return new Promise(function (ok, fail) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
238
|
+
return new Promise(function (ok, fail) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
270
239
|
var databaseConnection, queryStartTime_1, err_1;
|
|
271
240
|
var _this = this;
|
|
272
|
-
return tslib_1.__generator(this, function (_a) {
|
|
241
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
273
242
|
switch (_a.label) {
|
|
274
243
|
case 0:
|
|
275
244
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -334,9 +303,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
334
303
|
var QueryStream = this.driver.loadStreamDependency();
|
|
335
304
|
if (this.isReleased)
|
|
336
305
|
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
337
|
-
return new Promise(function (ok, fail) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
306
|
+
return new Promise(function (ok, fail) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
338
307
|
var databaseConnection, stream, err_2;
|
|
339
|
-
return tslib_1.__generator(this, function (_a) {
|
|
308
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
340
309
|
switch (_a.label) {
|
|
341
310
|
case 0:
|
|
342
311
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -364,8 +333,8 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
364
333
|
* Returns all available database names including system databases.
|
|
365
334
|
*/
|
|
366
335
|
CockroachQueryRunner.prototype.getDatabases = function () {
|
|
367
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
368
|
-
return tslib_1.__generator(this, function (_a) {
|
|
336
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
337
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
369
338
|
return [2 /*return*/, Promise.resolve([])];
|
|
370
339
|
});
|
|
371
340
|
});
|
|
@@ -375,8 +344,8 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
375
344
|
* If database parameter specified, returns schemas of that database.
|
|
376
345
|
*/
|
|
377
346
|
CockroachQueryRunner.prototype.getSchemas = function (database) {
|
|
378
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
379
|
-
return tslib_1.__generator(this, function (_a) {
|
|
347
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
348
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
380
349
|
return [2 /*return*/, Promise.resolve([])];
|
|
381
350
|
});
|
|
382
351
|
});
|
|
@@ -385,9 +354,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
385
354
|
* Checks if database with the given name exist.
|
|
386
355
|
*/
|
|
387
356
|
CockroachQueryRunner.prototype.hasDatabase = function (database) {
|
|
388
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
357
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
389
358
|
var result;
|
|
390
|
-
return tslib_1.__generator(this, function (_a) {
|
|
359
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
391
360
|
switch (_a.label) {
|
|
392
361
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM \"pg_database\" WHERE \"datname\" = '" + database + "'")];
|
|
393
362
|
case 1:
|
|
@@ -401,9 +370,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
401
370
|
* Loads currently using database
|
|
402
371
|
*/
|
|
403
372
|
CockroachQueryRunner.prototype.getCurrentDatabase = function () {
|
|
404
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
373
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
405
374
|
var query;
|
|
406
|
-
return tslib_1.__generator(this, function (_a) {
|
|
375
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
407
376
|
switch (_a.label) {
|
|
408
377
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM current_database()")];
|
|
409
378
|
case 1:
|
|
@@ -417,9 +386,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
417
386
|
* Checks if schema with the given name exist.
|
|
418
387
|
*/
|
|
419
388
|
CockroachQueryRunner.prototype.hasSchema = function (schema) {
|
|
420
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
389
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
421
390
|
var result;
|
|
422
|
-
return tslib_1.__generator(this, function (_a) {
|
|
391
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
423
392
|
switch (_a.label) {
|
|
424
393
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM \"information_schema\".\"schemata\" WHERE \"schema_name\" = '" + schema + "'")];
|
|
425
394
|
case 1:
|
|
@@ -433,9 +402,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
433
402
|
* Loads currently using database schema
|
|
434
403
|
*/
|
|
435
404
|
CockroachQueryRunner.prototype.getCurrentSchema = function () {
|
|
436
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
405
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
437
406
|
var query;
|
|
438
|
-
return tslib_1.__generator(this, function (_a) {
|
|
407
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
439
408
|
switch (_a.label) {
|
|
440
409
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM current_schema()")];
|
|
441
410
|
case 1:
|
|
@@ -449,9 +418,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
449
418
|
* Checks if table with the given name exist in the database.
|
|
450
419
|
*/
|
|
451
420
|
CockroachQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
452
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
421
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
453
422
|
var parsedTableName, _a, sql, result;
|
|
454
|
-
return tslib_1.__generator(this, function (_b) {
|
|
423
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
455
424
|
switch (_b.label) {
|
|
456
425
|
case 0:
|
|
457
426
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -475,9 +444,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
475
444
|
* Checks if column with the given name exist in the given table.
|
|
476
445
|
*/
|
|
477
446
|
CockroachQueryRunner.prototype.hasColumn = function (tableOrName, columnName) {
|
|
478
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
447
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
479
448
|
var parsedTableName, _a, sql, result;
|
|
480
|
-
return tslib_1.__generator(this, function (_b) {
|
|
449
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
481
450
|
switch (_b.label) {
|
|
482
451
|
case 0:
|
|
483
452
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -501,9 +470,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
501
470
|
* Creates a new database.
|
|
502
471
|
*/
|
|
503
472
|
CockroachQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
504
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
473
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
505
474
|
var up, down;
|
|
506
|
-
return tslib_1.__generator(this, function (_a) {
|
|
475
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
507
476
|
switch (_a.label) {
|
|
508
477
|
case 0:
|
|
509
478
|
up = "CREATE DATABASE " + (ifNotExist ? "IF NOT EXISTS " : "") + " \"" + database + "\"";
|
|
@@ -520,9 +489,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
520
489
|
* Drops database.
|
|
521
490
|
*/
|
|
522
491
|
CockroachQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
523
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
492
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
524
493
|
var up, down;
|
|
525
|
-
return tslib_1.__generator(this, function (_a) {
|
|
494
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
526
495
|
switch (_a.label) {
|
|
527
496
|
case 0:
|
|
528
497
|
up = "DROP DATABASE " + (ifExist ? "IF EXISTS " : "") + " \"" + database + "\"";
|
|
@@ -539,9 +508,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
539
508
|
* Creates a new table schema.
|
|
540
509
|
*/
|
|
541
510
|
CockroachQueryRunner.prototype.createSchema = function (schemaPath, ifNotExist) {
|
|
542
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
511
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
543
512
|
var schema, up, down;
|
|
544
|
-
return tslib_1.__generator(this, function (_a) {
|
|
513
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
545
514
|
switch (_a.label) {
|
|
546
515
|
case 0:
|
|
547
516
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[1];
|
|
@@ -559,9 +528,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
559
528
|
* Drops table schema.
|
|
560
529
|
*/
|
|
561
530
|
CockroachQueryRunner.prototype.dropSchema = function (schemaPath, ifExist, isCascade) {
|
|
562
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
531
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
563
532
|
var schema, up, down;
|
|
564
|
-
return tslib_1.__generator(this, function (_a) {
|
|
533
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
565
534
|
switch (_a.label) {
|
|
566
535
|
case 0:
|
|
567
536
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[1];
|
|
@@ -582,10 +551,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
582
551
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
583
552
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
584
553
|
if (createIndices === void 0) { createIndices = true; }
|
|
585
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
554
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
586
555
|
var isTableExist, upQueries, downQueries;
|
|
587
556
|
var _this = this;
|
|
588
|
-
return tslib_1.__generator(this, function (_a) {
|
|
557
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
589
558
|
switch (_a.label) {
|
|
590
559
|
case 0:
|
|
591
560
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -635,10 +604,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
635
604
|
CockroachQueryRunner.prototype.dropTable = function (target, ifExist, dropForeignKeys, dropIndices) {
|
|
636
605
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
637
606
|
if (dropIndices === void 0) { dropIndices = true; }
|
|
638
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
607
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
639
608
|
var isTableExist, createForeignKeys, tablePath, table, upQueries, downQueries;
|
|
640
609
|
var _this = this;
|
|
641
|
-
return tslib_1.__generator(this, function (_a) {
|
|
610
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
642
611
|
switch (_a.label) {
|
|
643
612
|
case 0:
|
|
644
613
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -685,9 +654,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
685
654
|
* Creates a new view.
|
|
686
655
|
*/
|
|
687
656
|
CockroachQueryRunner.prototype.createView = function (view) {
|
|
688
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
657
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
689
658
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
690
|
-
return tslib_1.__generator(this, function (_e) {
|
|
659
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
691
660
|
switch (_e.label) {
|
|
692
661
|
case 0:
|
|
693
662
|
upQueries = [];
|
|
@@ -714,9 +683,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
714
683
|
* Drops the view.
|
|
715
684
|
*/
|
|
716
685
|
CockroachQueryRunner.prototype.dropView = function (target) {
|
|
717
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
686
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
718
687
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
719
|
-
return tslib_1.__generator(this, function (_e) {
|
|
688
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
720
689
|
switch (_e.label) {
|
|
721
690
|
case 0:
|
|
722
691
|
viewName = target instanceof View_1.View ? target.name : target;
|
|
@@ -747,10 +716,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
747
716
|
* Renames the given table.
|
|
748
717
|
*/
|
|
749
718
|
CockroachQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
750
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
719
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
751
720
|
var upQueries, downQueries, oldTable, _a, newTable, _b, schemaName, oldTableName, columnNames, oldPkName, newPkName;
|
|
752
721
|
var _this = this;
|
|
753
|
-
return tslib_1.__generator(this, function (_c) {
|
|
722
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
754
723
|
switch (_c.label) {
|
|
755
724
|
case 0:
|
|
756
725
|
upQueries = [];
|
|
@@ -822,9 +791,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
822
791
|
* Creates a new column from the column in the table.
|
|
823
792
|
*/
|
|
824
793
|
CockroachQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
825
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
794
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
826
795
|
var table, _a, clonedTable, upQueries, downQueries, primaryColumns, pkName_1, columnNames_1, pkName, columnNames, columnIndex, unique, uniqueConstraint;
|
|
827
|
-
return tslib_1.__generator(this, function (_b) {
|
|
796
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
828
797
|
switch (_b.label) {
|
|
829
798
|
case 0:
|
|
830
799
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -907,14 +876,14 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
907
876
|
* Creates a new columns from the column in the table.
|
|
908
877
|
*/
|
|
909
878
|
CockroachQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
910
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
879
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
911
880
|
var columns_1, columns_1_1, column, e_3_1;
|
|
912
881
|
var e_3, _a;
|
|
913
|
-
return tslib_1.__generator(this, function (_b) {
|
|
882
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
914
883
|
switch (_b.label) {
|
|
915
884
|
case 0:
|
|
916
885
|
_b.trys.push([0, 5, 6, 7]);
|
|
917
|
-
columns_1 = tslib_1.__values(columns), columns_1_1 = columns_1.next();
|
|
886
|
+
columns_1 = (0, tslib_1.__values)(columns), columns_1_1 = columns_1.next();
|
|
918
887
|
_b.label = 1;
|
|
919
888
|
case 1:
|
|
920
889
|
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -946,9 +915,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
946
915
|
* Renames column in the given table.
|
|
947
916
|
*/
|
|
948
917
|
CockroachQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
949
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
918
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
950
919
|
var table, _a, oldColumn, newColumn;
|
|
951
|
-
return tslib_1.__generator(this, function (_b) {
|
|
920
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
952
921
|
switch (_b.label) {
|
|
953
922
|
case 0:
|
|
954
923
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -979,10 +948,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
979
948
|
* Changes a column in the table.
|
|
980
949
|
*/
|
|
981
950
|
CockroachQueryRunner.prototype.changeColumn = function (tableOrName, oldTableColumnOrName, newColumn) {
|
|
982
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
951
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
983
952
|
var table, _a, clonedTable, upQueries, downQueries, oldColumn, primaryColumns, columnNames, oldPkName, newPkName, oldTableColumn, primaryColumns, pkName, columnNames, column, pkName, columnNames, primaryColumn, column, pkName, columnNames, uniqueConstraint, uniqueConstraint;
|
|
984
953
|
var _this = this;
|
|
985
|
-
return tslib_1.__generator(this, function (_b) {
|
|
954
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
986
955
|
switch (_b.label) {
|
|
987
956
|
case 0:
|
|
988
957
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1191,14 +1160,14 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1191
1160
|
* Changes a column in the table.
|
|
1192
1161
|
*/
|
|
1193
1162
|
CockroachQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
1194
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1163
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1195
1164
|
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_4_1;
|
|
1196
1165
|
var e_4, _b;
|
|
1197
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1166
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1198
1167
|
switch (_c.label) {
|
|
1199
1168
|
case 0:
|
|
1200
1169
|
_c.trys.push([0, 5, 6, 7]);
|
|
1201
|
-
changedColumns_1 = tslib_1.__values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1170
|
+
changedColumns_1 = (0, tslib_1.__values)(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1202
1171
|
_c.label = 1;
|
|
1203
1172
|
case 1:
|
|
1204
1173
|
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1230,9 +1199,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1230
1199
|
* Drops column in the table.
|
|
1231
1200
|
*/
|
|
1232
1201
|
CockroachQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1233
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1202
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1234
1203
|
var table, _a, column, clonedTable, upQueries, downQueries, pkName, columnNames, tableColumn, pkName_2, columnNames_2, columnIndex, columnCheck, columnUnique;
|
|
1235
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1204
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1236
1205
|
switch (_b.label) {
|
|
1237
1206
|
case 0:
|
|
1238
1207
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1305,14 +1274,14 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1305
1274
|
* Drops the columns in the table.
|
|
1306
1275
|
*/
|
|
1307
1276
|
CockroachQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1308
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1277
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1309
1278
|
var columns_2, columns_2_1, column, e_5_1;
|
|
1310
1279
|
var e_5, _a;
|
|
1311
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1280
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1312
1281
|
switch (_b.label) {
|
|
1313
1282
|
case 0:
|
|
1314
1283
|
_b.trys.push([0, 5, 6, 7]);
|
|
1315
|
-
columns_2 = tslib_1.__values(columns), columns_2_1 = columns_2.next();
|
|
1284
|
+
columns_2 = (0, tslib_1.__values)(columns), columns_2_1 = columns_2.next();
|
|
1316
1285
|
_b.label = 1;
|
|
1317
1286
|
case 1:
|
|
1318
1287
|
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1344,9 +1313,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1344
1313
|
* Creates a new primary key.
|
|
1345
1314
|
*/
|
|
1346
1315
|
CockroachQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1347
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1316
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1348
1317
|
var table, _a, clonedTable, up, down;
|
|
1349
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1318
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1350
1319
|
switch (_b.label) {
|
|
1351
1320
|
case 0:
|
|
1352
1321
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1379,9 +1348,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1379
1348
|
* Updates composite primary keys.
|
|
1380
1349
|
*/
|
|
1381
1350
|
CockroachQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1382
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1351
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1383
1352
|
var table, _a, clonedTable, columnNames, upQueries, downQueries, primaryColumns, pkName_3, columnNamesString_1, pkName, columnNamesString;
|
|
1384
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1353
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1385
1354
|
switch (_b.label) {
|
|
1386
1355
|
case 0:
|
|
1387
1356
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1425,9 +1394,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1425
1394
|
* Drops a primary key.
|
|
1426
1395
|
*/
|
|
1427
1396
|
CockroachQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1428
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1397
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1429
1398
|
var table, _a, up, down;
|
|
1430
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1399
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1431
1400
|
switch (_b.label) {
|
|
1432
1401
|
case 0:
|
|
1433
1402
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1456,9 +1425,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1456
1425
|
* Creates new unique constraint.
|
|
1457
1426
|
*/
|
|
1458
1427
|
CockroachQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1459
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1428
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1460
1429
|
var table, _a, up, down;
|
|
1461
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1430
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1462
1431
|
switch (_b.label) {
|
|
1463
1432
|
case 0:
|
|
1464
1433
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1488,14 +1457,14 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1488
1457
|
* Creates new unique constraints.
|
|
1489
1458
|
*/
|
|
1490
1459
|
CockroachQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1491
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1460
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1492
1461
|
var uniqueConstraints_1, uniqueConstraints_1_1, uniqueConstraint, e_6_1;
|
|
1493
1462
|
var e_6, _a;
|
|
1494
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1463
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1495
1464
|
switch (_b.label) {
|
|
1496
1465
|
case 0:
|
|
1497
1466
|
_b.trys.push([0, 5, 6, 7]);
|
|
1498
|
-
uniqueConstraints_1 = tslib_1.__values(uniqueConstraints), uniqueConstraints_1_1 = uniqueConstraints_1.next();
|
|
1467
|
+
uniqueConstraints_1 = (0, tslib_1.__values)(uniqueConstraints), uniqueConstraints_1_1 = uniqueConstraints_1.next();
|
|
1499
1468
|
_b.label = 1;
|
|
1500
1469
|
case 1:
|
|
1501
1470
|
if (!!uniqueConstraints_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1527,9 +1496,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1527
1496
|
* Drops unique constraint.
|
|
1528
1497
|
*/
|
|
1529
1498
|
CockroachQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1530
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1499
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1531
1500
|
var table, _a, uniqueConstraint, up, down;
|
|
1532
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1501
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1533
1502
|
switch (_b.label) {
|
|
1534
1503
|
case 0:
|
|
1535
1504
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1559,14 +1528,14 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1559
1528
|
* Drops unique constraints.
|
|
1560
1529
|
*/
|
|
1561
1530
|
CockroachQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1562
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1531
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1563
1532
|
var uniqueConstraints_2, uniqueConstraints_2_1, uniqueConstraint, e_7_1;
|
|
1564
1533
|
var e_7, _a;
|
|
1565
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1534
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1566
1535
|
switch (_b.label) {
|
|
1567
1536
|
case 0:
|
|
1568
1537
|
_b.trys.push([0, 5, 6, 7]);
|
|
1569
|
-
uniqueConstraints_2 = tslib_1.__values(uniqueConstraints), uniqueConstraints_2_1 = uniqueConstraints_2.next();
|
|
1538
|
+
uniqueConstraints_2 = (0, tslib_1.__values)(uniqueConstraints), uniqueConstraints_2_1 = uniqueConstraints_2.next();
|
|
1570
1539
|
_b.label = 1;
|
|
1571
1540
|
case 1:
|
|
1572
1541
|
if (!!uniqueConstraints_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1598,9 +1567,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1598
1567
|
* Creates new check constraint.
|
|
1599
1568
|
*/
|
|
1600
1569
|
CockroachQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1601
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1570
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1602
1571
|
var table, _a, up, down;
|
|
1603
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1572
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1604
1573
|
switch (_b.label) {
|
|
1605
1574
|
case 0:
|
|
1606
1575
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1630,10 +1599,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1630
1599
|
* Creates new check constraints.
|
|
1631
1600
|
*/
|
|
1632
1601
|
CockroachQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1633
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1602
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1634
1603
|
var promises;
|
|
1635
1604
|
var _this = this;
|
|
1636
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1605
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1637
1606
|
switch (_a.label) {
|
|
1638
1607
|
case 0:
|
|
1639
1608
|
promises = checkConstraints.map(function (checkConstraint) { return _this.createCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1649,9 +1618,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1649
1618
|
* Drops check constraint.
|
|
1650
1619
|
*/
|
|
1651
1620
|
CockroachQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1652
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1621
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1653
1622
|
var table, _a, checkConstraint, up, down;
|
|
1654
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1623
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1655
1624
|
switch (_b.label) {
|
|
1656
1625
|
case 0:
|
|
1657
1626
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1681,10 +1650,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1681
1650
|
* Drops check constraints.
|
|
1682
1651
|
*/
|
|
1683
1652
|
CockroachQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1684
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1653
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1685
1654
|
var promises;
|
|
1686
1655
|
var _this = this;
|
|
1687
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1656
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1688
1657
|
switch (_a.label) {
|
|
1689
1658
|
case 0:
|
|
1690
1659
|
promises = checkConstraints.map(function (checkConstraint) { return _this.dropCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1700,8 +1669,8 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1700
1669
|
* Creates new exclusion constraint.
|
|
1701
1670
|
*/
|
|
1702
1671
|
CockroachQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1703
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1704
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1672
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1673
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1705
1674
|
throw new error_1.TypeORMError("CockroachDB does not support exclusion constraints.");
|
|
1706
1675
|
});
|
|
1707
1676
|
});
|
|
@@ -1710,8 +1679,8 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1710
1679
|
* Creates new exclusion constraints.
|
|
1711
1680
|
*/
|
|
1712
1681
|
CockroachQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1713
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1714
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1682
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1683
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1715
1684
|
throw new error_1.TypeORMError("CockroachDB does not support exclusion constraints.");
|
|
1716
1685
|
});
|
|
1717
1686
|
});
|
|
@@ -1720,8 +1689,8 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1720
1689
|
* Drops exclusion constraint.
|
|
1721
1690
|
*/
|
|
1722
1691
|
CockroachQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1723
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1724
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1692
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1693
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1725
1694
|
throw new error_1.TypeORMError("CockroachDB does not support exclusion constraints.");
|
|
1726
1695
|
});
|
|
1727
1696
|
});
|
|
@@ -1730,8 +1699,8 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1730
1699
|
* Drops exclusion constraints.
|
|
1731
1700
|
*/
|
|
1732
1701
|
CockroachQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1733
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1734
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1702
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1703
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1735
1704
|
throw new error_1.TypeORMError("CockroachDB does not support exclusion constraints.");
|
|
1736
1705
|
});
|
|
1737
1706
|
});
|
|
@@ -1740,9 +1709,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1740
1709
|
* Creates a new foreign key.
|
|
1741
1710
|
*/
|
|
1742
1711
|
CockroachQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1743
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1712
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1744
1713
|
var table, _a, up, down;
|
|
1745
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1714
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1746
1715
|
switch (_b.label) {
|
|
1747
1716
|
case 0:
|
|
1748
1717
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1772,14 +1741,14 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1772
1741
|
* Creates a new foreign keys.
|
|
1773
1742
|
*/
|
|
1774
1743
|
CockroachQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1775
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1744
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1776
1745
|
var foreignKeys_1, foreignKeys_1_1, foreignKey, e_8_1;
|
|
1777
1746
|
var e_8, _a;
|
|
1778
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1747
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1779
1748
|
switch (_b.label) {
|
|
1780
1749
|
case 0:
|
|
1781
1750
|
_b.trys.push([0, 5, 6, 7]);
|
|
1782
|
-
foreignKeys_1 = tslib_1.__values(foreignKeys), foreignKeys_1_1 = foreignKeys_1.next();
|
|
1751
|
+
foreignKeys_1 = (0, tslib_1.__values)(foreignKeys), foreignKeys_1_1 = foreignKeys_1.next();
|
|
1783
1752
|
_b.label = 1;
|
|
1784
1753
|
case 1:
|
|
1785
1754
|
if (!!foreignKeys_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1811,9 +1780,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1811
1780
|
* Drops a foreign key from the table.
|
|
1812
1781
|
*/
|
|
1813
1782
|
CockroachQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1814
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1783
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1815
1784
|
var table, _a, foreignKey, up, down;
|
|
1816
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1785
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1817
1786
|
switch (_b.label) {
|
|
1818
1787
|
case 0:
|
|
1819
1788
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1843,14 +1812,14 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1843
1812
|
* Drops a foreign keys from the table.
|
|
1844
1813
|
*/
|
|
1845
1814
|
CockroachQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1846
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1815
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1847
1816
|
var foreignKeys_2, foreignKeys_2_1, foreignKey, e_9_1;
|
|
1848
1817
|
var e_9, _a;
|
|
1849
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1818
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1850
1819
|
switch (_b.label) {
|
|
1851
1820
|
case 0:
|
|
1852
1821
|
_b.trys.push([0, 5, 6, 7]);
|
|
1853
|
-
foreignKeys_2 = tslib_1.__values(foreignKeys), foreignKeys_2_1 = foreignKeys_2.next();
|
|
1822
|
+
foreignKeys_2 = (0, tslib_1.__values)(foreignKeys), foreignKeys_2_1 = foreignKeys_2.next();
|
|
1854
1823
|
_b.label = 1;
|
|
1855
1824
|
case 1:
|
|
1856
1825
|
if (!!foreignKeys_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1882,9 +1851,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1882
1851
|
* Creates a new index.
|
|
1883
1852
|
*/
|
|
1884
1853
|
CockroachQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
1885
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1854
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1886
1855
|
var table, _a, unique, up, down, up, down;
|
|
1887
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1856
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1888
1857
|
switch (_b.label) {
|
|
1889
1858
|
case 0:
|
|
1890
1859
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1928,14 +1897,14 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1928
1897
|
* Creates a new indices
|
|
1929
1898
|
*/
|
|
1930
1899
|
CockroachQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
1931
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1900
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1932
1901
|
var indices_1, indices_1_1, index, e_10_1;
|
|
1933
1902
|
var e_10, _a;
|
|
1934
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1903
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1935
1904
|
switch (_b.label) {
|
|
1936
1905
|
case 0:
|
|
1937
1906
|
_b.trys.push([0, 5, 6, 7]);
|
|
1938
|
-
indices_1 = tslib_1.__values(indices), indices_1_1 = indices_1.next();
|
|
1907
|
+
indices_1 = (0, tslib_1.__values)(indices), indices_1_1 = indices_1.next();
|
|
1939
1908
|
_b.label = 1;
|
|
1940
1909
|
case 1:
|
|
1941
1910
|
if (!!indices_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1967,9 +1936,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1967
1936
|
* Drops an index from the table.
|
|
1968
1937
|
*/
|
|
1969
1938
|
CockroachQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
1970
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1939
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1971
1940
|
var table, _a, index, up, down;
|
|
1972
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1941
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1973
1942
|
switch (_b.label) {
|
|
1974
1943
|
case 0:
|
|
1975
1944
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1999,14 +1968,14 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
1999
1968
|
* Drops an indices from the table.
|
|
2000
1969
|
*/
|
|
2001
1970
|
CockroachQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
2002
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1971
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2003
1972
|
var indices_2, indices_2_1, index, e_11_1;
|
|
2004
1973
|
var e_11, _a;
|
|
2005
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1974
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2006
1975
|
switch (_b.label) {
|
|
2007
1976
|
case 0:
|
|
2008
1977
|
_b.trys.push([0, 5, 6, 7]);
|
|
2009
|
-
indices_2 = tslib_1.__values(indices), indices_2_1 = indices_2.next();
|
|
1978
|
+
indices_2 = (0, tslib_1.__values)(indices), indices_2_1 = indices_2.next();
|
|
2010
1979
|
_b.label = 1;
|
|
2011
1980
|
case 1:
|
|
2012
1981
|
if (!!indices_2_1.done) return [3 /*break*/, 4];
|
|
@@ -2039,8 +2008,8 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2039
2008
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
2040
2009
|
*/
|
|
2041
2010
|
CockroachQueryRunner.prototype.clearTable = function (tableName) {
|
|
2042
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2043
|
-
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) {
|
|
2044
2013
|
switch (_a.label) {
|
|
2045
2014
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tableName))];
|
|
2046
2015
|
case 1:
|
|
@@ -2054,10 +2023,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2054
2023
|
* Removes all tables from the currently connected database.
|
|
2055
2024
|
*/
|
|
2056
2025
|
CockroachQueryRunner.prototype.clearDatabase = function () {
|
|
2057
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2026
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2058
2027
|
var schemas, schemaNamesString, selectViewDropsQuery, dropViewQueries, selectDropsQuery, dropQueries, selectSequenceDropsQuery, sequenceDropQueries, error_2, rollbackError_1;
|
|
2059
2028
|
var _this = this;
|
|
2060
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2029
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2061
2030
|
switch (_a.label) {
|
|
2062
2031
|
case 0:
|
|
2063
2032
|
schemas = [];
|
|
@@ -2126,10 +2095,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2126
2095
|
// Protected Methods
|
|
2127
2096
|
// -------------------------------------------------------------------------
|
|
2128
2097
|
CockroachQueryRunner.prototype.loadViews = function (viewNames) {
|
|
2129
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2098
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2130
2099
|
var hasTable, currentDatabase, currentSchema, viewsCondition, query, dbViews;
|
|
2131
2100
|
var _this = this;
|
|
2132
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2101
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2133
2102
|
switch (_a.label) {
|
|
2134
2103
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
2135
2104
|
case 1:
|
|
@@ -2172,10 +2141,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2172
2141
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
2173
2142
|
*/
|
|
2174
2143
|
CockroachQueryRunner.prototype.loadTables = function (tableNames) {
|
|
2175
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2144
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2176
2145
|
var currentSchema, currentDatabase, dbTables, tablesSql, _a, _b, _c, _d, tablesCondition, tablesSql, _e, _f, _g, _h, columnsCondiiton, columnsSql, constraintsCondition, constraintsSql, indicesSql, foreignKeysCondition, foreignKeysSql, _j, dbColumns, dbConstraints, dbIndices, dbForeignKeys;
|
|
2177
2146
|
var _this = this;
|
|
2178
|
-
return tslib_1.__generator(this, function (_k) {
|
|
2147
|
+
return (0, tslib_1.__generator)(this, function (_k) {
|
|
2179
2148
|
switch (_k.label) {
|
|
2180
2149
|
case 0:
|
|
2181
2150
|
// if no tables given then no need to proceed
|
|
@@ -2196,7 +2165,7 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2196
2165
|
_d = [[]];
|
|
2197
2166
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2198
2167
|
case 3:
|
|
2199
|
-
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2168
|
+
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2200
2169
|
return [3 /*break*/, 6];
|
|
2201
2170
|
case 4:
|
|
2202
2171
|
tablesCondition = tableNames
|
|
@@ -2211,7 +2180,7 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2211
2180
|
_h = [[]];
|
|
2212
2181
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2213
2182
|
case 5:
|
|
2214
|
-
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2183
|
+
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2215
2184
|
_k.label = 6;
|
|
2216
2185
|
case 6:
|
|
2217
2186
|
if (dbTables.length === 0) {
|
|
@@ -2273,10 +2242,10 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2273
2242
|
case 7:
|
|
2274
2243
|
_j = tslib_1.__read.apply(void 0, [_k.sent(), 4]), dbColumns = _j[0], dbConstraints = _j[1], dbIndices = _j[2], dbForeignKeys = _j[3];
|
|
2275
2244
|
// create tables for loaded tables
|
|
2276
|
-
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
2245
|
+
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2277
2246
|
var table, getSchemaFromKey, schema, _a, tableUniqueConstraints, tableCheckConstraints, tableExclusionConstraints, tableForeignKeyConstraints, tableIndexConstraints;
|
|
2278
2247
|
var _this = this;
|
|
2279
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2248
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2280
2249
|
switch (_b.label) {
|
|
2281
2250
|
case 0:
|
|
2282
2251
|
table = new Table_1.Table();
|
|
@@ -2293,9 +2262,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2293
2262
|
_a = table;
|
|
2294
2263
|
return [4 /*yield*/, Promise.all(dbColumns
|
|
2295
2264
|
.filter(function (dbColumn) { return dbColumn["table_name"] === dbTable["table_name"] && dbColumn["table_schema"] === dbTable["table_schema"]; })
|
|
2296
|
-
.map(function (dbColumn) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
2265
|
+
.map(function (dbColumn) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2297
2266
|
var columnConstraints, tableColumn, type, length, uniqueConstraint, isConstraintComposite;
|
|
2298
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2267
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2299
2268
|
columnConstraints = dbConstraints.filter(function (dbConstraint) {
|
|
2300
2269
|
return (dbConstraint["table_name"] === dbColumn["table_name"] &&
|
|
2301
2270
|
dbConstraint["table_schema"] === dbColumn["table_schema"] &&
|
|
@@ -2531,9 +2500,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2531
2500
|
}
|
|
2532
2501
|
};
|
|
2533
2502
|
CockroachQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2534
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2503
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2535
2504
|
var currentSchema, _a, schema, name, expression, _b, query, parameters;
|
|
2536
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2505
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2537
2506
|
switch (_c.label) {
|
|
2538
2507
|
case 0: return [4 /*yield*/, this.getCurrentSchema()];
|
|
2539
2508
|
case 1:
|
|
@@ -2543,7 +2512,7 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2543
2512
|
schema = currentSchema;
|
|
2544
2513
|
}
|
|
2545
2514
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2546
|
-
_b = tslib_1.__read(this.connection.createQueryBuilder()
|
|
2515
|
+
_b = (0, tslib_1.__read)(this.connection.createQueryBuilder()
|
|
2547
2516
|
.insert()
|
|
2548
2517
|
.into(this.getTypeormMetadataTableName())
|
|
2549
2518
|
.values({ type: "VIEW", schema: schema, name: name, value: expression })
|
|
@@ -2563,9 +2532,9 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2563
2532
|
* Builds remove view sql.
|
|
2564
2533
|
*/
|
|
2565
2534
|
CockroachQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
|
|
2566
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2535
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2567
2536
|
var currentSchema, _a, schema, name, qb, _b, query, parameters;
|
|
2568
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2537
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2569
2538
|
switch (_c.label) {
|
|
2570
2539
|
case 0: return [4 /*yield*/, this.getCurrentSchema()];
|
|
2571
2540
|
case 1:
|
|
@@ -2575,7 +2544,7 @@ var CockroachQueryRunner = /** @class */ (function (_super) {
|
|
|
2575
2544
|
schema = currentSchema;
|
|
2576
2545
|
}
|
|
2577
2546
|
qb = this.connection.createQueryBuilder();
|
|
2578
|
-
_b = tslib_1.__read(qb.delete()
|
|
2547
|
+
_b = (0, tslib_1.__read)(qb.delete()
|
|
2579
2548
|
.from(this.getTypeormMetadataTableName())
|
|
2580
2549
|
.where(qb.escape("type") + " = 'VIEW'")
|
|
2581
2550
|
.andWhere(qb.escape("schema") + " = :schema", { schema: schema })
|