typeorm 0.2.38-dev.e9366b3 → 0.2.39-dev.1197f88
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 +61 -60
- package/browser/connection/ConnectionMetadataBuilder.js +4 -4
- package/browser/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/browser/connection/ConnectionOptionsReader.js +2 -1
- package/browser/connection/ConnectionOptionsReader.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/browser/decorator/entity-view/ViewEntity.js +1 -0
- package/browser/decorator/entity-view/ViewEntity.js.map +1 -1
- package/browser/decorator/options/ViewEntityOptions.d.ts +5 -0
- package/browser/decorator/options/ViewEntityOptions.js.map +1 -1
- package/browser/decorator/transaction/Transaction.js +3 -3
- package/browser/decorator/transaction/Transaction.js.map +1 -1
- package/browser/driver/DriverUtils.js +1 -1
- package/browser/driver/DriverUtils.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +5 -0
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js +6 -5
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +19 -48
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +5 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +2 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +17 -46
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +5 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js +4 -3
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachConnectionOptions.d.ts +10 -0
- package/browser/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachDriver.js +28 -18
- package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +108 -145
- 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.d.ts +1 -1
- package/browser/driver/cordova/CordovaDriver.js +27 -19
- package/browser/driver/cordova/CordovaDriver.js.map +1 -1
- package/browser/driver/cordova/CordovaQueryRunner.js +50 -43
- package/browser/driver/cordova/CordovaQueryRunner.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.d.ts +2 -2
- package/browser/driver/postgres/PostgresDriver.js +37 -45
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +28 -66
- 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 +30 -78
- 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 +9 -24
- package/browser/driver/sqljs/SqljsDriver.js.map +1 -1
- package/browser/driver/sqljs/SqljsQueryRunner.js +9 -10
- package/browser/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/browser/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerDriver.js +7 -6
- package/browser/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.js +84 -116
- package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/browser/entity-manager/MongoEntityManager.js +8 -13
- package/browser/entity-manager/MongoEntityManager.js.map +1 -1
- package/browser/find-options/FindOptionsUtils.js +1 -1
- package/browser/find-options/FindOptionsUtils.js.map +1 -1
- package/browser/metadata/ColumnMetadata.js +4 -4
- package/browser/metadata/ColumnMetadata.js.map +1 -1
- package/browser/metadata/EmbeddedMetadata.js +1 -1
- package/browser/metadata/EmbeddedMetadata.js.map +1 -1
- package/browser/metadata/EntityMetadata.d.ts +5 -0
- package/browser/metadata/EntityMetadata.js +2 -1
- package/browser/metadata/EntityMetadata.js.map +1 -1
- package/browser/metadata/RelationMetadata.js +4 -4
- package/browser/metadata/RelationMetadata.js.map +1 -1
- package/browser/metadata-args/TableMetadataArgs.d.ts +4 -0
- package/browser/metadata-args/TableMetadataArgs.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/browser/migration/MigrationExecutor.d.ts +1 -1
- package/browser/migration/MigrationExecutor.js +6 -14
- package/browser/migration/MigrationExecutor.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 +4 -4
- 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 +4 -10
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.d.ts +2 -1
- package/browser/query-runner/BaseQueryRunner.js +49 -27
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/query-runner/QueryLock.js +1 -1
- package/browser/query-runner/QueryLock.js.map +1 -1
- package/browser/repository/BaseEntity.js +1 -1
- package/browser/repository/BaseEntity.js.map +1 -1
- package/browser/repository/Repository.js +1 -1
- package/browser/repository/Repository.js.map +1 -1
- package/browser/repository/TreeRepository.js +2 -2
- package/browser/repository/TreeRepository.js.map +1 -1
- package/browser/schema-builder/RdbmsSchemaBuilder.d.ts +2 -0
- package/browser/schema-builder/RdbmsSchemaBuilder.js +248 -190
- package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/browser/schema-builder/table/TableCheck.js +1 -1
- package/browser/schema-builder/table/TableCheck.js.map +1 -1
- package/browser/schema-builder/table/TableForeignKey.js +2 -2
- package/browser/schema-builder/table/TableForeignKey.js.map +1 -1
- package/browser/schema-builder/table/TableIndex.js +1 -1
- package/browser/schema-builder/table/TableIndex.js.map +1 -1
- package/browser/schema-builder/table/TableUnique.js +1 -1
- package/browser/schema-builder/table/TableUnique.js.map +1 -1
- package/browser/schema-builder/util/ViewUtils.d.ts +7 -0
- package/browser/schema-builder/util/ViewUtils.js +25 -0
- package/browser/schema-builder/util/ViewUtils.js.map +1 -0
- package/browser/subscriber/Broadcaster.d.ts +23 -2
- package/browser/subscriber/Broadcaster.js +35 -2
- package/browser/subscriber/Broadcaster.js.map +1 -1
- package/browser/subscriber/BroadcasterResult.d.ts +4 -0
- package/browser/subscriber/BroadcasterResult.js +19 -0
- package/browser/subscriber/BroadcasterResult.js.map +1 -1
- package/browser/util/StringUtils.js +1 -1
- package/browser/util/StringUtils.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 +7 -7
- package/commands/SchemaLogCommand.js.map +1 -1
- package/commands/SchemaSyncCommand.js +5 -5
- package/commands/SchemaSyncCommand.js.map +1 -1
- package/commands/SubscriberCreateCommand.js +3 -3
- package/commands/SubscriberCreateCommand.js.map +1 -1
- package/commands/VersionCommand.js +3 -3
- package/commands/VersionCommand.js.map +1 -1
- package/connection/Connection.js +19 -19
- package/connection/Connection.js.map +1 -1
- package/connection/ConnectionMetadataBuilder.js +11 -11
- package/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/connection/ConnectionOptionsReader.js +11 -10
- package/connection/ConnectionOptionsReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsEnvReader.js +2 -2
- package/connection/options-reader/ConnectionOptionsXmlReader.js +3 -3
- package/connection/options-reader/ConnectionOptionsXmlReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsYmlReader.js +4 -4
- package/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/decorator/Check.js +1 -1
- package/decorator/Check.js.map +1 -1
- package/decorator/EntityRepository.js +1 -1
- package/decorator/EntityRepository.js.map +1 -1
- package/decorator/Exclusion.js +1 -1
- package/decorator/Exclusion.js.map +1 -1
- package/decorator/Generated.js +1 -1
- package/decorator/Generated.js.map +1 -1
- package/decorator/Index.js +1 -1
- package/decorator/Index.js.map +1 -1
- package/decorator/Unique.js +1 -1
- package/decorator/Unique.js.map +1 -1
- package/decorator/columns/Column.js +4 -4
- package/decorator/columns/Column.js.map +1 -1
- package/decorator/columns/CreateDateColumn.js +1 -1
- package/decorator/columns/CreateDateColumn.js.map +1 -1
- package/decorator/columns/DeleteDateColumn.js +1 -1
- package/decorator/columns/DeleteDateColumn.js.map +1 -1
- package/decorator/columns/ObjectIdColumn.js +1 -1
- package/decorator/columns/ObjectIdColumn.js.map +1 -1
- package/decorator/columns/PrimaryColumn.js +2 -2
- package/decorator/columns/PrimaryColumn.js.map +1 -1
- package/decorator/columns/PrimaryGeneratedColumn.js +2 -2
- package/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/decorator/columns/UpdateDateColumn.js +1 -1
- package/decorator/columns/UpdateDateColumn.js.map +1 -1
- package/decorator/columns/VersionColumn.js +1 -1
- package/decorator/columns/VersionColumn.js.map +1 -1
- package/decorator/columns/ViewColumn.js +1 -1
- package/decorator/columns/ViewColumn.js.map +1 -1
- package/decorator/entity/ChildEntity.js +2 -2
- package/decorator/entity/ChildEntity.js.map +1 -1
- package/decorator/entity/Entity.js +1 -1
- package/decorator/entity/Entity.js.map +1 -1
- package/decorator/entity/TableInheritance.js +1 -1
- package/decorator/entity/TableInheritance.js.map +1 -1
- package/decorator/entity-view/ViewEntity.js +2 -1
- package/decorator/entity-view/ViewEntity.js.map +1 -1
- package/decorator/listeners/AfterInsert.js +1 -1
- package/decorator/listeners/AfterInsert.js.map +1 -1
- package/decorator/listeners/AfterLoad.js +1 -1
- package/decorator/listeners/AfterLoad.js.map +1 -1
- package/decorator/listeners/AfterRemove.js +1 -1
- package/decorator/listeners/AfterRemove.js.map +1 -1
- package/decorator/listeners/AfterUpdate.js +1 -1
- package/decorator/listeners/AfterUpdate.js.map +1 -1
- package/decorator/listeners/BeforeInsert.js +1 -1
- package/decorator/listeners/BeforeInsert.js.map +1 -1
- package/decorator/listeners/BeforeRemove.js +1 -1
- package/decorator/listeners/BeforeRemove.js.map +1 -1
- package/decorator/listeners/BeforeUpdate.js +1 -1
- package/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/decorator/listeners/EventSubscriber.js +1 -1
- package/decorator/listeners/EventSubscriber.js.map +1 -1
- package/decorator/options/ViewEntityOptions.d.ts +5 -0
- package/decorator/options/ViewEntityOptions.js.map +1 -1
- package/decorator/relations/JoinColumn.js +1 -1
- package/decorator/relations/JoinColumn.js.map +1 -1
- package/decorator/relations/JoinTable.js +1 -1
- package/decorator/relations/JoinTable.js.map +1 -1
- package/decorator/relations/ManyToMany.js +1 -1
- package/decorator/relations/ManyToMany.js.map +1 -1
- package/decorator/relations/ManyToOne.js +1 -1
- package/decorator/relations/ManyToOne.js.map +1 -1
- package/decorator/relations/OneToMany.js +1 -1
- package/decorator/relations/OneToMany.js.map +1 -1
- package/decorator/relations/OneToOne.js +1 -1
- package/decorator/relations/OneToOne.js.map +1 -1
- package/decorator/relations/RelationCount.js +1 -1
- package/decorator/relations/RelationCount.js.map +1 -1
- package/decorator/relations/RelationId.js +1 -1
- package/decorator/relations/RelationId.js.map +1 -1
- package/decorator/transaction/Transaction.js +7 -7
- package/decorator/transaction/Transaction.js.map +1 -1
- package/decorator/transaction/TransactionManager.js +1 -1
- package/decorator/transaction/TransactionManager.js.map +1 -1
- package/decorator/transaction/TransactionRepository.js +1 -1
- package/decorator/transaction/TransactionRepository.js.map +1 -1
- package/decorator/tree/Tree.js +1 -1
- package/decorator/tree/Tree.js.map +1 -1
- package/decorator/tree/TreeChildren.js +1 -1
- package/decorator/tree/TreeChildren.js.map +1 -1
- package/decorator/tree/TreeLevelColumn.js +1 -1
- package/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/decorator/tree/TreeParent.js +1 -1
- package/decorator/tree/TreeParent.js.map +1 -1
- package/driver/DriverUtils.js +9 -9
- package/driver/DriverUtils.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +5 -0
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiDriver.js +12 -11
- package/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +146 -175
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +5 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +10 -9
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +29 -58
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +5 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3Driver.js +12 -11
- package/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +5 -5
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/driver/capacitor/CapacitorDriver.js +7 -7
- package/driver/capacitor/CapacitorDriver.js.map +1 -1
- package/driver/capacitor/CapacitorQueryRunner.js +5 -5
- package/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
- package/driver/cockroachdb/CockroachConnectionOptions.d.ts +10 -0
- package/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/driver/cockroachdb/CockroachDriver.js +38 -28
- package/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +240 -277
- 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.d.ts +1 -1
- package/driver/cordova/CordovaDriver.js +30 -22
- package/driver/cordova/CordovaDriver.js.map +1 -1
- package/driver/cordova/CordovaQueryRunner.js +61 -54
- 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.d.ts +2 -2
- package/driver/postgres/PostgresDriver.js +52 -60
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.js +175 -213
- 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 +159 -207
- 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 +22 -37
- package/driver/sqljs/SqljsDriver.js.map +1 -1
- package/driver/sqljs/SqljsQueryRunner.js +17 -18
- package/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/driver/sqlserver/SqlServerDriver.js +13 -12
- package/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/driver/sqlserver/SqlServerQueryRunner.js +220 -252
- package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/entity-manager/EntityManager.js +30 -30
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-manager/MongoEntityManager.js +23 -28
- package/entity-manager/MongoEntityManager.js.map +1 -1
- package/entity-manager/SqljsEntityManager.js +5 -5
- package/entity-manager/SqljsEntityManager.js.map +1 -1
- package/entity-schema/EntitySchemaTransformer.js +1 -1
- package/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/error/AlreadyHasActiveConnectionError.js +1 -1
- package/error/AlreadyHasActiveConnectionError.js.map +1 -1
- package/error/CannotAttachTreeChildrenEntityError.js +1 -1
- package/error/CannotAttachTreeChildrenEntityError.js.map +1 -1
- package/error/CannotConnectAlreadyConnectedError.js +1 -1
- package/error/CannotConnectAlreadyConnectedError.js.map +1 -1
- package/error/CannotCreateEntityIdMapError.js +1 -1
- package/error/CannotCreateEntityIdMapError.js.map +1 -1
- package/error/CannotDetermineEntityError.js +1 -1
- package/error/CannotDetermineEntityError.js.map +1 -1
- package/error/CannotExecuteNotConnectedError.js +1 -1
- package/error/CannotExecuteNotConnectedError.js.map +1 -1
- package/error/CannotGetEntityManagerNotConnectedError.js +1 -1
- package/error/CannotGetEntityManagerNotConnectedError.js.map +1 -1
- package/error/CannotReflectMethodParameterTypeError.js +1 -1
- package/error/CannotReflectMethodParameterTypeError.js.map +1 -1
- package/error/CircularRelationsError.js +1 -1
- package/error/CircularRelationsError.js.map +1 -1
- package/error/ColumnTypeUndefinedError.js +1 -1
- package/error/ColumnTypeUndefinedError.js.map +1 -1
- package/error/ConnectionIsNotSetError.js +1 -1
- package/error/ConnectionIsNotSetError.js.map +1 -1
- package/error/ConnectionNotFoundError.js +1 -1
- package/error/ConnectionNotFoundError.js.map +1 -1
- package/error/CustomRepositoryCannotInheritRepositoryError.js +1 -1
- package/error/CustomRepositoryCannotInheritRepositoryError.js.map +1 -1
- package/error/CustomRepositoryDoesNotHaveEntityError.js +1 -1
- package/error/CustomRepositoryDoesNotHaveEntityError.js.map +1 -1
- package/error/CustomRepositoryNotFoundError.js +1 -1
- package/error/CustomRepositoryNotFoundError.js.map +1 -1
- package/error/DataTypeNotSupportedError.js +1 -1
- package/error/DataTypeNotSupportedError.js.map +1 -1
- package/error/DriverOptionNotSetError.js +1 -1
- package/error/DriverOptionNotSetError.js.map +1 -1
- package/error/DriverPackageNotInstalledError.js +1 -1
- package/error/DriverPackageNotInstalledError.js.map +1 -1
- package/error/EntityColumnNotFound.js +1 -1
- package/error/EntityColumnNotFound.js.map +1 -1
- package/error/EntityMetadataNotFoundError.js +1 -1
- package/error/EntityMetadataNotFoundError.js.map +1 -1
- package/error/EntityNotFoundError.js +1 -1
- package/error/EntityNotFoundError.js.map +1 -1
- package/error/FindRelationsNotFoundError.js +1 -1
- package/error/FindRelationsNotFoundError.js.map +1 -1
- package/error/InitializedRelationError.js +1 -1
- package/error/InitializedRelationError.js.map +1 -1
- package/error/InsertValuesMissingError.js +1 -1
- package/error/InsertValuesMissingError.js.map +1 -1
- package/error/LimitOnUpdateNotSupportedError.js +1 -1
- package/error/LimitOnUpdateNotSupportedError.js.map +1 -1
- package/error/LockNotSupportedOnGivenDriverError.js +1 -1
- package/error/LockNotSupportedOnGivenDriverError.js.map +1 -1
- package/error/MetadataAlreadyExistsError.js +1 -1
- package/error/MetadataAlreadyExistsError.js.map +1 -1
- package/error/MetadataWithSuchNameAlreadyExistsError.js +1 -1
- package/error/MetadataWithSuchNameAlreadyExistsError.js.map +1 -1
- package/error/MissingDeleteDateColumnError.js +1 -1
- package/error/MissingDeleteDateColumnError.js.map +1 -1
- package/error/MissingDriverError.js +1 -1
- package/error/MissingDriverError.js.map +1 -1
- package/error/MissingJoinColumnError.js +1 -1
- package/error/MissingJoinColumnError.js.map +1 -1
- package/error/MissingJoinTableError.js +1 -1
- package/error/MissingJoinTableError.js.map +1 -1
- package/error/MissingPrimaryColumnError.js +1 -1
- package/error/MissingPrimaryColumnError.js.map +1 -1
- package/error/MustBeEntityError.js +1 -1
- package/error/MustBeEntityError.js.map +1 -1
- package/error/NamingStrategyNotFoundError.js +1 -1
- package/error/NamingStrategyNotFoundError.js.map +1 -1
- package/error/NestedSetMultipleRootError.js +1 -1
- package/error/NestedSetMultipleRootError.js.map +1 -1
- package/error/NoConnectionForRepositoryError.js +1 -1
- package/error/NoConnectionForRepositoryError.js.map +1 -1
- package/error/NoConnectionOptionError.js +1 -1
- package/error/NoConnectionOptionError.js.map +1 -1
- package/error/NoNeedToReleaseEntityManagerError.js +1 -1
- package/error/NoNeedToReleaseEntityManagerError.js.map +1 -1
- package/error/NoVersionOrUpdateDateColumnError.js +1 -1
- package/error/NoVersionOrUpdateDateColumnError.js.map +1 -1
- package/error/OffsetWithoutLimitNotSupportedError.js +1 -1
- package/error/OffsetWithoutLimitNotSupportedError.js.map +1 -1
- package/error/OptimisticLockCanNotBeUsedError.js +1 -1
- package/error/OptimisticLockCanNotBeUsedError.js.map +1 -1
- package/error/OptimisticLockVersionMismatchError.js +1 -1
- package/error/OptimisticLockVersionMismatchError.js.map +1 -1
- package/error/PersistedEntityNotFoundError.js +1 -1
- package/error/PersistedEntityNotFoundError.js.map +1 -1
- package/error/PessimisticLockTransactionRequiredError.js +1 -1
- package/error/PessimisticLockTransactionRequiredError.js.map +1 -1
- package/error/PrimaryColumnCannotBeNullableError.js +1 -1
- package/error/PrimaryColumnCannotBeNullableError.js.map +1 -1
- package/error/QueryFailedError.js +3 -3
- package/error/QueryFailedError.js.map +1 -1
- package/error/QueryRunnerAlreadyReleasedError.js +1 -1
- package/error/QueryRunnerAlreadyReleasedError.js.map +1 -1
- package/error/QueryRunnerProviderAlreadyReleasedError.js +1 -1
- package/error/QueryRunnerProviderAlreadyReleasedError.js.map +1 -1
- package/error/RepositoryNotFoundError.js +1 -1
- package/error/RepositoryNotFoundError.js.map +1 -1
- package/error/RepositoryNotTreeError.js +1 -1
- package/error/RepositoryNotTreeError.js.map +1 -1
- package/error/ReturningStatementNotSupportedError.js +1 -1
- package/error/ReturningStatementNotSupportedError.js.map +1 -1
- package/error/SubjectRemovedAndUpdatedError.js +1 -1
- package/error/SubjectRemovedAndUpdatedError.js.map +1 -1
- package/error/SubjectWithoutIdentifierError.js +1 -1
- package/error/SubjectWithoutIdentifierError.js.map +1 -1
- package/error/TransactionAlreadyStartedError.js +1 -1
- package/error/TransactionAlreadyStartedError.js.map +1 -1
- package/error/TransactionNotStartedError.js +1 -1
- package/error/TransactionNotStartedError.js.map +1 -1
- package/error/TreeRepositoryNotSupportedError.js +1 -1
- package/error/TreeRepositoryNotSupportedError.js.map +1 -1
- package/error/TypeORMError.js +1 -1
- package/error/TypeORMError.js.map +1 -1
- package/error/UpdateValuesMissingError.js +1 -1
- package/error/UpdateValuesMissingError.js.map +1 -1
- package/error/UsingJoinColumnIsNotAllowedError.js +1 -1
- package/error/UsingJoinColumnIsNotAllowedError.js.map +1 -1
- package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +1 -1
- package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js.map +1 -1
- package/error/UsingJoinTableIsNotAllowedError.js +1 -1
- package/error/UsingJoinTableIsNotAllowedError.js.map +1 -1
- package/error/UsingJoinTableOnlyOnOneSideAllowedError.js +1 -1
- package/error/UsingJoinTableOnlyOnOneSideAllowedError.js.map +1 -1
- package/error/index.js +62 -62
- package/error/index.js.map +1 -1
- package/find-options/FindOptionsUtils.js +4 -4
- package/find-options/FindOptionsUtils.js.map +1 -1
- package/globals.js +7 -7
- package/globals.js.map +1 -1
- package/index.js +102 -102
- package/index.js.map +1 -1
- package/logger/DebugLogger.js +9 -9
- package/logger/DebugLogger.js.map +1 -1
- package/logger/FileLogger.js +1 -1
- package/logger/FileLogger.js.map +1 -1
- package/metadata/ColumnMetadata.js +4 -4
- package/metadata/ColumnMetadata.js.map +1 -1
- package/metadata/EmbeddedMetadata.js +1 -1
- package/metadata/EmbeddedMetadata.js.map +1 -1
- package/metadata/EntityMetadata.d.ts +5 -0
- package/metadata/EntityMetadata.js +3 -2
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/RelationMetadata.js +4 -4
- package/metadata/RelationMetadata.js.map +1 -1
- package/metadata-args/TableMetadataArgs.d.ts +4 -0
- package/metadata-args/TableMetadataArgs.js.map +1 -1
- package/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/migration/MigrationExecutor.d.ts +1 -1
- package/migration/MigrationExecutor.js +39 -47
- 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 +33 -33
- 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 +4 -10
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/query-runner/BaseQueryRunner.d.ts +2 -1
- package/query-runner/BaseQueryRunner.js +70 -48
- 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.d.ts +2 -0
- package/schema-builder/RdbmsSchemaBuilder.js +335 -277
- package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/schema-builder/table/Table.js +1 -1
- package/schema-builder/table/Table.js.map +1 -1
- package/schema-builder/table/TableCheck.js +1 -1
- package/schema-builder/table/TableCheck.js.map +1 -1
- package/schema-builder/table/TableForeignKey.js +2 -2
- package/schema-builder/table/TableForeignKey.js.map +1 -1
- package/schema-builder/table/TableIndex.js +1 -1
- package/schema-builder/table/TableIndex.js.map +1 -1
- package/schema-builder/table/TableUnique.js +1 -1
- package/schema-builder/table/TableUnique.js.map +1 -1
- package/schema-builder/util/ViewUtils.d.ts +7 -0
- package/schema-builder/util/ViewUtils.js +28 -0
- package/schema-builder/util/ViewUtils.js.map +1 -0
- package/subscriber/Broadcaster.d.ts +23 -2
- package/subscriber/Broadcaster.js +35 -2
- package/subscriber/Broadcaster.js.map +1 -1
- package/subscriber/BroadcasterResult.d.ts +4 -0
- package/subscriber/BroadcasterResult.js +19 -0
- package/subscriber/BroadcasterResult.js.map +1 -1
- package/util/DateUtils.js +1 -1
- package/util/DateUtils.js.map +1 -1
- package/util/DirectoryExportedClassesLoader.js +1 -1
- package/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/util/ObjectUtils.js +2 -2
- package/util/ObjectUtils.js.map +1 -1
- package/util/OrmUtils.js +2 -2
- package/util/OrmUtils.js.map +1 -1
- package/util/StringUtils.js +3 -3
- 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)
|
|
@@ -284,16 +254,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
284
254
|
* Returns raw data stream.
|
|
285
255
|
*/
|
|
286
256
|
PostgresQueryRunner.prototype.stream = function (query, parameters, onEnd, onError) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
291
|
-
return new Promise(function (ok, fail) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
292
|
-
var databaseConnection, stream, err_2;
|
|
293
|
-
return tslib_1.__generator(this, function (_a) {
|
|
257
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
258
|
+
var QueryStream, databaseConnection, stream;
|
|
259
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
294
260
|
switch (_a.label) {
|
|
295
261
|
case 0:
|
|
296
|
-
|
|
262
|
+
QueryStream = this.driver.loadStreamDependency();
|
|
263
|
+
if (this.isReleased)
|
|
264
|
+
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
297
265
|
return [4 /*yield*/, this.connect()];
|
|
298
266
|
case 1:
|
|
299
267
|
databaseConnection = _a.sent();
|
|
@@ -303,23 +271,17 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
303
271
|
stream.on("end", onEnd);
|
|
304
272
|
if (onError)
|
|
305
273
|
stream.on("error", onError);
|
|
306
|
-
|
|
307
|
-
return [3 /*break*/, 3];
|
|
308
|
-
case 2:
|
|
309
|
-
err_2 = _a.sent();
|
|
310
|
-
fail(err_2);
|
|
311
|
-
return [3 /*break*/, 3];
|
|
312
|
-
case 3: return [2 /*return*/];
|
|
274
|
+
return [2 /*return*/, stream];
|
|
313
275
|
}
|
|
314
276
|
});
|
|
315
|
-
});
|
|
277
|
+
});
|
|
316
278
|
};
|
|
317
279
|
/**
|
|
318
280
|
* Returns all available database names including system databases.
|
|
319
281
|
*/
|
|
320
282
|
PostgresQueryRunner.prototype.getDatabases = function () {
|
|
321
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
322
|
-
return tslib_1.__generator(this, function (_a) {
|
|
283
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
284
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
323
285
|
return [2 /*return*/, Promise.resolve([])];
|
|
324
286
|
});
|
|
325
287
|
});
|
|
@@ -329,8 +291,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
329
291
|
* If database parameter specified, returns schemas of that database.
|
|
330
292
|
*/
|
|
331
293
|
PostgresQueryRunner.prototype.getSchemas = function (database) {
|
|
332
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
333
|
-
return tslib_1.__generator(this, function (_a) {
|
|
294
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
295
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
334
296
|
return [2 /*return*/, Promise.resolve([])];
|
|
335
297
|
});
|
|
336
298
|
});
|
|
@@ -339,9 +301,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
339
301
|
* Checks if database with the given name exist.
|
|
340
302
|
*/
|
|
341
303
|
PostgresQueryRunner.prototype.hasDatabase = function (database) {
|
|
342
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
304
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
343
305
|
var result;
|
|
344
|
-
return tslib_1.__generator(this, function (_a) {
|
|
306
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
345
307
|
switch (_a.label) {
|
|
346
308
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM pg_database WHERE datname='" + database + "';")];
|
|
347
309
|
case 1:
|
|
@@ -355,9 +317,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
355
317
|
* Loads currently using database
|
|
356
318
|
*/
|
|
357
319
|
PostgresQueryRunner.prototype.getCurrentDatabase = function () {
|
|
358
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
320
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
359
321
|
var query;
|
|
360
|
-
return tslib_1.__generator(this, function (_a) {
|
|
322
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
361
323
|
switch (_a.label) {
|
|
362
324
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM current_database()")];
|
|
363
325
|
case 1:
|
|
@@ -371,9 +333,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
371
333
|
* Checks if schema with the given name exist.
|
|
372
334
|
*/
|
|
373
335
|
PostgresQueryRunner.prototype.hasSchema = function (schema) {
|
|
374
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
336
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
375
337
|
var result;
|
|
376
|
-
return tslib_1.__generator(this, function (_a) {
|
|
338
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
377
339
|
switch (_a.label) {
|
|
378
340
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM \"information_schema\".\"schemata\" WHERE \"schema_name\" = '" + schema + "'")];
|
|
379
341
|
case 1:
|
|
@@ -387,9 +349,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
387
349
|
* Loads currently using database schema
|
|
388
350
|
*/
|
|
389
351
|
PostgresQueryRunner.prototype.getCurrentSchema = function () {
|
|
390
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
352
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
391
353
|
var query;
|
|
392
|
-
return tslib_1.__generator(this, function (_a) {
|
|
354
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
393
355
|
switch (_a.label) {
|
|
394
356
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM current_schema()")];
|
|
395
357
|
case 1:
|
|
@@ -403,9 +365,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
403
365
|
* Checks if table with the given name exist in the database.
|
|
404
366
|
*/
|
|
405
367
|
PostgresQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
406
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
368
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
407
369
|
var parsedTableName, _a, sql, result;
|
|
408
|
-
return tslib_1.__generator(this, function (_b) {
|
|
370
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
409
371
|
switch (_b.label) {
|
|
410
372
|
case 0:
|
|
411
373
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -429,9 +391,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
429
391
|
* Checks if column with the given name exist in the given table.
|
|
430
392
|
*/
|
|
431
393
|
PostgresQueryRunner.prototype.hasColumn = function (tableOrName, columnName) {
|
|
432
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
394
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
433
395
|
var parsedTableName, _a, sql, result;
|
|
434
|
-
return tslib_1.__generator(this, function (_b) {
|
|
396
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
435
397
|
switch (_b.label) {
|
|
436
398
|
case 0:
|
|
437
399
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -456,9 +418,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
456
418
|
* Note: Postgres does not support database creation inside a transaction block.
|
|
457
419
|
*/
|
|
458
420
|
PostgresQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
459
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
421
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
460
422
|
var databaseAlreadyExists, up, down;
|
|
461
|
-
return tslib_1.__generator(this, function (_a) {
|
|
423
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
462
424
|
switch (_a.label) {
|
|
463
425
|
case 0:
|
|
464
426
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -484,9 +446,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
484
446
|
* Note: Postgres does not support database dropping inside a transaction block.
|
|
485
447
|
*/
|
|
486
448
|
PostgresQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
487
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
449
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
488
450
|
var up, down;
|
|
489
|
-
return tslib_1.__generator(this, function (_a) {
|
|
451
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
490
452
|
switch (_a.label) {
|
|
491
453
|
case 0:
|
|
492
454
|
up = ifExist ? "DROP DATABASE IF EXISTS \"" + database + "\"" : "DROP DATABASE \"" + database + "\"";
|
|
@@ -503,9 +465,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
503
465
|
* Creates a new table schema.
|
|
504
466
|
*/
|
|
505
467
|
PostgresQueryRunner.prototype.createSchema = function (schemaPath, ifNotExist) {
|
|
506
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
468
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
507
469
|
var schema, up, down;
|
|
508
|
-
return tslib_1.__generator(this, function (_a) {
|
|
470
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
509
471
|
switch (_a.label) {
|
|
510
472
|
case 0:
|
|
511
473
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[1];
|
|
@@ -523,9 +485,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
523
485
|
* Drops table schema.
|
|
524
486
|
*/
|
|
525
487
|
PostgresQueryRunner.prototype.dropSchema = function (schemaPath, ifExist, isCascade) {
|
|
526
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
488
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
527
489
|
var schema, up, down;
|
|
528
|
-
return tslib_1.__generator(this, function (_a) {
|
|
490
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
529
491
|
switch (_a.label) {
|
|
530
492
|
case 0:
|
|
531
493
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[1];
|
|
@@ -546,11 +508,11 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
546
508
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
547
509
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
548
510
|
if (createIndices === void 0) { createIndices = true; }
|
|
549
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
511
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
550
512
|
var isTableExist, upQueries, downQueries, enumColumns, createdEnumTypes, enumColumns_1, enumColumns_1_1, column, hasEnum, enumName, e_1_1;
|
|
551
513
|
var e_1, _a;
|
|
552
514
|
var _this = this;
|
|
553
|
-
return tslib_1.__generator(this, function (_b) {
|
|
515
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
554
516
|
switch (_b.label) {
|
|
555
517
|
case 0:
|
|
556
518
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -568,7 +530,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
568
530
|
_b.label = 3;
|
|
569
531
|
case 3:
|
|
570
532
|
_b.trys.push([3, 8, 9, 10]);
|
|
571
|
-
enumColumns_1 = tslib_1.__values(enumColumns), enumColumns_1_1 = enumColumns_1.next();
|
|
533
|
+
enumColumns_1 = (0, tslib_1.__values)(enumColumns), enumColumns_1_1 = enumColumns_1.next();
|
|
572
534
|
_b.label = 4;
|
|
573
535
|
case 4:
|
|
574
536
|
if (!!enumColumns_1_1.done) return [3 /*break*/, 7];
|
|
@@ -628,10 +590,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
628
590
|
PostgresQueryRunner.prototype.dropTable = function (target, ifExist, dropForeignKeys, dropIndices) {
|
|
629
591
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
630
592
|
if (dropIndices === void 0) { dropIndices = true; }
|
|
631
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
593
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
632
594
|
var isTableExist, createForeignKeys, tablePath, table, upQueries, downQueries;
|
|
633
595
|
var _this = this;
|
|
634
|
-
return tslib_1.__generator(this, function (_a) {
|
|
596
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
635
597
|
switch (_a.label) {
|
|
636
598
|
case 0:
|
|
637
599
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -671,9 +633,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
671
633
|
* Creates a new view.
|
|
672
634
|
*/
|
|
673
635
|
PostgresQueryRunner.prototype.createView = function (view) {
|
|
674
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
636
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
675
637
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
676
|
-
return tslib_1.__generator(this, function (_e) {
|
|
638
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
677
639
|
switch (_e.label) {
|
|
678
640
|
case 0:
|
|
679
641
|
upQueries = [];
|
|
@@ -700,9 +662,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
700
662
|
* Drops the view.
|
|
701
663
|
*/
|
|
702
664
|
PostgresQueryRunner.prototype.dropView = function (target) {
|
|
703
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
665
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
704
666
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
705
|
-
return tslib_1.__generator(this, function (_e) {
|
|
667
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
706
668
|
switch (_e.label) {
|
|
707
669
|
case 0:
|
|
708
670
|
viewName = target instanceof View_1.View ? target.name : target;
|
|
@@ -733,11 +695,11 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
733
695
|
* Renames the given table.
|
|
734
696
|
*/
|
|
735
697
|
PostgresQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
736
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
698
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
737
699
|
var upQueries, downQueries, oldTable, _a, newTable, _b, schemaName, oldTableName, columnNames, oldPkName, newPkName, enumColumns, enumColumns_2, enumColumns_2_1, column, oldEnumType, e_2_1;
|
|
738
700
|
var e_2, _c;
|
|
739
701
|
var _this = this;
|
|
740
|
-
return tslib_1.__generator(this, function (_d) {
|
|
702
|
+
return (0, tslib_1.__generator)(this, function (_d) {
|
|
741
703
|
switch (_d.label) {
|
|
742
704
|
case 0:
|
|
743
705
|
upQueries = [];
|
|
@@ -814,7 +776,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
814
776
|
_d.label = 4;
|
|
815
777
|
case 4:
|
|
816
778
|
_d.trys.push([4, 9, 10, 11]);
|
|
817
|
-
enumColumns_2 = tslib_1.__values(enumColumns), enumColumns_2_1 = enumColumns_2.next();
|
|
779
|
+
enumColumns_2 = (0, tslib_1.__values)(enumColumns), enumColumns_2_1 = enumColumns_2.next();
|
|
818
780
|
_d.label = 5;
|
|
819
781
|
case 5:
|
|
820
782
|
if (!!enumColumns_2_1.done) return [3 /*break*/, 8];
|
|
@@ -854,9 +816,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
854
816
|
* Creates a new column from the column in the table.
|
|
855
817
|
*/
|
|
856
818
|
PostgresQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
857
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
819
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
858
820
|
var table, _a, clonedTable, upQueries, downQueries, hasEnum, primaryColumns, pkName_1, columnNames_1, pkName, columnNames, columnIndex, uniqueConstraint;
|
|
859
|
-
return tslib_1.__generator(this, function (_b) {
|
|
821
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
860
822
|
switch (_b.label) {
|
|
861
823
|
case 0:
|
|
862
824
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -933,14 +895,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
933
895
|
* Creates a new columns from the column in the table.
|
|
934
896
|
*/
|
|
935
897
|
PostgresQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
936
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
898
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
937
899
|
var columns_1, columns_1_1, column, e_3_1;
|
|
938
900
|
var e_3, _a;
|
|
939
|
-
return tslib_1.__generator(this, function (_b) {
|
|
901
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
940
902
|
switch (_b.label) {
|
|
941
903
|
case 0:
|
|
942
904
|
_b.trys.push([0, 5, 6, 7]);
|
|
943
|
-
columns_1 = tslib_1.__values(columns), columns_1_1 = columns_1.next();
|
|
905
|
+
columns_1 = (0, tslib_1.__values)(columns), columns_1_1 = columns_1.next();
|
|
944
906
|
_b.label = 1;
|
|
945
907
|
case 1:
|
|
946
908
|
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -972,9 +934,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
972
934
|
* Renames column in the given table.
|
|
973
935
|
*/
|
|
974
936
|
PostgresQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
975
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
937
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
976
938
|
var table, _a, oldColumn, newColumn;
|
|
977
|
-
return tslib_1.__generator(this, function (_b) {
|
|
939
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
978
940
|
switch (_b.label) {
|
|
979
941
|
case 0:
|
|
980
942
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1005,10 +967,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1005
967
|
* Changes a column in the table.
|
|
1006
968
|
*/
|
|
1007
969
|
PostgresQueryRunner.prototype.changeColumn = function (tableOrName, oldTableColumnOrName, newColumn) {
|
|
1008
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
970
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1009
971
|
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
972
|
var _this = this;
|
|
1011
|
-
return tslib_1.__generator(this, function (_b) {
|
|
973
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1012
974
|
switch (_b.label) {
|
|
1013
975
|
case 0:
|
|
1014
976
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1274,14 +1236,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1274
1236
|
* Changes a column in the table.
|
|
1275
1237
|
*/
|
|
1276
1238
|
PostgresQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
1277
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1239
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1278
1240
|
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_4_1;
|
|
1279
1241
|
var e_4, _b;
|
|
1280
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1242
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1281
1243
|
switch (_c.label) {
|
|
1282
1244
|
case 0:
|
|
1283
1245
|
_c.trys.push([0, 5, 6, 7]);
|
|
1284
|
-
changedColumns_1 = tslib_1.__values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1246
|
+
changedColumns_1 = (0, tslib_1.__values)(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1285
1247
|
_c.label = 1;
|
|
1286
1248
|
case 1:
|
|
1287
1249
|
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1313,9 +1275,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1313
1275
|
* Drops column in the table.
|
|
1314
1276
|
*/
|
|
1315
1277
|
PostgresQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1316
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1278
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1317
1279
|
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) {
|
|
1280
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1319
1281
|
switch (_b.label) {
|
|
1320
1282
|
case 0:
|
|
1321
1283
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1395,14 +1357,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1395
1357
|
* Drops the columns in the table.
|
|
1396
1358
|
*/
|
|
1397
1359
|
PostgresQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1398
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1360
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1399
1361
|
var columns_2, columns_2_1, column, e_5_1;
|
|
1400
1362
|
var e_5, _a;
|
|
1401
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1363
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1402
1364
|
switch (_b.label) {
|
|
1403
1365
|
case 0:
|
|
1404
1366
|
_b.trys.push([0, 5, 6, 7]);
|
|
1405
|
-
columns_2 = tslib_1.__values(columns), columns_2_1 = columns_2.next();
|
|
1367
|
+
columns_2 = (0, tslib_1.__values)(columns), columns_2_1 = columns_2.next();
|
|
1406
1368
|
_b.label = 1;
|
|
1407
1369
|
case 1:
|
|
1408
1370
|
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1434,9 +1396,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1434
1396
|
* Creates a new primary key.
|
|
1435
1397
|
*/
|
|
1436
1398
|
PostgresQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1437
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1399
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1438
1400
|
var table, _a, clonedTable, up, down;
|
|
1439
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1401
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1440
1402
|
switch (_b.label) {
|
|
1441
1403
|
case 0:
|
|
1442
1404
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1469,9 +1431,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1469
1431
|
* Updates composite primary keys.
|
|
1470
1432
|
*/
|
|
1471
1433
|
PostgresQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1472
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1434
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1473
1435
|
var table, _a, clonedTable, columnNames, upQueries, downQueries, primaryColumns, pkName_3, columnNamesString_1, pkName, columnNamesString;
|
|
1474
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1436
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1475
1437
|
switch (_b.label) {
|
|
1476
1438
|
case 0:
|
|
1477
1439
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1515,9 +1477,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1515
1477
|
* Drops a primary key.
|
|
1516
1478
|
*/
|
|
1517
1479
|
PostgresQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1518
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1480
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1519
1481
|
var table, _a, up, down;
|
|
1520
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1482
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1521
1483
|
switch (_b.label) {
|
|
1522
1484
|
case 0:
|
|
1523
1485
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1546,9 +1508,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1546
1508
|
* Creates new unique constraint.
|
|
1547
1509
|
*/
|
|
1548
1510
|
PostgresQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1549
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1511
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1550
1512
|
var table, _a, up, down;
|
|
1551
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1513
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1552
1514
|
switch (_b.label) {
|
|
1553
1515
|
case 0:
|
|
1554
1516
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1578,14 +1540,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1578
1540
|
* Creates new unique constraints.
|
|
1579
1541
|
*/
|
|
1580
1542
|
PostgresQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1581
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1543
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1582
1544
|
var uniqueConstraints_1, uniqueConstraints_1_1, uniqueConstraint, e_6_1;
|
|
1583
1545
|
var e_6, _a;
|
|
1584
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1546
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1585
1547
|
switch (_b.label) {
|
|
1586
1548
|
case 0:
|
|
1587
1549
|
_b.trys.push([0, 5, 6, 7]);
|
|
1588
|
-
uniqueConstraints_1 = tslib_1.__values(uniqueConstraints), uniqueConstraints_1_1 = uniqueConstraints_1.next();
|
|
1550
|
+
uniqueConstraints_1 = (0, tslib_1.__values)(uniqueConstraints), uniqueConstraints_1_1 = uniqueConstraints_1.next();
|
|
1589
1551
|
_b.label = 1;
|
|
1590
1552
|
case 1:
|
|
1591
1553
|
if (!!uniqueConstraints_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1617,9 +1579,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1617
1579
|
* Drops unique constraint.
|
|
1618
1580
|
*/
|
|
1619
1581
|
PostgresQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1620
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1582
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1621
1583
|
var table, _a, uniqueConstraint, up, down;
|
|
1622
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1584
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1623
1585
|
switch (_b.label) {
|
|
1624
1586
|
case 0:
|
|
1625
1587
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1649,14 +1611,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1649
1611
|
* Drops unique constraints.
|
|
1650
1612
|
*/
|
|
1651
1613
|
PostgresQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1652
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1614
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1653
1615
|
var uniqueConstraints_2, uniqueConstraints_2_1, uniqueConstraint, e_7_1;
|
|
1654
1616
|
var e_7, _a;
|
|
1655
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1617
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1656
1618
|
switch (_b.label) {
|
|
1657
1619
|
case 0:
|
|
1658
1620
|
_b.trys.push([0, 5, 6, 7]);
|
|
1659
|
-
uniqueConstraints_2 = tslib_1.__values(uniqueConstraints), uniqueConstraints_2_1 = uniqueConstraints_2.next();
|
|
1621
|
+
uniqueConstraints_2 = (0, tslib_1.__values)(uniqueConstraints), uniqueConstraints_2_1 = uniqueConstraints_2.next();
|
|
1660
1622
|
_b.label = 1;
|
|
1661
1623
|
case 1:
|
|
1662
1624
|
if (!!uniqueConstraints_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1688,9 +1650,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1688
1650
|
* Creates new check constraint.
|
|
1689
1651
|
*/
|
|
1690
1652
|
PostgresQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1691
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1653
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1692
1654
|
var table, _a, up, down;
|
|
1693
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1655
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1694
1656
|
switch (_b.label) {
|
|
1695
1657
|
case 0:
|
|
1696
1658
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1720,10 +1682,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1720
1682
|
* Creates new check constraints.
|
|
1721
1683
|
*/
|
|
1722
1684
|
PostgresQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1723
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1685
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1724
1686
|
var promises;
|
|
1725
1687
|
var _this = this;
|
|
1726
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1688
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1727
1689
|
switch (_a.label) {
|
|
1728
1690
|
case 0:
|
|
1729
1691
|
promises = checkConstraints.map(function (checkConstraint) { return _this.createCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1739,9 +1701,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1739
1701
|
* Drops check constraint.
|
|
1740
1702
|
*/
|
|
1741
1703
|
PostgresQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1742
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1704
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1743
1705
|
var table, _a, checkConstraint, up, down;
|
|
1744
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1706
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1745
1707
|
switch (_b.label) {
|
|
1746
1708
|
case 0:
|
|
1747
1709
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1771,10 +1733,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1771
1733
|
* Drops check constraints.
|
|
1772
1734
|
*/
|
|
1773
1735
|
PostgresQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1774
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1736
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1775
1737
|
var promises;
|
|
1776
1738
|
var _this = this;
|
|
1777
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1739
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1778
1740
|
switch (_a.label) {
|
|
1779
1741
|
case 0:
|
|
1780
1742
|
promises = checkConstraints.map(function (checkConstraint) { return _this.dropCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1790,9 +1752,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1790
1752
|
* Creates new exclusion constraint.
|
|
1791
1753
|
*/
|
|
1792
1754
|
PostgresQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1793
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1755
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1794
1756
|
var table, _a, up, down;
|
|
1795
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1757
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1796
1758
|
switch (_b.label) {
|
|
1797
1759
|
case 0:
|
|
1798
1760
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1822,10 +1784,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1822
1784
|
* Creates new exclusion constraints.
|
|
1823
1785
|
*/
|
|
1824
1786
|
PostgresQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1825
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1787
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1826
1788
|
var promises;
|
|
1827
1789
|
var _this = this;
|
|
1828
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1790
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1829
1791
|
switch (_a.label) {
|
|
1830
1792
|
case 0:
|
|
1831
1793
|
promises = exclusionConstraints.map(function (exclusionConstraint) { return _this.createExclusionConstraint(tableOrName, exclusionConstraint); });
|
|
@@ -1841,9 +1803,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1841
1803
|
* Drops exclusion constraint.
|
|
1842
1804
|
*/
|
|
1843
1805
|
PostgresQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1844
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1806
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1845
1807
|
var table, _a, exclusionConstraint, up, down;
|
|
1846
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1808
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1847
1809
|
switch (_b.label) {
|
|
1848
1810
|
case 0:
|
|
1849
1811
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1873,10 +1835,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1873
1835
|
* Drops exclusion constraints.
|
|
1874
1836
|
*/
|
|
1875
1837
|
PostgresQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1876
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1838
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1877
1839
|
var promises;
|
|
1878
1840
|
var _this = this;
|
|
1879
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1841
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1880
1842
|
switch (_a.label) {
|
|
1881
1843
|
case 0:
|
|
1882
1844
|
promises = exclusionConstraints.map(function (exclusionConstraint) { return _this.dropExclusionConstraint(tableOrName, exclusionConstraint); });
|
|
@@ -1892,9 +1854,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1892
1854
|
* Creates a new foreign key.
|
|
1893
1855
|
*/
|
|
1894
1856
|
PostgresQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1895
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1857
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1896
1858
|
var table, _a, up, down;
|
|
1897
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1859
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1898
1860
|
switch (_b.label) {
|
|
1899
1861
|
case 0:
|
|
1900
1862
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1924,14 +1886,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1924
1886
|
* Creates a new foreign keys.
|
|
1925
1887
|
*/
|
|
1926
1888
|
PostgresQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1927
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1889
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1928
1890
|
var foreignKeys_1, foreignKeys_1_1, foreignKey, e_8_1;
|
|
1929
1891
|
var e_8, _a;
|
|
1930
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1892
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1931
1893
|
switch (_b.label) {
|
|
1932
1894
|
case 0:
|
|
1933
1895
|
_b.trys.push([0, 5, 6, 7]);
|
|
1934
|
-
foreignKeys_1 = tslib_1.__values(foreignKeys), foreignKeys_1_1 = foreignKeys_1.next();
|
|
1896
|
+
foreignKeys_1 = (0, tslib_1.__values)(foreignKeys), foreignKeys_1_1 = foreignKeys_1.next();
|
|
1935
1897
|
_b.label = 1;
|
|
1936
1898
|
case 1:
|
|
1937
1899
|
if (!!foreignKeys_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1963,9 +1925,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1963
1925
|
* Drops a foreign key from the table.
|
|
1964
1926
|
*/
|
|
1965
1927
|
PostgresQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1966
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1928
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1967
1929
|
var table, _a, foreignKey, up, down;
|
|
1968
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1930
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1969
1931
|
switch (_b.label) {
|
|
1970
1932
|
case 0:
|
|
1971
1933
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1995,14 +1957,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
1995
1957
|
* Drops a foreign keys from the table.
|
|
1996
1958
|
*/
|
|
1997
1959
|
PostgresQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1998
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1960
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1999
1961
|
var foreignKeys_2, foreignKeys_2_1, foreignKey, e_9_1;
|
|
2000
1962
|
var e_9, _a;
|
|
2001
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1963
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2002
1964
|
switch (_b.label) {
|
|
2003
1965
|
case 0:
|
|
2004
1966
|
_b.trys.push([0, 5, 6, 7]);
|
|
2005
|
-
foreignKeys_2 = tslib_1.__values(foreignKeys), foreignKeys_2_1 = foreignKeys_2.next();
|
|
1967
|
+
foreignKeys_2 = (0, tslib_1.__values)(foreignKeys), foreignKeys_2_1 = foreignKeys_2.next();
|
|
2006
1968
|
_b.label = 1;
|
|
2007
1969
|
case 1:
|
|
2008
1970
|
if (!!foreignKeys_2_1.done) return [3 /*break*/, 4];
|
|
@@ -2034,9 +1996,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2034
1996
|
* Creates a new index.
|
|
2035
1997
|
*/
|
|
2036
1998
|
PostgresQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
2037
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1999
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2038
2000
|
var table, _a, up, down;
|
|
2039
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2001
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2040
2002
|
switch (_b.label) {
|
|
2041
2003
|
case 0:
|
|
2042
2004
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -2066,14 +2028,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2066
2028
|
* Creates a new indices
|
|
2067
2029
|
*/
|
|
2068
2030
|
PostgresQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
2069
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2031
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2070
2032
|
var indices_1, indices_1_1, index, e_10_1;
|
|
2071
2033
|
var e_10, _a;
|
|
2072
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2034
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2073
2035
|
switch (_b.label) {
|
|
2074
2036
|
case 0:
|
|
2075
2037
|
_b.trys.push([0, 5, 6, 7]);
|
|
2076
|
-
indices_1 = tslib_1.__values(indices), indices_1_1 = indices_1.next();
|
|
2038
|
+
indices_1 = (0, tslib_1.__values)(indices), indices_1_1 = indices_1.next();
|
|
2077
2039
|
_b.label = 1;
|
|
2078
2040
|
case 1:
|
|
2079
2041
|
if (!!indices_1_1.done) return [3 /*break*/, 4];
|
|
@@ -2105,9 +2067,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2105
2067
|
* Drops an index from the table.
|
|
2106
2068
|
*/
|
|
2107
2069
|
PostgresQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
2108
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2070
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2109
2071
|
var table, _a, index, up, down;
|
|
2110
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2072
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2111
2073
|
switch (_b.label) {
|
|
2112
2074
|
case 0:
|
|
2113
2075
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -2137,14 +2099,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2137
2099
|
* Drops an indices from the table.
|
|
2138
2100
|
*/
|
|
2139
2101
|
PostgresQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
2140
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2102
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2141
2103
|
var indices_2, indices_2_1, index, e_11_1;
|
|
2142
2104
|
var e_11, _a;
|
|
2143
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2105
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2144
2106
|
switch (_b.label) {
|
|
2145
2107
|
case 0:
|
|
2146
2108
|
_b.trys.push([0, 5, 6, 7]);
|
|
2147
|
-
indices_2 = tslib_1.__values(indices), indices_2_1 = indices_2.next();
|
|
2109
|
+
indices_2 = (0, tslib_1.__values)(indices), indices_2_1 = indices_2.next();
|
|
2148
2110
|
_b.label = 1;
|
|
2149
2111
|
case 1:
|
|
2150
2112
|
if (!!indices_2_1.done) return [3 /*break*/, 4];
|
|
@@ -2177,8 +2139,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2177
2139
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
2178
2140
|
*/
|
|
2179
2141
|
PostgresQueryRunner.prototype.clearTable = function (tableName) {
|
|
2180
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2181
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2142
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2143
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2182
2144
|
switch (_a.label) {
|
|
2183
2145
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tableName))];
|
|
2184
2146
|
case 1:
|
|
@@ -2192,10 +2154,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2192
2154
|
* Removes all tables from the currently connected database.
|
|
2193
2155
|
*/
|
|
2194
2156
|
PostgresQueryRunner.prototype.clearDatabase = function () {
|
|
2195
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2157
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2196
2158
|
var schemas, schemaNamesString, version, selectViewDropsQuery, dropViewQueries, selectMatViewDropsQuery, dropMatViewQueries, selectTableDropsQuery, dropTableQueries, error_2, rollbackError_1;
|
|
2197
2159
|
var _this = this;
|
|
2198
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2160
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2199
2161
|
switch (_a.label) {
|
|
2200
2162
|
case 0:
|
|
2201
2163
|
schemas = [];
|
|
@@ -2278,10 +2240,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2278
2240
|
// Protected Methods
|
|
2279
2241
|
// -------------------------------------------------------------------------
|
|
2280
2242
|
PostgresQueryRunner.prototype.loadViews = function (viewNames) {
|
|
2281
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2243
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2282
2244
|
var hasTable, currentDatabase, currentSchema, viewsCondition, query, dbViews;
|
|
2283
2245
|
var _this = this;
|
|
2284
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2246
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2285
2247
|
switch (_a.label) {
|
|
2286
2248
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
2287
2249
|
case 1:
|
|
@@ -2331,10 +2293,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2331
2293
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
2332
2294
|
*/
|
|
2333
2295
|
PostgresQueryRunner.prototype.loadTables = function (tableNames) {
|
|
2334
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2296
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2335
2297
|
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
2298
|
var _this = this;
|
|
2337
|
-
return tslib_1.__generator(this, function (_k) {
|
|
2299
|
+
return (0, tslib_1.__generator)(this, function (_k) {
|
|
2338
2300
|
switch (_k.label) {
|
|
2339
2301
|
case 0:
|
|
2340
2302
|
// if no tables given then no need to proceed
|
|
@@ -2355,7 +2317,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2355
2317
|
_d = [[]];
|
|
2356
2318
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2357
2319
|
case 3:
|
|
2358
|
-
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2320
|
+
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2359
2321
|
return [3 /*break*/, 6];
|
|
2360
2322
|
case 4:
|
|
2361
2323
|
tablesCondition = tableNames
|
|
@@ -2370,7 +2332,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2370
2332
|
_h = [[]];
|
|
2371
2333
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2372
2334
|
case 5:
|
|
2373
|
-
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2335
|
+
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2374
2336
|
_k.label = 6;
|
|
2375
2337
|
case 6:
|
|
2376
2338
|
// if tables were not found in the db, no need to proceed
|
|
@@ -2450,10 +2412,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2450
2412
|
case 8:
|
|
2451
2413
|
_j = tslib_1.__read.apply(void 0, [_k.sent(), 4]), dbColumns = _j[0], dbConstraints = _j[1], dbIndices = _j[2], dbForeignKeys = _j[3];
|
|
2452
2414
|
// 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 () {
|
|
2415
|
+
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2454
2416
|
var table, getSchemaFromKey, schema, _a, tableUniqueConstraints, tableCheckConstraints, tableExclusionConstraints, tableForeignKeyConstraints, tableIndexConstraints;
|
|
2455
2417
|
var _this = this;
|
|
2456
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2418
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2457
2419
|
switch (_b.label) {
|
|
2458
2420
|
case 0:
|
|
2459
2421
|
table = new Table_1.Table();
|
|
@@ -2470,9 +2432,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2470
2432
|
_a = table;
|
|
2471
2433
|
return [4 /*yield*/, Promise.all(dbColumns
|
|
2472
2434
|
.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 () {
|
|
2435
|
+
.map(function (dbColumn) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2474
2436
|
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) {
|
|
2437
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2476
2438
|
switch (_a.label) {
|
|
2477
2439
|
case 0:
|
|
2478
2440
|
columnConstraints = dbConstraints.filter(function (dbConstraint) {
|
|
@@ -2765,9 +2727,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2765
2727
|
* Loads Postgres version.
|
|
2766
2728
|
*/
|
|
2767
2729
|
PostgresQueryRunner.prototype.getVersion = function () {
|
|
2768
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2730
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2769
2731
|
var result;
|
|
2770
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2732
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2771
2733
|
switch (_a.label) {
|
|
2772
2734
|
case 0: return [4 /*yield*/, this.query("SHOW SERVER_VERSION")];
|
|
2773
2735
|
case 1:
|
|
@@ -2794,9 +2756,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2794
2756
|
}
|
|
2795
2757
|
};
|
|
2796
2758
|
PostgresQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2797
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2759
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2798
2760
|
var currentSchema, _a, schema, name, type, expression, _b, query, parameters;
|
|
2799
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2761
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2800
2762
|
switch (_c.label) {
|
|
2801
2763
|
case 0: return [4 /*yield*/, this.getCurrentSchema()];
|
|
2802
2764
|
case 1:
|
|
@@ -2807,7 +2769,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2807
2769
|
}
|
|
2808
2770
|
type = view.materialized ? "MATERIALIZED_VIEW" : "VIEW";
|
|
2809
2771
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2810
|
-
_b = tslib_1.__read(this.connection.createQueryBuilder()
|
|
2772
|
+
_b = (0, tslib_1.__read)(this.connection.createQueryBuilder()
|
|
2811
2773
|
.insert()
|
|
2812
2774
|
.into(this.getTypeormMetadataTableName())
|
|
2813
2775
|
.values({ type: type, schema: schema, name: name, value: expression })
|
|
@@ -2828,9 +2790,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2828
2790
|
* Builds remove view sql.
|
|
2829
2791
|
*/
|
|
2830
2792
|
PostgresQueryRunner.prototype.deleteViewDefinitionSql = function (view) {
|
|
2831
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2793
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2832
2794
|
var currentSchema, _a, schema, name, type, qb, _b, query, parameters;
|
|
2833
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2795
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2834
2796
|
switch (_c.label) {
|
|
2835
2797
|
case 0: return [4 /*yield*/, this.getCurrentSchema()];
|
|
2836
2798
|
case 1:
|
|
@@ -2841,7 +2803,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2841
2803
|
}
|
|
2842
2804
|
type = view.materialized ? "MATERIALIZED_VIEW" : "VIEW";
|
|
2843
2805
|
qb = this.connection.createQueryBuilder();
|
|
2844
|
-
_b = tslib_1.__read(qb.delete()
|
|
2806
|
+
_b = (0, tslib_1.__read)(qb.delete()
|
|
2845
2807
|
.from(this.getTypeormMetadataTableName())
|
|
2846
2808
|
.where(qb.escape("type") + " = :type", { type: type })
|
|
2847
2809
|
.andWhere(qb.escape("schema") + " = :schema", { schema: schema })
|
|
@@ -2856,10 +2818,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2856
2818
|
* Drops ENUM type from given schemas.
|
|
2857
2819
|
*/
|
|
2858
2820
|
PostgresQueryRunner.prototype.dropEnumTypes = function (schemaNames) {
|
|
2859
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2821
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2860
2822
|
var selectDropsQuery, dropQueries;
|
|
2861
2823
|
var _this = this;
|
|
2862
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2824
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2863
2825
|
switch (_a.label) {
|
|
2864
2826
|
case 0:
|
|
2865
2827
|
selectDropsQuery = "SELECT 'DROP TYPE IF EXISTS \"' || n.nspname || '\".\"' || t.typname || '\" CASCADE;' as \"query\" FROM \"pg_type\" \"t\" " +
|
|
@@ -2881,9 +2843,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
2881
2843
|
* Checks if enum with the given name exist in the database.
|
|
2882
2844
|
*/
|
|
2883
2845
|
PostgresQueryRunner.prototype.hasEnumType = function (table, column) {
|
|
2884
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2846
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2885
2847
|
var schema, enumName, sql, result;
|
|
2886
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2848
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2887
2849
|
switch (_a.label) {
|
|
2888
2850
|
case 0:
|
|
2889
2851
|
schema = this.driver.parseTableName(table).schema;
|
|
@@ -3049,9 +3011,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
3049
3011
|
}).join(".");
|
|
3050
3012
|
};
|
|
3051
3013
|
PostgresQueryRunner.prototype.getUserDefinedTypeName = function (table, column) {
|
|
3052
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3014
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
3053
3015
|
var _a, schema, name, result, udtName;
|
|
3054
|
-
return tslib_1.__generator(this, function (_b) {
|
|
3016
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
3055
3017
|
switch (_b.label) {
|
|
3056
3018
|
case 0:
|
|
3057
3019
|
_a = this.driver.parseTableName(table), schema = _a.schema, name = _a.tableName;
|
|
@@ -3135,9 +3097,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
|
|
|
3135
3097
|
* Checks if the PostgreSQL server has support for partitioned tables
|
|
3136
3098
|
*/
|
|
3137
3099
|
PostgresQueryRunner.prototype.hasSupportForPartitionedTables = function () {
|
|
3138
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3100
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
3139
3101
|
var result;
|
|
3140
|
-
return tslib_1.__generator(this, function (_a) {
|
|
3102
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
3141
3103
|
switch (_a.label) {
|
|
3142
3104
|
case 0: return [4 /*yield*/, this.query("SELECT TRUE FROM information_schema.columns WHERE table_name = 'pg_class' and column_name = 'relispartition'")];
|
|
3143
3105
|
case 1:
|