typeorm 0.2.38-dev.d8f6037 → 0.2.39-dev.179ae75
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/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.js +1 -1
- package/browser/metadata/EntityMetadata.js.map +1 -1
- package/browser/metadata/RelationMetadata.js +4 -4
- package/browser/metadata/RelationMetadata.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/browser/naming-strategy/DefaultNamingStrategy.js +5 -5
- package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/browser/persistence/Subject.js +1 -1
- package/browser/persistence/Subject.js.map +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/browser/persistence/SubjectExecutor.js +1 -1
- package/browser/persistence/SubjectExecutor.js.map +1 -1
- package/browser/persistence/SubjectTopoligicalSorter.js +5 -5
- package/browser/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/browser/persistence/tree/ClosureSubjectExecutor.js +4 -4
- package/browser/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
- package/browser/query-builder/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/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/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 +1 -1
- package/decorator/entity-view/ViewEntity.js.map +1 -1
- package/decorator/listeners/AfterInsert.js +1 -1
- package/decorator/listeners/AfterInsert.js.map +1 -1
- package/decorator/listeners/AfterLoad.js +1 -1
- package/decorator/listeners/AfterLoad.js.map +1 -1
- package/decorator/listeners/AfterRemove.js +1 -1
- package/decorator/listeners/AfterRemove.js.map +1 -1
- package/decorator/listeners/AfterUpdate.js +1 -1
- package/decorator/listeners/AfterUpdate.js.map +1 -1
- package/decorator/listeners/BeforeInsert.js +1 -1
- package/decorator/listeners/BeforeInsert.js.map +1 -1
- package/decorator/listeners/BeforeRemove.js +1 -1
- package/decorator/listeners/BeforeRemove.js.map +1 -1
- package/decorator/listeners/BeforeUpdate.js +1 -1
- package/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/decorator/listeners/EventSubscriber.js +1 -1
- package/decorator/listeners/EventSubscriber.js.map +1 -1
- package/decorator/relations/JoinColumn.js +1 -1
- package/decorator/relations/JoinColumn.js.map +1 -1
- package/decorator/relations/JoinTable.js +1 -1
- package/decorator/relations/JoinTable.js.map +1 -1
- package/decorator/relations/ManyToMany.js +1 -1
- package/decorator/relations/ManyToMany.js.map +1 -1
- package/decorator/relations/ManyToOne.js +1 -1
- package/decorator/relations/ManyToOne.js.map +1 -1
- package/decorator/relations/OneToMany.js +1 -1
- package/decorator/relations/OneToMany.js.map +1 -1
- package/decorator/relations/OneToOne.js +1 -1
- package/decorator/relations/OneToOne.js.map +1 -1
- package/decorator/relations/RelationCount.js +1 -1
- package/decorator/relations/RelationCount.js.map +1 -1
- package/decorator/relations/RelationId.js +1 -1
- package/decorator/relations/RelationId.js.map +1 -1
- package/decorator/transaction/Transaction.js +7 -7
- package/decorator/transaction/Transaction.js.map +1 -1
- package/decorator/transaction/TransactionManager.js +1 -1
- package/decorator/transaction/TransactionManager.js.map +1 -1
- package/decorator/transaction/TransactionRepository.js +1 -1
- package/decorator/transaction/TransactionRepository.js.map +1 -1
- package/decorator/tree/Tree.js +1 -1
- package/decorator/tree/Tree.js.map +1 -1
- package/decorator/tree/TreeChildren.js +1 -1
- package/decorator/tree/TreeChildren.js.map +1 -1
- package/decorator/tree/TreeLevelColumn.js +1 -1
- package/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/decorator/tree/TreeParent.js +1 -1
- package/decorator/tree/TreeParent.js.map +1 -1
- package/driver/DriverUtils.js +9 -9
- package/driver/DriverUtils.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js.map +1 -1
- package/driver/aurora-data-api/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.js +2 -2
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/RelationMetadata.js +4 -4
- package/metadata/RelationMetadata.js.map +1 -1
- package/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/migration/MigrationExecutor.js +33 -33
- package/migration/MigrationExecutor.js.map +1 -1
- package/naming-strategy/DefaultNamingStrategy.js +10 -10
- package/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/package.json +1 -1
- 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 +95 -95
- package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/schema-builder/table/Table.js +1 -1
- package/schema-builder/table/Table.js.map +1 -1
- package/schema-builder/table/TableCheck.js +1 -1
- package/schema-builder/table/TableCheck.js.map +1 -1
- package/schema-builder/table/TableForeignKey.js +2 -2
- package/schema-builder/table/TableForeignKey.js.map +1 -1
- package/schema-builder/table/TableIndex.js +1 -1
- package/schema-builder/table/TableIndex.js.map +1 -1
- package/schema-builder/table/TableUnique.js +1 -1
- package/schema-builder/table/TableUnique.js.map +1 -1
- package/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
|
@@ -18,7 +18,6 @@ var View_1 = require("../../schema-builder/view/View");
|
|
|
18
18
|
var Broadcaster_1 = require("../../subscriber/Broadcaster");
|
|
19
19
|
var OrmUtils_1 = require("../../util/OrmUtils");
|
|
20
20
|
var Query_1 = require("../Query");
|
|
21
|
-
var BroadcasterResult_1 = require("../../subscriber/BroadcasterResult");
|
|
22
21
|
var VersionUtils_1 = require("../../util/VersionUtils");
|
|
23
22
|
var error_1 = require("../../error");
|
|
24
23
|
var QueryResult_1 = require("../../query-runner/QueryResult");
|
|
@@ -26,7 +25,7 @@ var QueryResult_1 = require("../../query-runner/QueryResult");
|
|
|
26
25
|
* Runs queries on a single postgres database connection.
|
|
27
26
|
*/
|
|
28
27
|
var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
29
|
-
tslib_1.__extends(PostgresQueryRunner, _super);
|
|
28
|
+
(0, tslib_1.__extends)(PostgresQueryRunner, _super);
|
|
30
29
|
// -------------------------------------------------------------------------
|
|
31
30
|
// Constructor
|
|
32
31
|
// -------------------------------------------------------------------------
|
|
@@ -53,7 +52,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
53
52
|
return this.databaseConnectionPromise;
|
|
54
53
|
if (this.mode === "slave" && this.driver.isReplicated) {
|
|
55
54
|
this.databaseConnectionPromise = this.driver.obtainSlaveConnection().then(function (_a) {
|
|
56
|
-
var _b = tslib_1.__read(_a, 2), connection = _b[0], release = _b[1];
|
|
55
|
+
var _b = (0, tslib_1.__read)(_a, 2), connection = _b[0], release = _b[1];
|
|
57
56
|
_this.driver.connectedQueryRunners.push(_this);
|
|
58
57
|
_this.databaseConnection = connection;
|
|
59
58
|
var onErrorCallback = function (err) { return _this.releasePostgresConnection(err); };
|
|
@@ -67,7 +66,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
67
66
|
}
|
|
68
67
|
else { // master
|
|
69
68
|
this.databaseConnectionPromise = this.driver.obtainMasterConnection().then(function (_a) {
|
|
70
|
-
var _b = tslib_1.__read(_a, 2), connection = _b[0], release = _b[1];
|
|
69
|
+
var _b = (0, tslib_1.__read)(_a, 2), connection = _b[0], release = _b[1];
|
|
71
70
|
_this.driver.connectedQueryRunners.push(_this);
|
|
72
71
|
_this.databaseConnection = connection;
|
|
73
72
|
var onErrorCallback = function (err) { return _this.releasePostgresConnection(err); };
|
|
@@ -86,9 +85,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
86
85
|
* Per pg-pool documentation this will prevent the pool from re-using the broken connection.
|
|
87
86
|
*/
|
|
88
87
|
PostgresQueryRunner.prototype.releasePostgresConnection = function (err) {
|
|
89
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
88
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
90
89
|
var index;
|
|
91
|
-
return tslib_1.__generator(this, function (_a) {
|
|
90
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
92
91
|
if (this.isReleased) {
|
|
93
92
|
return [2 /*return*/];
|
|
94
93
|
}
|
|
@@ -116,39 +115,28 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
116
115
|
* Starts transaction.
|
|
117
116
|
*/
|
|
118
117
|
PostgresQueryRunner.prototype.startTransaction = function (isolationLevel) {
|
|
119
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
120
|
-
|
|
121
|
-
return tslib_1.__generator(this, function (_a) {
|
|
118
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
119
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
122
120
|
switch (_a.label) {
|
|
123
121
|
case 0:
|
|
124
122
|
if (this.isTransactionActive)
|
|
125
123
|
throw new TransactionAlreadyStartedError_1.TransactionAlreadyStartedError();
|
|
126
|
-
|
|
127
|
-
this.broadcaster.broadcastBeforeTransactionStartEvent(beforeBroadcastResult);
|
|
128
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
129
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
124
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionStart')];
|
|
130
125
|
case 1:
|
|
131
126
|
_a.sent();
|
|
132
|
-
_a.label = 2;
|
|
133
|
-
case 2:
|
|
134
127
|
this.isTransactionActive = true;
|
|
135
128
|
return [4 /*yield*/, this.query("START TRANSACTION")];
|
|
136
|
-
case
|
|
129
|
+
case 2:
|
|
137
130
|
_a.sent();
|
|
138
|
-
if (!isolationLevel) return [3 /*break*/,
|
|
131
|
+
if (!isolationLevel) return [3 /*break*/, 4];
|
|
139
132
|
return [4 /*yield*/, this.query("SET TRANSACTION ISOLATION LEVEL " + isolationLevel)];
|
|
140
|
-
case
|
|
133
|
+
case 3:
|
|
141
134
|
_a.sent();
|
|
142
|
-
_a.label =
|
|
135
|
+
_a.label = 4;
|
|
136
|
+
case 4: return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionStart')];
|
|
143
137
|
case 5:
|
|
144
|
-
afterBroadcastResult = new BroadcasterResult_1.BroadcasterResult();
|
|
145
|
-
this.broadcaster.broadcastAfterTransactionStartEvent(afterBroadcastResult);
|
|
146
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 7];
|
|
147
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
148
|
-
case 6:
|
|
149
138
|
_a.sent();
|
|
150
|
-
|
|
151
|
-
case 7: return [2 /*return*/];
|
|
139
|
+
return [2 /*return*/];
|
|
152
140
|
}
|
|
153
141
|
});
|
|
154
142
|
});
|
|
@@ -158,32 +146,23 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
158
146
|
* Error will be thrown if transaction was not started.
|
|
159
147
|
*/
|
|
160
148
|
PostgresQueryRunner.prototype.commitTransaction = function () {
|
|
161
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
162
|
-
|
|
163
|
-
return tslib_1.__generator(this, function (_a) {
|
|
149
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
150
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
164
151
|
switch (_a.label) {
|
|
165
152
|
case 0:
|
|
166
153
|
if (!this.isTransactionActive)
|
|
167
154
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
168
|
-
|
|
169
|
-
this.broadcaster.broadcastBeforeTransactionCommitEvent(beforeBroadcastResult);
|
|
170
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
171
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
155
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionCommit')];
|
|
172
156
|
case 1:
|
|
173
157
|
_a.sent();
|
|
174
|
-
|
|
175
|
-
case 2:
|
|
176
|
-
case 3:
|
|
158
|
+
return [4 /*yield*/, this.query("COMMIT")];
|
|
159
|
+
case 2:
|
|
177
160
|
_a.sent();
|
|
178
161
|
this.isTransactionActive = false;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
182
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
183
|
-
case 4:
|
|
162
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionCommit')];
|
|
163
|
+
case 3:
|
|
184
164
|
_a.sent();
|
|
185
|
-
|
|
186
|
-
case 5: return [2 /*return*/];
|
|
165
|
+
return [2 /*return*/];
|
|
187
166
|
}
|
|
188
167
|
});
|
|
189
168
|
});
|
|
@@ -193,32 +172,23 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
193
172
|
* Error will be thrown if transaction was not started.
|
|
194
173
|
*/
|
|
195
174
|
PostgresQueryRunner.prototype.rollbackTransaction = function () {
|
|
196
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
197
|
-
|
|
198
|
-
return tslib_1.__generator(this, function (_a) {
|
|
175
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
176
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
199
177
|
switch (_a.label) {
|
|
200
178
|
case 0:
|
|
201
179
|
if (!this.isTransactionActive)
|
|
202
180
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
203
|
-
|
|
204
|
-
this.broadcaster.broadcastBeforeTransactionRollbackEvent(beforeBroadcastResult);
|
|
205
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
206
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
181
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionRollback')];
|
|
207
182
|
case 1:
|
|
208
183
|
_a.sent();
|
|
209
|
-
|
|
210
|
-
case 2:
|
|
211
|
-
case 3:
|
|
184
|
+
return [4 /*yield*/, this.query("ROLLBACK")];
|
|
185
|
+
case 2:
|
|
212
186
|
_a.sent();
|
|
213
187
|
this.isTransactionActive = false;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
217
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
218
|
-
case 4:
|
|
188
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionRollback')];
|
|
189
|
+
case 3:
|
|
219
190
|
_a.sent();
|
|
220
|
-
|
|
221
|
-
case 5: return [2 /*return*/];
|
|
191
|
+
return [2 /*return*/];
|
|
222
192
|
}
|
|
223
193
|
});
|
|
224
194
|
});
|
|
@@ -228,9 +198,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
228
198
|
*/
|
|
229
199
|
PostgresQueryRunner.prototype.query = function (query, parameters, useStructuredResult) {
|
|
230
200
|
if (useStructuredResult === void 0) { useStructuredResult = false; }
|
|
231
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
201
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
232
202
|
var databaseConnection, queryStartTime, raw, maxQueryExecutionTime, queryEndTime, queryExecutionTime, result, err_1;
|
|
233
|
-
return tslib_1.__generator(this, function (_a) {
|
|
203
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
234
204
|
switch (_a.label) {
|
|
235
205
|
case 0:
|
|
236
206
|
if (this.isReleased)
|
|
@@ -288,9 +258,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
288
258
|
var QueryStream = this.driver.loadStreamDependency();
|
|
289
259
|
if (this.isReleased)
|
|
290
260
|
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
291
|
-
return new Promise(function (ok, fail) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
261
|
+
return new Promise(function (ok, fail) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
292
262
|
var databaseConnection, stream, err_2;
|
|
293
|
-
return tslib_1.__generator(this, function (_a) {
|
|
263
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
294
264
|
switch (_a.label) {
|
|
295
265
|
case 0:
|
|
296
266
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -318,8 +288,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
318
288
|
* Returns all available database names including system databases.
|
|
319
289
|
*/
|
|
320
290
|
PostgresQueryRunner.prototype.getDatabases = function () {
|
|
321
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
322
|
-
return tslib_1.__generator(this, function (_a) {
|
|
291
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
292
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
323
293
|
return [2 /*return*/, Promise.resolve([])];
|
|
324
294
|
});
|
|
325
295
|
});
|
|
@@ -329,8 +299,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
329
299
|
* If database parameter specified, returns schemas of that database.
|
|
330
300
|
*/
|
|
331
301
|
PostgresQueryRunner.prototype.getSchemas = function (database) {
|
|
332
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
333
|
-
return tslib_1.__generator(this, function (_a) {
|
|
302
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
303
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
334
304
|
return [2 /*return*/, Promise.resolve([])];
|
|
335
305
|
});
|
|
336
306
|
});
|
|
@@ -339,9 +309,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
339
309
|
* Checks if database with the given name exist.
|
|
340
310
|
*/
|
|
341
311
|
PostgresQueryRunner.prototype.hasDatabase = function (database) {
|
|
342
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
312
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
343
313
|
var result;
|
|
344
|
-
return tslib_1.__generator(this, function (_a) {
|
|
314
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
345
315
|
switch (_a.label) {
|
|
346
316
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM pg_database WHERE datname='" + database + "';")];
|
|
347
317
|
case 1:
|
|
@@ -355,9 +325,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
355
325
|
* Loads currently using database
|
|
356
326
|
*/
|
|
357
327
|
PostgresQueryRunner.prototype.getCurrentDatabase = function () {
|
|
358
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
328
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
359
329
|
var query;
|
|
360
|
-
return tslib_1.__generator(this, function (_a) {
|
|
330
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
361
331
|
switch (_a.label) {
|
|
362
332
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM current_database()")];
|
|
363
333
|
case 1:
|
|
@@ -371,9 +341,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
371
341
|
* Checks if schema with the given name exist.
|
|
372
342
|
*/
|
|
373
343
|
PostgresQueryRunner.prototype.hasSchema = function (schema) {
|
|
374
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
344
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
375
345
|
var result;
|
|
376
|
-
return tslib_1.__generator(this, function (_a) {
|
|
346
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
377
347
|
switch (_a.label) {
|
|
378
348
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM \"information_schema\".\"schemata\" WHERE \"schema_name\" = '" + schema + "'")];
|
|
379
349
|
case 1:
|
|
@@ -387,9 +357,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
387
357
|
* Loads currently using database schema
|
|
388
358
|
*/
|
|
389
359
|
PostgresQueryRunner.prototype.getCurrentSchema = function () {
|
|
390
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
360
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
391
361
|
var query;
|
|
392
|
-
return tslib_1.__generator(this, function (_a) {
|
|
362
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
393
363
|
switch (_a.label) {
|
|
394
364
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM current_schema()")];
|
|
395
365
|
case 1:
|
|
@@ -403,9 +373,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
403
373
|
* Checks if table with the given name exist in the database.
|
|
404
374
|
*/
|
|
405
375
|
PostgresQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
406
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
376
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
407
377
|
var parsedTableName, _a, sql, result;
|
|
408
|
-
return tslib_1.__generator(this, function (_b) {
|
|
378
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
409
379
|
switch (_b.label) {
|
|
410
380
|
case 0:
|
|
411
381
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -429,9 +399,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
429
399
|
* Checks if column with the given name exist in the given table.
|
|
430
400
|
*/
|
|
431
401
|
PostgresQueryRunner.prototype.hasColumn = function (tableOrName, columnName) {
|
|
432
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
402
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
433
403
|
var parsedTableName, _a, sql, result;
|
|
434
|
-
return tslib_1.__generator(this, function (_b) {
|
|
404
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
435
405
|
switch (_b.label) {
|
|
436
406
|
case 0:
|
|
437
407
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -456,9 +426,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
456
426
|
* Note: Postgres does not support database creation inside a transaction block.
|
|
457
427
|
*/
|
|
458
428
|
PostgresQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
459
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
429
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
460
430
|
var databaseAlreadyExists, up, down;
|
|
461
|
-
return tslib_1.__generator(this, function (_a) {
|
|
431
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
462
432
|
switch (_a.label) {
|
|
463
433
|
case 0:
|
|
464
434
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -484,9 +454,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
484
454
|
* Note: Postgres does not support database dropping inside a transaction block.
|
|
485
455
|
*/
|
|
486
456
|
PostgresQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
487
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
457
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
488
458
|
var up, down;
|
|
489
|
-
return tslib_1.__generator(this, function (_a) {
|
|
459
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
490
460
|
switch (_a.label) {
|
|
491
461
|
case 0:
|
|
492
462
|
up = ifExist ? "DROP DATABASE IF EXISTS \"" + database + "\"" : "DROP DATABASE \"" + database + "\"";
|
|
@@ -503,9 +473,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
503
473
|
* Creates a new table schema.
|
|
504
474
|
*/
|
|
505
475
|
PostgresQueryRunner.prototype.createSchema = function (schemaPath, ifNotExist) {
|
|
506
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
476
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
507
477
|
var schema, up, down;
|
|
508
|
-
return tslib_1.__generator(this, function (_a) {
|
|
478
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
509
479
|
switch (_a.label) {
|
|
510
480
|
case 0:
|
|
511
481
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[1];
|
|
@@ -523,9 +493,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
523
493
|
* Drops table schema.
|
|
524
494
|
*/
|
|
525
495
|
PostgresQueryRunner.prototype.dropSchema = function (schemaPath, ifExist, isCascade) {
|
|
526
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
496
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
527
497
|
var schema, up, down;
|
|
528
|
-
return tslib_1.__generator(this, function (_a) {
|
|
498
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
529
499
|
switch (_a.label) {
|
|
530
500
|
case 0:
|
|
531
501
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[1];
|
|
@@ -546,11 +516,11 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
546
516
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
547
517
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
548
518
|
if (createIndices === void 0) { createIndices = true; }
|
|
549
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
519
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
550
520
|
var isTableExist, upQueries, downQueries, enumColumns, createdEnumTypes, enumColumns_1, enumColumns_1_1, column, hasEnum, enumName, e_1_1;
|
|
551
521
|
var e_1, _a;
|
|
552
522
|
var _this = this;
|
|
553
|
-
return tslib_1.__generator(this, function (_b) {
|
|
523
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
554
524
|
switch (_b.label) {
|
|
555
525
|
case 0:
|
|
556
526
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -568,7 +538,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
568
538
|
_b.label = 3;
|
|
569
539
|
case 3:
|
|
570
540
|
_b.trys.push([3, 8, 9, 10]);
|
|
571
|
-
enumColumns_1 = tslib_1.__values(enumColumns), enumColumns_1_1 = enumColumns_1.next();
|
|
541
|
+
enumColumns_1 = (0, tslib_1.__values)(enumColumns), enumColumns_1_1 = enumColumns_1.next();
|
|
572
542
|
_b.label = 4;
|
|
573
543
|
case 4:
|
|
574
544
|
if (!!enumColumns_1_1.done) return [3 /*break*/, 7];
|
|
@@ -628,10 +598,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
628
598
|
PostgresQueryRunner.prototype.dropTable = function (target, ifExist, dropForeignKeys, dropIndices) {
|
|
629
599
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
630
600
|
if (dropIndices === void 0) { dropIndices = true; }
|
|
631
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
601
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
632
602
|
var isTableExist, createForeignKeys, tablePath, table, upQueries, downQueries;
|
|
633
603
|
var _this = this;
|
|
634
|
-
return tslib_1.__generator(this, function (_a) {
|
|
604
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
635
605
|
switch (_a.label) {
|
|
636
606
|
case 0:
|
|
637
607
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -671,9 +641,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
671
641
|
* Creates a new view.
|
|
672
642
|
*/
|
|
673
643
|
PostgresQueryRunner.prototype.createView = function (view) {
|
|
674
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
644
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
675
645
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
676
|
-
return tslib_1.__generator(this, function (_e) {
|
|
646
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
677
647
|
switch (_e.label) {
|
|
678
648
|
case 0:
|
|
679
649
|
upQueries = [];
|
|
@@ -700,9 +670,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
700
670
|
* Drops the view.
|
|
701
671
|
*/
|
|
702
672
|
PostgresQueryRunner.prototype.dropView = function (target) {
|
|
703
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
673
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
704
674
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
705
|
-
return tslib_1.__generator(this, function (_e) {
|
|
675
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
706
676
|
switch (_e.label) {
|
|
707
677
|
case 0:
|
|
708
678
|
viewName = target instanceof View_1.View ? target.name : target;
|
|
@@ -733,11 +703,11 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
733
703
|
* Renames the given table.
|
|
734
704
|
*/
|
|
735
705
|
PostgresQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
736
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
706
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
737
707
|
var upQueries, downQueries, oldTable, _a, newTable, _b, schemaName, oldTableName, columnNames, oldPkName, newPkName, enumColumns, enumColumns_2, enumColumns_2_1, column, oldEnumType, e_2_1;
|
|
738
708
|
var e_2, _c;
|
|
739
709
|
var _this = this;
|
|
740
|
-
return tslib_1.__generator(this, function (_d) {
|
|
710
|
+
return (0, tslib_1.__generator)(this, function (_d) {
|
|
741
711
|
switch (_d.label) {
|
|
742
712
|
case 0:
|
|
743
713
|
upQueries = [];
|
|
@@ -814,7 +784,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
814
784
|
_d.label = 4;
|
|
815
785
|
case 4:
|
|
816
786
|
_d.trys.push([4, 9, 10, 11]);
|
|
817
|
-
enumColumns_2 = tslib_1.__values(enumColumns), enumColumns_2_1 = enumColumns_2.next();
|
|
787
|
+
enumColumns_2 = (0, tslib_1.__values)(enumColumns), enumColumns_2_1 = enumColumns_2.next();
|
|
818
788
|
_d.label = 5;
|
|
819
789
|
case 5:
|
|
820
790
|
if (!!enumColumns_2_1.done) return [3 /*break*/, 8];
|
|
@@ -854,9 +824,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
854
824
|
* Creates a new column from the column in the table.
|
|
855
825
|
*/
|
|
856
826
|
PostgresQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
857
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
827
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
858
828
|
var table, _a, clonedTable, upQueries, downQueries, hasEnum, primaryColumns, pkName_1, columnNames_1, pkName, columnNames, columnIndex, uniqueConstraint;
|
|
859
|
-
return tslib_1.__generator(this, function (_b) {
|
|
829
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
860
830
|
switch (_b.label) {
|
|
861
831
|
case 0:
|
|
862
832
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -933,14 +903,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
933
903
|
* Creates a new columns from the column in the table.
|
|
934
904
|
*/
|
|
935
905
|
PostgresQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
936
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
906
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
937
907
|
var columns_1, columns_1_1, column, e_3_1;
|
|
938
908
|
var e_3, _a;
|
|
939
|
-
return tslib_1.__generator(this, function (_b) {
|
|
909
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
940
910
|
switch (_b.label) {
|
|
941
911
|
case 0:
|
|
942
912
|
_b.trys.push([0, 5, 6, 7]);
|
|
943
|
-
columns_1 = tslib_1.__values(columns), columns_1_1 = columns_1.next();
|
|
913
|
+
columns_1 = (0, tslib_1.__values)(columns), columns_1_1 = columns_1.next();
|
|
944
914
|
_b.label = 1;
|
|
945
915
|
case 1:
|
|
946
916
|
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -972,9 +942,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
972
942
|
* Renames column in the given table.
|
|
973
943
|
*/
|
|
974
944
|
PostgresQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
975
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
945
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
976
946
|
var table, _a, oldColumn, newColumn;
|
|
977
|
-
return tslib_1.__generator(this, function (_b) {
|
|
947
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
978
948
|
switch (_b.label) {
|
|
979
949
|
case 0:
|
|
980
950
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1005,10 +975,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1005
975
|
* Changes a column in the table.
|
|
1006
976
|
*/
|
|
1007
977
|
PostgresQueryRunner.prototype.changeColumn = function (tableOrName, oldTableColumnOrName, newColumn) {
|
|
1008
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
978
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1009
979
|
var table, _a, clonedTable, upQueries, downQueries, defaultValueChanged, oldColumn, oldEnumType, primaryColumns, columnNames, oldPkName, newPkName, sequencePath, sequenceName, newSequencePath, newSequenceName, up, down, oldTableColumn, arraySuffix, newEnumName, oldEnumName, oldEnumNameWithoutSchema, oldEnumNameWithSchema_old, oldEnumNameWithoutSchema_old, upType, downType, primaryColumns, pkName, columnNames, column, pkName, columnNames, primaryColumn, column, pkName, columnNames, uniqueConstraint, uniqueConstraint;
|
|
1010
980
|
var _this = this;
|
|
1011
|
-
return tslib_1.__generator(this, function (_b) {
|
|
981
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1012
982
|
switch (_b.label) {
|
|
1013
983
|
case 0:
|
|
1014
984
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1274,14 +1244,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1274
1244
|
* Changes a column in the table.
|
|
1275
1245
|
*/
|
|
1276
1246
|
PostgresQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
1277
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1247
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1278
1248
|
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_4_1;
|
|
1279
1249
|
var e_4, _b;
|
|
1280
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1250
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1281
1251
|
switch (_c.label) {
|
|
1282
1252
|
case 0:
|
|
1283
1253
|
_c.trys.push([0, 5, 6, 7]);
|
|
1284
|
-
changedColumns_1 = tslib_1.__values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1254
|
+
changedColumns_1 = (0, tslib_1.__values)(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1285
1255
|
_c.label = 1;
|
|
1286
1256
|
case 1:
|
|
1287
1257
|
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1313,9 +1283,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1313
1283
|
* Drops column in the table.
|
|
1314
1284
|
*/
|
|
1315
1285
|
PostgresQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1316
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1286
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1317
1287
|
var table, _a, column, clonedTable, upQueries, downQueries, pkName, columnNames, tableColumn, pkName_2, columnNames_2, columnIndex, columnCheck, columnUnique, hasEnum, enumType, escapedEnumName;
|
|
1318
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1288
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1319
1289
|
switch (_b.label) {
|
|
1320
1290
|
case 0:
|
|
1321
1291
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1395,14 +1365,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1395
1365
|
* Drops the columns in the table.
|
|
1396
1366
|
*/
|
|
1397
1367
|
PostgresQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1398
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1368
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1399
1369
|
var columns_2, columns_2_1, column, e_5_1;
|
|
1400
1370
|
var e_5, _a;
|
|
1401
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1371
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1402
1372
|
switch (_b.label) {
|
|
1403
1373
|
case 0:
|
|
1404
1374
|
_b.trys.push([0, 5, 6, 7]);
|
|
1405
|
-
columns_2 = tslib_1.__values(columns), columns_2_1 = columns_2.next();
|
|
1375
|
+
columns_2 = (0, tslib_1.__values)(columns), columns_2_1 = columns_2.next();
|
|
1406
1376
|
_b.label = 1;
|
|
1407
1377
|
case 1:
|
|
1408
1378
|
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1434,9 +1404,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1434
1404
|
* Creates a new primary key.
|
|
1435
1405
|
*/
|
|
1436
1406
|
PostgresQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1437
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1407
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1438
1408
|
var table, _a, clonedTable, up, down;
|
|
1439
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1409
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1440
1410
|
switch (_b.label) {
|
|
1441
1411
|
case 0:
|
|
1442
1412
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1469,9 +1439,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1469
1439
|
* Updates composite primary keys.
|
|
1470
1440
|
*/
|
|
1471
1441
|
PostgresQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1472
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1442
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1473
1443
|
var table, _a, clonedTable, columnNames, upQueries, downQueries, primaryColumns, pkName_3, columnNamesString_1, pkName, columnNamesString;
|
|
1474
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1444
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1475
1445
|
switch (_b.label) {
|
|
1476
1446
|
case 0:
|
|
1477
1447
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1515,9 +1485,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1515
1485
|
* Drops a primary key.
|
|
1516
1486
|
*/
|
|
1517
1487
|
PostgresQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1518
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1488
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1519
1489
|
var table, _a, up, down;
|
|
1520
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1490
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1521
1491
|
switch (_b.label) {
|
|
1522
1492
|
case 0:
|
|
1523
1493
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1546,9 +1516,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1546
1516
|
* Creates new unique constraint.
|
|
1547
1517
|
*/
|
|
1548
1518
|
PostgresQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1549
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1519
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1550
1520
|
var table, _a, up, down;
|
|
1551
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1521
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1552
1522
|
switch (_b.label) {
|
|
1553
1523
|
case 0:
|
|
1554
1524
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1578,14 +1548,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1578
1548
|
* Creates new unique constraints.
|
|
1579
1549
|
*/
|
|
1580
1550
|
PostgresQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1581
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1551
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1582
1552
|
var uniqueConstraints_1, uniqueConstraints_1_1, uniqueConstraint, e_6_1;
|
|
1583
1553
|
var e_6, _a;
|
|
1584
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1554
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1585
1555
|
switch (_b.label) {
|
|
1586
1556
|
case 0:
|
|
1587
1557
|
_b.trys.push([0, 5, 6, 7]);
|
|
1588
|
-
uniqueConstraints_1 = tslib_1.__values(uniqueConstraints), uniqueConstraints_1_1 = uniqueConstraints_1.next();
|
|
1558
|
+
uniqueConstraints_1 = (0, tslib_1.__values)(uniqueConstraints), uniqueConstraints_1_1 = uniqueConstraints_1.next();
|
|
1589
1559
|
_b.label = 1;
|
|
1590
1560
|
case 1:
|
|
1591
1561
|
if (!!uniqueConstraints_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1617,9 +1587,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1617
1587
|
* Drops unique constraint.
|
|
1618
1588
|
*/
|
|
1619
1589
|
PostgresQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1620
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1590
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1621
1591
|
var table, _a, uniqueConstraint, up, down;
|
|
1622
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1592
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1623
1593
|
switch (_b.label) {
|
|
1624
1594
|
case 0:
|
|
1625
1595
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1649,14 +1619,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1649
1619
|
* Drops unique constraints.
|
|
1650
1620
|
*/
|
|
1651
1621
|
PostgresQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1652
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1622
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1653
1623
|
var uniqueConstraints_2, uniqueConstraints_2_1, uniqueConstraint, e_7_1;
|
|
1654
1624
|
var e_7, _a;
|
|
1655
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1625
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1656
1626
|
switch (_b.label) {
|
|
1657
1627
|
case 0:
|
|
1658
1628
|
_b.trys.push([0, 5, 6, 7]);
|
|
1659
|
-
uniqueConstraints_2 = tslib_1.__values(uniqueConstraints), uniqueConstraints_2_1 = uniqueConstraints_2.next();
|
|
1629
|
+
uniqueConstraints_2 = (0, tslib_1.__values)(uniqueConstraints), uniqueConstraints_2_1 = uniqueConstraints_2.next();
|
|
1660
1630
|
_b.label = 1;
|
|
1661
1631
|
case 1:
|
|
1662
1632
|
if (!!uniqueConstraints_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1688,9 +1658,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1688
1658
|
* Creates new check constraint.
|
|
1689
1659
|
*/
|
|
1690
1660
|
PostgresQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1691
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1661
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1692
1662
|
var table, _a, up, down;
|
|
1693
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1663
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1694
1664
|
switch (_b.label) {
|
|
1695
1665
|
case 0:
|
|
1696
1666
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1720,10 +1690,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1720
1690
|
* Creates new check constraints.
|
|
1721
1691
|
*/
|
|
1722
1692
|
PostgresQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1723
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1693
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1724
1694
|
var promises;
|
|
1725
1695
|
var _this = this;
|
|
1726
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1696
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1727
1697
|
switch (_a.label) {
|
|
1728
1698
|
case 0:
|
|
1729
1699
|
promises = checkConstraints.map(function (checkConstraint) { return _this.createCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1739,9 +1709,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1739
1709
|
* Drops check constraint.
|
|
1740
1710
|
*/
|
|
1741
1711
|
PostgresQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1742
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1712
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1743
1713
|
var table, _a, checkConstraint, up, down;
|
|
1744
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1714
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1745
1715
|
switch (_b.label) {
|
|
1746
1716
|
case 0:
|
|
1747
1717
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1771,10 +1741,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1771
1741
|
* Drops check constraints.
|
|
1772
1742
|
*/
|
|
1773
1743
|
PostgresQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1774
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1744
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1775
1745
|
var promises;
|
|
1776
1746
|
var _this = this;
|
|
1777
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1747
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1778
1748
|
switch (_a.label) {
|
|
1779
1749
|
case 0:
|
|
1780
1750
|
promises = checkConstraints.map(function (checkConstraint) { return _this.dropCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1790,9 +1760,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1790
1760
|
* Creates new exclusion constraint.
|
|
1791
1761
|
*/
|
|
1792
1762
|
PostgresQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1793
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1763
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1794
1764
|
var table, _a, up, down;
|
|
1795
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1765
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1796
1766
|
switch (_b.label) {
|
|
1797
1767
|
case 0:
|
|
1798
1768
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1822,10 +1792,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1822
1792
|
* Creates new exclusion constraints.
|
|
1823
1793
|
*/
|
|
1824
1794
|
PostgresQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1825
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1795
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1826
1796
|
var promises;
|
|
1827
1797
|
var _this = this;
|
|
1828
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1798
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1829
1799
|
switch (_a.label) {
|
|
1830
1800
|
case 0:
|
|
1831
1801
|
promises = exclusionConstraints.map(function (exclusionConstraint) { return _this.createExclusionConstraint(tableOrName, exclusionConstraint); });
|
|
@@ -1841,9 +1811,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1841
1811
|
* Drops exclusion constraint.
|
|
1842
1812
|
*/
|
|
1843
1813
|
PostgresQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1844
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1814
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1845
1815
|
var table, _a, exclusionConstraint, up, down;
|
|
1846
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1816
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1847
1817
|
switch (_b.label) {
|
|
1848
1818
|
case 0:
|
|
1849
1819
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1873,10 +1843,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1873
1843
|
* Drops exclusion constraints.
|
|
1874
1844
|
*/
|
|
1875
1845
|
PostgresQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1876
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1846
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1877
1847
|
var promises;
|
|
1878
1848
|
var _this = this;
|
|
1879
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1849
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1880
1850
|
switch (_a.label) {
|
|
1881
1851
|
case 0:
|
|
1882
1852
|
promises = exclusionConstraints.map(function (exclusionConstraint) { return _this.dropExclusionConstraint(tableOrName, exclusionConstraint); });
|
|
@@ -1892,9 +1862,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1892
1862
|
* Creates a new foreign key.
|
|
1893
1863
|
*/
|
|
1894
1864
|
PostgresQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1895
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1865
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1896
1866
|
var table, _a, up, down;
|
|
1897
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1867
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1898
1868
|
switch (_b.label) {
|
|
1899
1869
|
case 0:
|
|
1900
1870
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1924,14 +1894,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1924
1894
|
* Creates a new foreign keys.
|
|
1925
1895
|
*/
|
|
1926
1896
|
PostgresQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1927
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1897
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1928
1898
|
var foreignKeys_1, foreignKeys_1_1, foreignKey, e_8_1;
|
|
1929
1899
|
var e_8, _a;
|
|
1930
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1900
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1931
1901
|
switch (_b.label) {
|
|
1932
1902
|
case 0:
|
|
1933
1903
|
_b.trys.push([0, 5, 6, 7]);
|
|
1934
|
-
foreignKeys_1 = tslib_1.__values(foreignKeys), foreignKeys_1_1 = foreignKeys_1.next();
|
|
1904
|
+
foreignKeys_1 = (0, tslib_1.__values)(foreignKeys), foreignKeys_1_1 = foreignKeys_1.next();
|
|
1935
1905
|
_b.label = 1;
|
|
1936
1906
|
case 1:
|
|
1937
1907
|
if (!!foreignKeys_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1963,9 +1933,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1963
1933
|
* Drops a foreign key from the table.
|
|
1964
1934
|
*/
|
|
1965
1935
|
PostgresQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1966
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1936
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1967
1937
|
var table, _a, foreignKey, up, down;
|
|
1968
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1938
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1969
1939
|
switch (_b.label) {
|
|
1970
1940
|
case 0:
|
|
1971
1941
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1995,14 +1965,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1995
1965
|
* Drops a foreign keys from the table.
|
|
1996
1966
|
*/
|
|
1997
1967
|
PostgresQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1998
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1968
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1999
1969
|
var foreignKeys_2, foreignKeys_2_1, foreignKey, e_9_1;
|
|
2000
1970
|
var e_9, _a;
|
|
2001
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1971
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2002
1972
|
switch (_b.label) {
|
|
2003
1973
|
case 0:
|
|
2004
1974
|
_b.trys.push([0, 5, 6, 7]);
|
|
2005
|
-
foreignKeys_2 = tslib_1.__values(foreignKeys), foreignKeys_2_1 = foreignKeys_2.next();
|
|
1975
|
+
foreignKeys_2 = (0, tslib_1.__values)(foreignKeys), foreignKeys_2_1 = foreignKeys_2.next();
|
|
2006
1976
|
_b.label = 1;
|
|
2007
1977
|
case 1:
|
|
2008
1978
|
if (!!foreignKeys_2_1.done) return [3 /*break*/, 4];
|
|
@@ -2034,9 +2004,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2034
2004
|
* Creates a new index.
|
|
2035
2005
|
*/
|
|
2036
2006
|
PostgresQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
2037
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2007
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2038
2008
|
var table, _a, up, down;
|
|
2039
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2009
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2040
2010
|
switch (_b.label) {
|
|
2041
2011
|
case 0:
|
|
2042
2012
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -2066,14 +2036,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2066
2036
|
* Creates a new indices
|
|
2067
2037
|
*/
|
|
2068
2038
|
PostgresQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
2069
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2039
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2070
2040
|
var indices_1, indices_1_1, index, e_10_1;
|
|
2071
2041
|
var e_10, _a;
|
|
2072
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2042
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2073
2043
|
switch (_b.label) {
|
|
2074
2044
|
case 0:
|
|
2075
2045
|
_b.trys.push([0, 5, 6, 7]);
|
|
2076
|
-
indices_1 = tslib_1.__values(indices), indices_1_1 = indices_1.next();
|
|
2046
|
+
indices_1 = (0, tslib_1.__values)(indices), indices_1_1 = indices_1.next();
|
|
2077
2047
|
_b.label = 1;
|
|
2078
2048
|
case 1:
|
|
2079
2049
|
if (!!indices_1_1.done) return [3 /*break*/, 4];
|
|
@@ -2105,9 +2075,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2105
2075
|
* Drops an index from the table.
|
|
2106
2076
|
*/
|
|
2107
2077
|
PostgresQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
2108
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2078
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2109
2079
|
var table, _a, index, up, down;
|
|
2110
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2080
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2111
2081
|
switch (_b.label) {
|
|
2112
2082
|
case 0:
|
|
2113
2083
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -2137,14 +2107,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2137
2107
|
* Drops an indices from the table.
|
|
2138
2108
|
*/
|
|
2139
2109
|
PostgresQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
2140
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2110
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2141
2111
|
var indices_2, indices_2_1, index, e_11_1;
|
|
2142
2112
|
var e_11, _a;
|
|
2143
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2113
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2144
2114
|
switch (_b.label) {
|
|
2145
2115
|
case 0:
|
|
2146
2116
|
_b.trys.push([0, 5, 6, 7]);
|
|
2147
|
-
indices_2 = tslib_1.__values(indices), indices_2_1 = indices_2.next();
|
|
2117
|
+
indices_2 = (0, tslib_1.__values)(indices), indices_2_1 = indices_2.next();
|
|
2148
2118
|
_b.label = 1;
|
|
2149
2119
|
case 1:
|
|
2150
2120
|
if (!!indices_2_1.done) return [3 /*break*/, 4];
|
|
@@ -2177,8 +2147,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2177
2147
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
2178
2148
|
*/
|
|
2179
2149
|
PostgresQueryRunner.prototype.clearTable = function (tableName) {
|
|
2180
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2181
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2150
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2151
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2182
2152
|
switch (_a.label) {
|
|
2183
2153
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tableName))];
|
|
2184
2154
|
case 1:
|
|
@@ -2192,10 +2162,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2192
2162
|
* Removes all tables from the currently connected database.
|
|
2193
2163
|
*/
|
|
2194
2164
|
PostgresQueryRunner.prototype.clearDatabase = function () {
|
|
2195
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2165
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2196
2166
|
var schemas, schemaNamesString, version, selectViewDropsQuery, dropViewQueries, selectMatViewDropsQuery, dropMatViewQueries, selectTableDropsQuery, dropTableQueries, error_2, rollbackError_1;
|
|
2197
2167
|
var _this = this;
|
|
2198
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2168
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2199
2169
|
switch (_a.label) {
|
|
2200
2170
|
case 0:
|
|
2201
2171
|
schemas = [];
|
|
@@ -2278,10 +2248,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2278
2248
|
// Protected Methods
|
|
2279
2249
|
// -------------------------------------------------------------------------
|
|
2280
2250
|
PostgresQueryRunner.prototype.loadViews = function (viewNames) {
|
|
2281
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2251
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2282
2252
|
var hasTable, currentDatabase, currentSchema, viewsCondition, query, dbViews;
|
|
2283
2253
|
var _this = this;
|
|
2284
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2254
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2285
2255
|
switch (_a.label) {
|
|
2286
2256
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
2287
2257
|
case 1:
|
|
@@ -2331,10 +2301,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2331
2301
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
2332
2302
|
*/
|
|
2333
2303
|
PostgresQueryRunner.prototype.loadTables = function (tableNames) {
|
|
2334
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2304
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2335
2305
|
var currentSchema, currentDatabase, dbTables, tablesSql, _a, _b, _c, _d, tablesCondition, tablesSql, _e, _f, _g, _h, columnsCondition, columnsSql, constraintsCondition, constraintsSql, indicesSql, foreignKeysCondition, hasRelispartitionColumn, isPartitionCondition, foreignKeysSql, _j, dbColumns, dbConstraints, dbIndices, dbForeignKeys;
|
|
2336
2306
|
var _this = this;
|
|
2337
|
-
return tslib_1.__generator(this, function (_k) {
|
|
2307
|
+
return (0, tslib_1.__generator)(this, function (_k) {
|
|
2338
2308
|
switch (_k.label) {
|
|
2339
2309
|
case 0:
|
|
2340
2310
|
// if no tables given then no need to proceed
|
|
@@ -2355,7 +2325,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2355
2325
|
_d = [[]];
|
|
2356
2326
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2357
2327
|
case 3:
|
|
2358
|
-
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2328
|
+
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2359
2329
|
return [3 /*break*/, 6];
|
|
2360
2330
|
case 4:
|
|
2361
2331
|
tablesCondition = tableNames
|
|
@@ -2370,7 +2340,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2370
2340
|
_h = [[]];
|
|
2371
2341
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2372
2342
|
case 5:
|
|
2373
|
-
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2343
|
+
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2374
2344
|
_k.label = 6;
|
|
2375
2345
|
case 6:
|
|
2376
2346
|
// if tables were not found in the db, no need to proceed
|
|
@@ -2450,10 +2420,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2450
2420
|
case 8:
|
|
2451
2421
|
_j = tslib_1.__read.apply(void 0, [_k.sent(), 4]), dbColumns = _j[0], dbConstraints = _j[1], dbIndices = _j[2], dbForeignKeys = _j[3];
|
|
2452
2422
|
// create tables for loaded tables
|
|
2453
|
-
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
2423
|
+
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2454
2424
|
var table, getSchemaFromKey, schema, _a, tableUniqueConstraints, tableCheckConstraints, tableExclusionConstraints, tableForeignKeyConstraints, tableIndexConstraints;
|
|
2455
2425
|
var _this = this;
|
|
2456
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2426
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2457
2427
|
switch (_b.label) {
|
|
2458
2428
|
case 0:
|
|
2459
2429
|
table = new Table_1.Table();
|
|
@@ -2470,9 +2440,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2470
2440
|
_a = table;
|
|
2471
2441
|
return [4 /*yield*/, Promise.all(dbColumns
|
|
2472
2442
|
.filter(function (dbColumn) { return (dbColumn["table_name"] === dbTable["table_name"] && dbColumn["table_schema"] === dbTable["table_schema"]); })
|
|
2473
|
-
.map(function (dbColumn) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
2443
|
+
.map(function (dbColumn) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2474
2444
|
var columnConstraints, tableColumn, name, builtEnumName, enumName, sql, results, type, geometryColumnSql, results, geographyColumnSql, results, length, match, uniqueConstraint, isConstraintComposite, serialDefaultName, serialDefaultPath, defaultWithoutQuotes;
|
|
2475
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2445
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2476
2446
|
switch (_a.label) {
|
|
2477
2447
|
case 0:
|
|
2478
2448
|
columnConstraints = dbConstraints.filter(function (dbConstraint) {
|
|
@@ -2765,9 +2735,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2765
2735
|
* Loads Postgres version.
|
|
2766
2736
|
*/
|
|
2767
2737
|
PostgresQueryRunner.prototype.getVersion = function () {
|
|
2768
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2738
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2769
2739
|
var result;
|
|
2770
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2740
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2771
2741
|
switch (_a.label) {
|
|
2772
2742
|
case 0: return [4 /*yield*/, this.query("SHOW SERVER_VERSION")];
|
|
2773
2743
|
case 1:
|
|
@@ -2794,9 +2764,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2794
2764
|
}
|
|
2795
2765
|
};
|
|
2796
2766
|
PostgresQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2797
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2767
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2798
2768
|
var currentSchema, _a, schema, name, type, expression, _b, query, parameters;
|
|
2799
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2769
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2800
2770
|
switch (_c.label) {
|
|
2801
2771
|
case 0: return [4 /*yield*/, this.getCurrentSchema()];
|
|
2802
2772
|
case 1:
|
|
@@ -2807,7 +2777,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2807
2777
|
}
|
|
2808
2778
|
type = view.materialized ? "MATERIALIZED_VIEW" : "VIEW";
|
|
2809
2779
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2810
|
-
_b = tslib_1.__read(this.connection.createQueryBuilder()
|
|
2780
|
+
_b = (0, tslib_1.__read)(this.connection.createQueryBuilder()
|
|
2811
2781
|
.insert()
|
|
2812
2782
|
.into(this.getTypeormMetadataTableName())
|
|
2813
2783
|
.values({ type: type, schema: schema, name: name, value: expression })
|
|
@@ -2828,9 +2798,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2828
2798
|
* Builds remove view sql.
|
|
2829
2799
|
*/
|
|
2830
2800
|
PostgresQueryRunner.prototype.deleteViewDefinitionSql = function (view) {
|
|
2831
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2801
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2832
2802
|
var currentSchema, _a, schema, name, type, qb, _b, query, parameters;
|
|
2833
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2803
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2834
2804
|
switch (_c.label) {
|
|
2835
2805
|
case 0: return [4 /*yield*/, this.getCurrentSchema()];
|
|
2836
2806
|
case 1:
|
|
@@ -2841,7 +2811,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2841
2811
|
}
|
|
2842
2812
|
type = view.materialized ? "MATERIALIZED_VIEW" : "VIEW";
|
|
2843
2813
|
qb = this.connection.createQueryBuilder();
|
|
2844
|
-
_b = tslib_1.__read(qb.delete()
|
|
2814
|
+
_b = (0, tslib_1.__read)(qb.delete()
|
|
2845
2815
|
.from(this.getTypeormMetadataTableName())
|
|
2846
2816
|
.where(qb.escape("type") + " = :type", { type: type })
|
|
2847
2817
|
.andWhere(qb.escape("schema") + " = :schema", { schema: schema })
|
|
@@ -2856,10 +2826,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2856
2826
|
* Drops ENUM type from given schemas.
|
|
2857
2827
|
*/
|
|
2858
2828
|
PostgresQueryRunner.prototype.dropEnumTypes = function (schemaNames) {
|
|
2859
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2829
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2860
2830
|
var selectDropsQuery, dropQueries;
|
|
2861
2831
|
var _this = this;
|
|
2862
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2832
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2863
2833
|
switch (_a.label) {
|
|
2864
2834
|
case 0:
|
|
2865
2835
|
selectDropsQuery = "SELECT 'DROP TYPE IF EXISTS \"' || n.nspname || '\".\"' || t.typname || '\" CASCADE;' as \"query\" FROM \"pg_type\" \"t\" " +
|
|
@@ -2881,9 +2851,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2881
2851
|
* Checks if enum with the given name exist in the database.
|
|
2882
2852
|
*/
|
|
2883
2853
|
PostgresQueryRunner.prototype.hasEnumType = function (table, column) {
|
|
2884
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2854
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2885
2855
|
var schema, enumName, sql, result;
|
|
2886
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2856
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2887
2857
|
switch (_a.label) {
|
|
2888
2858
|
case 0:
|
|
2889
2859
|
schema = this.driver.parseTableName(table).schema;
|
|
@@ -3049,9 +3019,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
3049
3019
|
}).join(".");
|
|
3050
3020
|
};
|
|
3051
3021
|
PostgresQueryRunner.prototype.getUserDefinedTypeName = function (table, column) {
|
|
3052
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3022
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
3053
3023
|
var _a, schema, name, result, udtName;
|
|
3054
|
-
return tslib_1.__generator(this, function (_b) {
|
|
3024
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
3055
3025
|
switch (_b.label) {
|
|
3056
3026
|
case 0:
|
|
3057
3027
|
_a = this.driver.parseTableName(table), schema = _a.schema, name = _a.tableName;
|
|
@@ -3135,9 +3105,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
3135
3105
|
* Checks if the PostgreSQL server has support for partitioned tables
|
|
3136
3106
|
*/
|
|
3137
3107
|
PostgresQueryRunner.prototype.hasSupportForPartitionedTables = function () {
|
|
3138
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3108
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
3139
3109
|
var result;
|
|
3140
|
-
return tslib_1.__generator(this, function (_a) {
|
|
3110
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
3141
3111
|
switch (_a.label) {
|
|
3142
3112
|
case 0: return [4 /*yield*/, this.query("SELECT TRUE FROM information_schema.columns WHERE table_name = 'pg_class' and column_name = 'relispartition'")];
|
|
3143
3113
|
case 1:
|