typeorm 0.2.38-dev.d8f6037 → 0.2.39-dev.179ae75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -59
- package/browser/connection/ConnectionMetadataBuilder.js +4 -4
- package/browser/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/browser/connection/ConnectionOptionsReader.js +2 -1
- package/browser/connection/ConnectionOptionsReader.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/browser/decorator/transaction/Transaction.js +3 -3
- package/browser/decorator/transaction/Transaction.js.map +1 -1
- package/browser/driver/DriverUtils.js +1 -1
- package/browser/driver/DriverUtils.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +5 -0
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js +6 -5
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +19 -48
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +5 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +2 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +17 -46
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +5 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js +4 -3
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachConnectionOptions.d.ts +10 -0
- package/browser/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachDriver.js +5 -4
- package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +46 -77
- package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/browser/driver/cordova/CordovaConnectionOptions.d.ts +5 -0
- package/browser/driver/cordova/CordovaConnectionOptions.js.map +1 -1
- package/browser/driver/cordova/CordovaDriver.js +2 -1
- package/browser/driver/cordova/CordovaDriver.js.map +1 -1
- package/browser/driver/expo/ExpoQueryRunner.js +12 -43
- package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/MongoConnectionOptions.d.ts +5 -0
- package/browser/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/browser/driver/mongodb/MongoDriver.js +2 -1
- package/browser/driver/mongodb/MongoDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlConnectionOptions.d.ts +6 -0
- package/browser/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/browser/driver/mysql/MysqlDriver.js +4 -2
- package/browser/driver/mysql/MysqlDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.js +24 -54
- package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/browser/driver/nativescript/NativescriptQueryRunner.js +45 -37
- package/browser/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/browser/driver/oracle/OracleConnectionOptions.d.ts +5 -0
- package/browser/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/browser/driver/oracle/OracleDriver.js +5 -4
- package/browser/driver/oracle/OracleDriver.js.map +1 -1
- package/browser/driver/oracle/OracleQueryRunner.js +20 -48
- package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.d.ts +10 -0
- package/browser/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresDriver.js +6 -5
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +21 -51
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/react-native/ReactNativeConnectionOptions.d.ts +5 -0
- package/browser/driver/react-native/ReactNativeConnectionOptions.js.map +1 -1
- package/browser/driver/react-native/ReactNativeDriver.js +2 -1
- package/browser/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/browser/driver/sap/SapConnectionOptions.d.ts +16 -6
- package/browser/driver/sap/SapConnectionOptions.js.map +1 -1
- package/browser/driver/sap/SapDriver.js +6 -3
- package/browser/driver/sap/SapDriver.js.map +1 -1
- package/browser/driver/sap/SapQueryRunner.js +20 -50
- package/browser/driver/sap/SapQueryRunner.js.map +1 -1
- package/browser/driver/sqlite/SqliteConnectionOptions.d.ts +5 -0
- package/browser/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/browser/driver/sqlite/SqliteDriver.js +4 -3
- package/browser/driver/sqlite/SqliteDriver.js.map +1 -1
- package/browser/driver/sqlite/SqliteQueryRunner.js +16 -8
- package/browser/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +19 -49
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqljs/SqljsConnectionOptions.d.ts +5 -0
- package/browser/driver/sqljs/SqljsConnectionOptions.js.map +1 -1
- package/browser/driver/sqljs/SqljsDriver.js +4 -2
- package/browser/driver/sqljs/SqljsDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/browser/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerDriver.js +7 -6
- package/browser/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.js +84 -116
- package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/browser/entity-manager/MongoEntityManager.js +8 -13
- package/browser/entity-manager/MongoEntityManager.js.map +1 -1
- package/browser/find-options/FindOptionsUtils.js +1 -1
- package/browser/find-options/FindOptionsUtils.js.map +1 -1
- package/browser/metadata/ColumnMetadata.js +4 -4
- package/browser/metadata/ColumnMetadata.js.map +1 -1
- package/browser/metadata/EmbeddedMetadata.js +1 -1
- package/browser/metadata/EmbeddedMetadata.js.map +1 -1
- package/browser/metadata/EntityMetadata.js +1 -1
- package/browser/metadata/EntityMetadata.js.map +1 -1
- package/browser/metadata/RelationMetadata.js +4 -4
- package/browser/metadata/RelationMetadata.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/browser/naming-strategy/DefaultNamingStrategy.js +5 -5
- package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/browser/persistence/Subject.js +1 -1
- package/browser/persistence/Subject.js.map +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/browser/persistence/SubjectExecutor.js +1 -1
- package/browser/persistence/SubjectExecutor.js.map +1 -1
- package/browser/persistence/SubjectTopoligicalSorter.js +5 -5
- package/browser/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/browser/persistence/tree/ClosureSubjectExecutor.js +4 -4
- package/browser/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
- package/browser/query-builder/DeleteQueryBuilder.js +3 -10
- package/browser/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/InsertQueryBuilder.js +4 -6
- package/browser/query-builder/InsertQueryBuilder.js.map +1 -1
- package/browser/query-builder/QueryBuilder.js +9 -9
- package/browser/query-builder/QueryBuilder.js.map +1 -1
- package/browser/query-builder/RelationLoader.js +2 -2
- package/browser/query-builder/RelationLoader.js.map +1 -1
- package/browser/query-builder/RelationRemover.js +6 -6
- package/browser/query-builder/RelationRemover.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.js +14 -14
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-builder/SoftDeleteQueryBuilder.js +3 -10
- package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/UpdateQueryBuilder.js +5 -12
- package/browser/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/browser/query-builder/relation-id/RelationIdLoader.js +1 -1
- package/browser/query-builder/relation-id/RelationIdLoader.js.map +1 -1
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js +2 -2
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.js +2 -2
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/query-runner/QueryLock.js +1 -1
- package/browser/query-runner/QueryLock.js.map +1 -1
- package/browser/repository/BaseEntity.js +1 -1
- package/browser/repository/BaseEntity.js.map +1 -1
- package/browser/repository/Repository.js +1 -1
- package/browser/repository/Repository.js.map +1 -1
- package/browser/repository/TreeRepository.js +2 -2
- package/browser/repository/TreeRepository.js.map +1 -1
- package/browser/schema-builder/table/TableCheck.js +1 -1
- package/browser/schema-builder/table/TableCheck.js.map +1 -1
- package/browser/schema-builder/table/TableForeignKey.js +2 -2
- package/browser/schema-builder/table/TableForeignKey.js.map +1 -1
- package/browser/schema-builder/table/TableIndex.js +1 -1
- package/browser/schema-builder/table/TableIndex.js.map +1 -1
- package/browser/schema-builder/table/TableUnique.js +1 -1
- package/browser/schema-builder/table/TableUnique.js.map +1 -1
- package/browser/subscriber/Broadcaster.d.ts +23 -2
- package/browser/subscriber/Broadcaster.js +35 -2
- package/browser/subscriber/Broadcaster.js.map +1 -1
- package/browser/subscriber/BroadcasterResult.d.ts +4 -0
- package/browser/subscriber/BroadcasterResult.js +19 -0
- package/browser/subscriber/BroadcasterResult.js.map +1 -1
- package/cache/DbQueryResultCache.js +12 -12
- package/cache/RedisQueryResultCache.js +12 -12
- package/cli.js +1 -6
- package/cli.js.map +1 -1
- package/commands/CacheClearCommand.js +4 -4
- package/commands/CacheClearCommand.js.map +1 -1
- package/commands/CommandUtils.js +10 -10
- package/commands/CommandUtils.js.map +1 -1
- package/commands/EntityCreateCommand.js +3 -3
- package/commands/EntityCreateCommand.js.map +1 -1
- package/commands/InitCommand.js +5 -5
- package/commands/InitCommand.js.map +1 -1
- package/commands/MigrationCreateCommand.js +5 -5
- package/commands/MigrationCreateCommand.js.map +1 -1
- package/commands/MigrationGenerateCommand.js +7 -7
- package/commands/MigrationGenerateCommand.js.map +1 -1
- package/commands/MigrationRevertCommand.js +4 -4
- package/commands/MigrationRevertCommand.js.map +1 -1
- package/commands/MigrationRunCommand.js +5 -5
- package/commands/MigrationRunCommand.js.map +1 -1
- package/commands/MigrationShowCommand.js +5 -5
- package/commands/MigrationShowCommand.js.map +1 -1
- package/commands/QueryCommand.js +4 -4
- package/commands/QueryCommand.js.map +1 -1
- package/commands/SchemaDropCommand.js +4 -4
- package/commands/SchemaDropCommand.js.map +1 -1
- package/commands/SchemaLogCommand.js +5 -5
- package/commands/SchemaLogCommand.js.map +1 -1
- package/commands/SchemaSyncCommand.js +4 -4
- package/commands/SchemaSyncCommand.js.map +1 -1
- package/commands/SubscriberCreateCommand.js +3 -3
- package/commands/SubscriberCreateCommand.js.map +1 -1
- package/commands/VersionCommand.js +3 -3
- package/commands/VersionCommand.js.map +1 -1
- package/connection/Connection.js +19 -19
- package/connection/Connection.js.map +1 -1
- package/connection/ConnectionMetadataBuilder.js +11 -11
- package/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/connection/ConnectionOptionsReader.js +11 -10
- package/connection/ConnectionOptionsReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsEnvReader.js +2 -2
- package/connection/options-reader/ConnectionOptionsXmlReader.js +3 -3
- package/connection/options-reader/ConnectionOptionsXmlReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsYmlReader.js +4 -4
- package/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/decorator/Check.js +1 -1
- package/decorator/Check.js.map +1 -1
- package/decorator/EntityRepository.js +1 -1
- package/decorator/EntityRepository.js.map +1 -1
- package/decorator/Exclusion.js +1 -1
- package/decorator/Exclusion.js.map +1 -1
- package/decorator/Generated.js +1 -1
- package/decorator/Generated.js.map +1 -1
- package/decorator/Index.js +1 -1
- package/decorator/Index.js.map +1 -1
- package/decorator/Unique.js +1 -1
- package/decorator/Unique.js.map +1 -1
- package/decorator/columns/Column.js +4 -4
- package/decorator/columns/Column.js.map +1 -1
- package/decorator/columns/CreateDateColumn.js +1 -1
- package/decorator/columns/CreateDateColumn.js.map +1 -1
- package/decorator/columns/DeleteDateColumn.js +1 -1
- package/decorator/columns/DeleteDateColumn.js.map +1 -1
- package/decorator/columns/ObjectIdColumn.js +1 -1
- package/decorator/columns/ObjectIdColumn.js.map +1 -1
- package/decorator/columns/PrimaryColumn.js +2 -2
- package/decorator/columns/PrimaryColumn.js.map +1 -1
- package/decorator/columns/PrimaryGeneratedColumn.js +2 -2
- package/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/decorator/columns/UpdateDateColumn.js +1 -1
- package/decorator/columns/UpdateDateColumn.js.map +1 -1
- package/decorator/columns/VersionColumn.js +1 -1
- package/decorator/columns/VersionColumn.js.map +1 -1
- package/decorator/columns/ViewColumn.js +1 -1
- package/decorator/columns/ViewColumn.js.map +1 -1
- package/decorator/entity/ChildEntity.js +2 -2
- package/decorator/entity/ChildEntity.js.map +1 -1
- package/decorator/entity/Entity.js +1 -1
- package/decorator/entity/Entity.js.map +1 -1
- package/decorator/entity/TableInheritance.js +1 -1
- package/decorator/entity/TableInheritance.js.map +1 -1
- package/decorator/entity-view/ViewEntity.js +1 -1
- package/decorator/entity-view/ViewEntity.js.map +1 -1
- package/decorator/listeners/AfterInsert.js +1 -1
- package/decorator/listeners/AfterInsert.js.map +1 -1
- package/decorator/listeners/AfterLoad.js +1 -1
- package/decorator/listeners/AfterLoad.js.map +1 -1
- package/decorator/listeners/AfterRemove.js +1 -1
- package/decorator/listeners/AfterRemove.js.map +1 -1
- package/decorator/listeners/AfterUpdate.js +1 -1
- package/decorator/listeners/AfterUpdate.js.map +1 -1
- package/decorator/listeners/BeforeInsert.js +1 -1
- package/decorator/listeners/BeforeInsert.js.map +1 -1
- package/decorator/listeners/BeforeRemove.js +1 -1
- package/decorator/listeners/BeforeRemove.js.map +1 -1
- package/decorator/listeners/BeforeUpdate.js +1 -1
- package/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/decorator/listeners/EventSubscriber.js +1 -1
- package/decorator/listeners/EventSubscriber.js.map +1 -1
- package/decorator/relations/JoinColumn.js +1 -1
- package/decorator/relations/JoinColumn.js.map +1 -1
- package/decorator/relations/JoinTable.js +1 -1
- package/decorator/relations/JoinTable.js.map +1 -1
- package/decorator/relations/ManyToMany.js +1 -1
- package/decorator/relations/ManyToMany.js.map +1 -1
- package/decorator/relations/ManyToOne.js +1 -1
- package/decorator/relations/ManyToOne.js.map +1 -1
- package/decorator/relations/OneToMany.js +1 -1
- package/decorator/relations/OneToMany.js.map +1 -1
- package/decorator/relations/OneToOne.js +1 -1
- package/decorator/relations/OneToOne.js.map +1 -1
- package/decorator/relations/RelationCount.js +1 -1
- package/decorator/relations/RelationCount.js.map +1 -1
- package/decorator/relations/RelationId.js +1 -1
- package/decorator/relations/RelationId.js.map +1 -1
- package/decorator/transaction/Transaction.js +7 -7
- package/decorator/transaction/Transaction.js.map +1 -1
- package/decorator/transaction/TransactionManager.js +1 -1
- package/decorator/transaction/TransactionManager.js.map +1 -1
- package/decorator/transaction/TransactionRepository.js +1 -1
- package/decorator/transaction/TransactionRepository.js.map +1 -1
- package/decorator/tree/Tree.js +1 -1
- package/decorator/tree/Tree.js.map +1 -1
- package/decorator/tree/TreeChildren.js +1 -1
- package/decorator/tree/TreeChildren.js.map +1 -1
- package/decorator/tree/TreeLevelColumn.js +1 -1
- package/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/decorator/tree/TreeParent.js +1 -1
- package/decorator/tree/TreeParent.js.map +1 -1
- package/driver/DriverUtils.js +9 -9
- package/driver/DriverUtils.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +5 -0
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiDriver.js +12 -11
- package/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +146 -175
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +5 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +10 -9
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +29 -58
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +5 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3Driver.js +12 -11
- package/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +5 -5
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/driver/capacitor/CapacitorDriver.js +7 -7
- package/driver/capacitor/CapacitorDriver.js.map +1 -1
- package/driver/capacitor/CapacitorQueryRunner.js +5 -5
- package/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
- package/driver/cockroachdb/CockroachConnectionOptions.d.ts +10 -0
- package/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/driver/cockroachdb/CockroachDriver.js +15 -14
- package/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +180 -211
- package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/driver/cordova/CordovaConnectionOptions.d.ts +5 -0
- package/driver/cordova/CordovaConnectionOptions.js.map +1 -1
- package/driver/cordova/CordovaDriver.js +5 -4
- package/driver/cordova/CordovaDriver.js.map +1 -1
- package/driver/cordova/CordovaQueryRunner.js +13 -13
- package/driver/cordova/CordovaQueryRunner.js.map +1 -1
- package/driver/expo/ExpoDriver.js +3 -3
- package/driver/expo/ExpoDriver.js.map +1 -1
- package/driver/expo/ExpoQueryRunner.js +23 -54
- package/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/driver/mongodb/MongoConnectionOptions.d.ts +5 -0
- package/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/driver/mongodb/MongoDriver.js +4 -3
- package/driver/mongodb/MongoDriver.js.map +1 -1
- package/driver/mongodb/MongoQueryRunner.js +178 -178
- package/driver/mysql/MysqlConnectionOptions.d.ts +6 -0
- package/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/driver/mysql/MysqlDriver.js +9 -7
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.js +152 -182
- package/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/driver/nativescript/NativescriptDriver.js +3 -3
- package/driver/nativescript/NativescriptDriver.js.map +1 -1
- package/driver/nativescript/NativescriptQueryRunner.js +48 -40
- package/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/driver/oracle/OracleConnectionOptions.d.ts +5 -0
- package/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/driver/oracle/OracleDriver.js +13 -12
- package/driver/oracle/OracleDriver.js.map +1 -1
- package/driver/oracle/OracleQueryRunner.js +143 -171
- package/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/driver/postgres/PostgresConnectionOptions.d.ts +10 -0
- package/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/driver/postgres/PostgresDriver.js +24 -23
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.js +169 -199
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/react-native/ReactNativeConnectionOptions.d.ts +5 -0
- package/driver/react-native/ReactNativeConnectionOptions.js.map +1 -1
- package/driver/react-native/ReactNativeDriver.js +5 -4
- package/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/driver/react-native/ReactNativeQueryRunner.js +3 -3
- package/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
- package/driver/sap/SapConnectionOptions.d.ts +16 -6
- package/driver/sap/SapConnectionOptions.js.map +1 -1
- package/driver/sap/SapDriver.js +11 -8
- package/driver/sap/SapDriver.js.map +1 -1
- package/driver/sap/SapQueryRunner.js +153 -183
- package/driver/sap/SapQueryRunner.js.map +1 -1
- package/driver/sqlite/SqliteConnectionOptions.d.ts +5 -0
- package/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/driver/sqlite/SqliteDriver.js +12 -11
- package/driver/sqlite/SqliteDriver.js.map +1 -1
- package/driver/sqlite/SqliteQueryRunner.js +21 -13
- package/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteDriver.js +4 -4
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +138 -168
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqljs/SqljsConnectionOptions.d.ts +5 -0
- package/driver/sqljs/SqljsConnectionOptions.js.map +1 -1
- package/driver/sqljs/SqljsDriver.js +17 -15
- package/driver/sqljs/SqljsDriver.js.map +1 -1
- package/driver/sqljs/SqljsQueryRunner.js +9 -9
- package/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/driver/sqlserver/SqlServerDriver.js +13 -12
- package/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/driver/sqlserver/SqlServerQueryRunner.js +220 -252
- package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/entity-manager/EntityManager.js +30 -30
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-manager/MongoEntityManager.js +23 -28
- package/entity-manager/MongoEntityManager.js.map +1 -1
- package/entity-manager/SqljsEntityManager.js +5 -5
- package/entity-manager/SqljsEntityManager.js.map +1 -1
- package/entity-schema/EntitySchemaTransformer.js +1 -1
- package/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/error/AlreadyHasActiveConnectionError.js +1 -1
- package/error/AlreadyHasActiveConnectionError.js.map +1 -1
- package/error/CannotAttachTreeChildrenEntityError.js +1 -1
- package/error/CannotAttachTreeChildrenEntityError.js.map +1 -1
- package/error/CannotConnectAlreadyConnectedError.js +1 -1
- package/error/CannotConnectAlreadyConnectedError.js.map +1 -1
- package/error/CannotCreateEntityIdMapError.js +1 -1
- package/error/CannotCreateEntityIdMapError.js.map +1 -1
- package/error/CannotDetermineEntityError.js +1 -1
- package/error/CannotDetermineEntityError.js.map +1 -1
- package/error/CannotExecuteNotConnectedError.js +1 -1
- package/error/CannotExecuteNotConnectedError.js.map +1 -1
- package/error/CannotGetEntityManagerNotConnectedError.js +1 -1
- package/error/CannotGetEntityManagerNotConnectedError.js.map +1 -1
- package/error/CannotReflectMethodParameterTypeError.js +1 -1
- package/error/CannotReflectMethodParameterTypeError.js.map +1 -1
- package/error/CircularRelationsError.js +1 -1
- package/error/CircularRelationsError.js.map +1 -1
- package/error/ColumnTypeUndefinedError.js +1 -1
- package/error/ColumnTypeUndefinedError.js.map +1 -1
- package/error/ConnectionIsNotSetError.js +1 -1
- package/error/ConnectionIsNotSetError.js.map +1 -1
- package/error/ConnectionNotFoundError.js +1 -1
- package/error/ConnectionNotFoundError.js.map +1 -1
- package/error/CustomRepositoryCannotInheritRepositoryError.js +1 -1
- package/error/CustomRepositoryCannotInheritRepositoryError.js.map +1 -1
- package/error/CustomRepositoryDoesNotHaveEntityError.js +1 -1
- package/error/CustomRepositoryDoesNotHaveEntityError.js.map +1 -1
- package/error/CustomRepositoryNotFoundError.js +1 -1
- package/error/CustomRepositoryNotFoundError.js.map +1 -1
- package/error/DataTypeNotSupportedError.js +1 -1
- package/error/DataTypeNotSupportedError.js.map +1 -1
- package/error/DriverOptionNotSetError.js +1 -1
- package/error/DriverOptionNotSetError.js.map +1 -1
- package/error/DriverPackageNotInstalledError.js +1 -1
- package/error/DriverPackageNotInstalledError.js.map +1 -1
- package/error/EntityColumnNotFound.js +1 -1
- package/error/EntityColumnNotFound.js.map +1 -1
- package/error/EntityMetadataNotFoundError.js +1 -1
- package/error/EntityMetadataNotFoundError.js.map +1 -1
- package/error/EntityNotFoundError.js +1 -1
- package/error/EntityNotFoundError.js.map +1 -1
- package/error/FindRelationsNotFoundError.js +1 -1
- package/error/FindRelationsNotFoundError.js.map +1 -1
- package/error/InitializedRelationError.js +1 -1
- package/error/InitializedRelationError.js.map +1 -1
- package/error/InsertValuesMissingError.js +1 -1
- package/error/InsertValuesMissingError.js.map +1 -1
- package/error/LimitOnUpdateNotSupportedError.js +1 -1
- package/error/LimitOnUpdateNotSupportedError.js.map +1 -1
- package/error/LockNotSupportedOnGivenDriverError.js +1 -1
- package/error/LockNotSupportedOnGivenDriverError.js.map +1 -1
- package/error/MetadataAlreadyExistsError.js +1 -1
- package/error/MetadataAlreadyExistsError.js.map +1 -1
- package/error/MetadataWithSuchNameAlreadyExistsError.js +1 -1
- package/error/MetadataWithSuchNameAlreadyExistsError.js.map +1 -1
- package/error/MissingDeleteDateColumnError.js +1 -1
- package/error/MissingDeleteDateColumnError.js.map +1 -1
- package/error/MissingDriverError.js +1 -1
- package/error/MissingDriverError.js.map +1 -1
- package/error/MissingJoinColumnError.js +1 -1
- package/error/MissingJoinColumnError.js.map +1 -1
- package/error/MissingJoinTableError.js +1 -1
- package/error/MissingJoinTableError.js.map +1 -1
- package/error/MissingPrimaryColumnError.js +1 -1
- package/error/MissingPrimaryColumnError.js.map +1 -1
- package/error/MustBeEntityError.js +1 -1
- package/error/MustBeEntityError.js.map +1 -1
- package/error/NamingStrategyNotFoundError.js +1 -1
- package/error/NamingStrategyNotFoundError.js.map +1 -1
- package/error/NestedSetMultipleRootError.js +1 -1
- package/error/NestedSetMultipleRootError.js.map +1 -1
- package/error/NoConnectionForRepositoryError.js +1 -1
- package/error/NoConnectionForRepositoryError.js.map +1 -1
- package/error/NoConnectionOptionError.js +1 -1
- package/error/NoConnectionOptionError.js.map +1 -1
- package/error/NoNeedToReleaseEntityManagerError.js +1 -1
- package/error/NoNeedToReleaseEntityManagerError.js.map +1 -1
- package/error/NoVersionOrUpdateDateColumnError.js +1 -1
- package/error/NoVersionOrUpdateDateColumnError.js.map +1 -1
- package/error/OffsetWithoutLimitNotSupportedError.js +1 -1
- package/error/OffsetWithoutLimitNotSupportedError.js.map +1 -1
- package/error/OptimisticLockCanNotBeUsedError.js +1 -1
- package/error/OptimisticLockCanNotBeUsedError.js.map +1 -1
- package/error/OptimisticLockVersionMismatchError.js +1 -1
- package/error/OptimisticLockVersionMismatchError.js.map +1 -1
- package/error/PersistedEntityNotFoundError.js +1 -1
- package/error/PersistedEntityNotFoundError.js.map +1 -1
- package/error/PessimisticLockTransactionRequiredError.js +1 -1
- package/error/PessimisticLockTransactionRequiredError.js.map +1 -1
- package/error/PrimaryColumnCannotBeNullableError.js +1 -1
- package/error/PrimaryColumnCannotBeNullableError.js.map +1 -1
- package/error/QueryFailedError.js +3 -3
- package/error/QueryFailedError.js.map +1 -1
- package/error/QueryRunnerAlreadyReleasedError.js +1 -1
- package/error/QueryRunnerAlreadyReleasedError.js.map +1 -1
- package/error/QueryRunnerProviderAlreadyReleasedError.js +1 -1
- package/error/QueryRunnerProviderAlreadyReleasedError.js.map +1 -1
- package/error/RepositoryNotFoundError.js +1 -1
- package/error/RepositoryNotFoundError.js.map +1 -1
- package/error/RepositoryNotTreeError.js +1 -1
- package/error/RepositoryNotTreeError.js.map +1 -1
- package/error/ReturningStatementNotSupportedError.js +1 -1
- package/error/ReturningStatementNotSupportedError.js.map +1 -1
- package/error/SubjectRemovedAndUpdatedError.js +1 -1
- package/error/SubjectRemovedAndUpdatedError.js.map +1 -1
- package/error/SubjectWithoutIdentifierError.js +1 -1
- package/error/SubjectWithoutIdentifierError.js.map +1 -1
- package/error/TransactionAlreadyStartedError.js +1 -1
- package/error/TransactionAlreadyStartedError.js.map +1 -1
- package/error/TransactionNotStartedError.js +1 -1
- package/error/TransactionNotStartedError.js.map +1 -1
- package/error/TreeRepositoryNotSupportedError.js +1 -1
- package/error/TreeRepositoryNotSupportedError.js.map +1 -1
- package/error/TypeORMError.js +1 -1
- package/error/TypeORMError.js.map +1 -1
- package/error/UpdateValuesMissingError.js +1 -1
- package/error/UpdateValuesMissingError.js.map +1 -1
- package/error/UsingJoinColumnIsNotAllowedError.js +1 -1
- package/error/UsingJoinColumnIsNotAllowedError.js.map +1 -1
- package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +1 -1
- package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js.map +1 -1
- package/error/UsingJoinTableIsNotAllowedError.js +1 -1
- package/error/UsingJoinTableIsNotAllowedError.js.map +1 -1
- package/error/UsingJoinTableOnlyOnOneSideAllowedError.js +1 -1
- package/error/UsingJoinTableOnlyOnOneSideAllowedError.js.map +1 -1
- package/error/index.js +62 -62
- package/error/index.js.map +1 -1
- package/find-options/FindOptionsUtils.js +4 -4
- package/find-options/FindOptionsUtils.js.map +1 -1
- package/globals.js +7 -7
- package/globals.js.map +1 -1
- package/index.js +102 -102
- package/index.js.map +1 -1
- package/logger/DebugLogger.js +9 -9
- package/logger/DebugLogger.js.map +1 -1
- package/logger/FileLogger.js +1 -1
- package/logger/FileLogger.js.map +1 -1
- package/metadata/ColumnMetadata.js +4 -4
- package/metadata/ColumnMetadata.js.map +1 -1
- package/metadata/EmbeddedMetadata.js +1 -1
- package/metadata/EmbeddedMetadata.js.map +1 -1
- package/metadata/EntityMetadata.js +2 -2
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/RelationMetadata.js +4 -4
- package/metadata/RelationMetadata.js.map +1 -1
- package/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/migration/MigrationExecutor.js +33 -33
- package/migration/MigrationExecutor.js.map +1 -1
- package/naming-strategy/DefaultNamingStrategy.js +10 -10
- package/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/package.json +1 -1
- package/persistence/EntityPersistExecutor.js +5 -5
- package/persistence/EntityPersistExecutor.js.map +1 -1
- package/persistence/Subject.js +1 -1
- package/persistence/Subject.js.map +1 -1
- package/persistence/SubjectDatabaseEntityLoader.js +6 -6
- package/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/persistence/SubjectExecutor.js +31 -31
- package/persistence/SubjectExecutor.js.map +1 -1
- package/persistence/SubjectTopoligicalSorter.js +5 -5
- package/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/persistence/subject-builder/CascadesSubjectBuilder.js +1 -1
- package/persistence/subject-builder/CascadesSubjectBuilder.js.map +1 -1
- package/persistence/tree/ClosureSubjectExecutor.js +13 -13
- package/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
- package/persistence/tree/MaterializedPathSubjectExecutor.js +5 -5
- package/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/persistence/tree/NestedSetSubjectExecutor.js +14 -14
- package/persistence/tree/NestedSetSubjectExecutor.js.map +1 -1
- package/platform/PlatformTools.js +8 -8
- package/platform/PlatformTools.js.map +1 -1
- package/query-builder/DeleteQueryBuilder.js +7 -14
- package/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/query-builder/InsertQueryBuilder.js +9 -11
- package/query-builder/InsertQueryBuilder.js.map +1 -1
- package/query-builder/JoinAttribute.js +1 -1
- package/query-builder/JoinAttribute.js.map +1 -1
- package/query-builder/QueryBuilder.js +37 -37
- package/query-builder/QueryBuilder.js.map +1 -1
- package/query-builder/QueryBuilderUtils.js +1 -1
- package/query-builder/QueryBuilderUtils.js.map +1 -1
- package/query-builder/QueryExpressionMap.js +3 -3
- package/query-builder/QueryExpressionMap.js.map +1 -1
- package/query-builder/RelationLoader.js +2 -2
- package/query-builder/RelationLoader.js.map +1 -1
- package/query-builder/RelationQueryBuilder.js +13 -13
- package/query-builder/RelationQueryBuilder.js.map +1 -1
- package/query-builder/RelationRemover.js +12 -12
- package/query-builder/RelationRemover.js.map +1 -1
- package/query-builder/RelationUpdater.js +2 -2
- package/query-builder/ReturningResultsEntityUpdator.js +6 -6
- package/query-builder/SelectQueryBuilder.js +43 -43
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-builder/SoftDeleteQueryBuilder.js +7 -14
- package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/query-builder/UpdateQueryBuilder.js +10 -17
- package/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/query-builder/relation-count/RelationCountAttribute.js +2 -2
- package/query-builder/relation-count/RelationCountAttribute.js.map +1 -1
- package/query-builder/relation-count/RelationCountLoader.js +4 -4
- package/query-builder/relation-id/RelationIdAttribute.js +1 -1
- package/query-builder/relation-id/RelationIdAttribute.js.map +1 -1
- package/query-builder/relation-id/RelationIdLoader.js +5 -5
- package/query-builder/relation-id/RelationIdLoader.js.map +1 -1
- package/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +3 -3
- package/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js.map +1 -1
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js +2 -2
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/query-runner/BaseQueryRunner.js +25 -25
- package/query-runner/BaseQueryRunner.js.map +1 -1
- package/query-runner/QueryLock.js +3 -3
- package/query-runner/QueryLock.js.map +1 -1
- package/repository/AbstractRepository.js +1 -1
- package/repository/AbstractRepository.js.map +1 -1
- package/repository/BaseEntity.js +4 -4
- package/repository/BaseEntity.js.map +1 -1
- package/repository/MongoRepository.js +1 -1
- package/repository/MongoRepository.js.map +1 -1
- package/repository/Repository.js +1 -1
- package/repository/Repository.js.map +1 -1
- package/repository/TreeRepository.js +7 -7
- package/repository/TreeRepository.js.map +1 -1
- package/schema-builder/MongoSchemaBuilder.js +2 -2
- package/schema-builder/RdbmsSchemaBuilder.js +95 -95
- package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/schema-builder/table/Table.js +1 -1
- package/schema-builder/table/Table.js.map +1 -1
- package/schema-builder/table/TableCheck.js +1 -1
- package/schema-builder/table/TableCheck.js.map +1 -1
- package/schema-builder/table/TableForeignKey.js +2 -2
- package/schema-builder/table/TableForeignKey.js.map +1 -1
- package/schema-builder/table/TableIndex.js +1 -1
- package/schema-builder/table/TableIndex.js.map +1 -1
- package/schema-builder/table/TableUnique.js +1 -1
- package/schema-builder/table/TableUnique.js.map +1 -1
- package/subscriber/Broadcaster.d.ts +23 -2
- package/subscriber/Broadcaster.js +35 -2
- package/subscriber/Broadcaster.js.map +1 -1
- package/subscriber/BroadcasterResult.d.ts +4 -0
- package/subscriber/BroadcasterResult.js +19 -0
- package/subscriber/BroadcasterResult.js.map +1 -1
- package/util/DateUtils.js +1 -1
- package/util/DateUtils.js.map +1 -1
- package/util/DirectoryExportedClassesLoader.js +1 -1
- package/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/util/ObjectUtils.js +2 -2
- package/util/ObjectUtils.js.map +1 -1
- package/util/OrmUtils.js +2 -2
- package/util/OrmUtils.js.map +1 -1
- package/util/StringUtils.js +2 -2
- package/util/StringUtils.js.map +1 -1
|
@@ -17,14 +17,13 @@ var Broadcaster_1 = require("../../subscriber/Broadcaster");
|
|
|
17
17
|
var BaseQueryRunner_1 = require("../../query-runner/BaseQueryRunner");
|
|
18
18
|
var OrmUtils_1 = require("../../util/OrmUtils");
|
|
19
19
|
var TableCheck_1 = require("../../schema-builder/table/TableCheck");
|
|
20
|
-
var BroadcasterResult_1 = require("../../subscriber/BroadcasterResult");
|
|
21
20
|
var error_1 = require("../../error");
|
|
22
21
|
var QueryResult_1 = require("../../query-runner/QueryResult");
|
|
23
22
|
/**
|
|
24
23
|
* Runs queries on a single oracle database connection.
|
|
25
24
|
*/
|
|
26
25
|
var OracleQueryRunner = /** @class */ (function (_super) {
|
|
27
|
-
tslib_1.__extends(OracleQueryRunner, _super);
|
|
26
|
+
(0, tslib_1.__extends)(OracleQueryRunner, _super);
|
|
28
27
|
// -------------------------------------------------------------------------
|
|
29
28
|
// Constructor
|
|
30
29
|
// -------------------------------------------------------------------------
|
|
@@ -68,8 +67,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
68
67
|
* You cannot use query runner methods once its released.
|
|
69
68
|
*/
|
|
70
69
|
OracleQueryRunner.prototype.release = function () {
|
|
71
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
72
|
-
return tslib_1.__generator(this, function (_a) {
|
|
70
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
71
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
73
72
|
switch (_a.label) {
|
|
74
73
|
case 0:
|
|
75
74
|
this.isReleased = true;
|
|
@@ -89,9 +88,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
89
88
|
*/
|
|
90
89
|
OracleQueryRunner.prototype.startTransaction = function (isolationLevel) {
|
|
91
90
|
if (isolationLevel === void 0) { isolationLevel = "READ COMMITTED"; }
|
|
92
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
93
|
-
|
|
94
|
-
return tslib_1.__generator(this, function (_a) {
|
|
91
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
92
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
95
93
|
switch (_a.label) {
|
|
96
94
|
case 0:
|
|
97
95
|
if (this.isReleased)
|
|
@@ -102,25 +100,17 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
102
100
|
if (isolationLevel !== "SERIALIZABLE" && isolationLevel !== "READ COMMITTED") {
|
|
103
101
|
throw new error_1.TypeORMError("Oracle only supports SERIALIZABLE and READ COMMITTED isolation");
|
|
104
102
|
}
|
|
105
|
-
|
|
106
|
-
this.broadcaster.broadcastBeforeTransactionStartEvent(beforeBroadcastResult);
|
|
107
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
108
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
103
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionStart')];
|
|
109
104
|
case 1:
|
|
110
105
|
_a.sent();
|
|
111
|
-
|
|
112
|
-
case 2:
|
|
113
|
-
case 3:
|
|
106
|
+
return [4 /*yield*/, this.query("SET TRANSACTION ISOLATION LEVEL " + isolationLevel)];
|
|
107
|
+
case 2:
|
|
114
108
|
_a.sent();
|
|
115
109
|
this.isTransactionActive = true;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
119
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
120
|
-
case 4:
|
|
110
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionStart')];
|
|
111
|
+
case 3:
|
|
121
112
|
_a.sent();
|
|
122
|
-
|
|
123
|
-
case 5: return [2 /*return*/];
|
|
113
|
+
return [2 /*return*/];
|
|
124
114
|
}
|
|
125
115
|
});
|
|
126
116
|
});
|
|
@@ -130,32 +120,23 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
130
120
|
* Error will be thrown if transaction was not started.
|
|
131
121
|
*/
|
|
132
122
|
OracleQueryRunner.prototype.commitTransaction = function () {
|
|
133
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
134
|
-
|
|
135
|
-
return tslib_1.__generator(this, function (_a) {
|
|
123
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
124
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
136
125
|
switch (_a.label) {
|
|
137
126
|
case 0:
|
|
138
127
|
if (!this.isTransactionActive)
|
|
139
128
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
140
|
-
|
|
141
|
-
this.broadcaster.broadcastBeforeTransactionCommitEvent(beforeBroadcastResult);
|
|
142
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
143
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
129
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionCommit')];
|
|
144
130
|
case 1:
|
|
145
131
|
_a.sent();
|
|
146
|
-
|
|
147
|
-
case 2:
|
|
148
|
-
case 3:
|
|
132
|
+
return [4 /*yield*/, this.query("COMMIT")];
|
|
133
|
+
case 2:
|
|
149
134
|
_a.sent();
|
|
150
135
|
this.isTransactionActive = false;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
154
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
155
|
-
case 4:
|
|
136
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionCommit')];
|
|
137
|
+
case 3:
|
|
156
138
|
_a.sent();
|
|
157
|
-
|
|
158
|
-
case 5: return [2 /*return*/];
|
|
139
|
+
return [2 /*return*/];
|
|
159
140
|
}
|
|
160
141
|
});
|
|
161
142
|
});
|
|
@@ -165,32 +146,23 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
165
146
|
* Error will be thrown if transaction was not started.
|
|
166
147
|
*/
|
|
167
148
|
OracleQueryRunner.prototype.rollbackTransaction = function () {
|
|
168
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
169
|
-
|
|
170
|
-
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) {
|
|
171
151
|
switch (_a.label) {
|
|
172
152
|
case 0:
|
|
173
153
|
if (!this.isTransactionActive)
|
|
174
154
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
175
|
-
|
|
176
|
-
this.broadcaster.broadcastBeforeTransactionRollbackEvent(beforeBroadcastResult);
|
|
177
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
178
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
155
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionRollback')];
|
|
179
156
|
case 1:
|
|
180
157
|
_a.sent();
|
|
181
|
-
|
|
182
|
-
case 2:
|
|
183
|
-
case 3:
|
|
158
|
+
return [4 /*yield*/, this.query("ROLLBACK")];
|
|
159
|
+
case 2:
|
|
184
160
|
_a.sent();
|
|
185
161
|
this.isTransactionActive = false;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
189
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
190
|
-
case 4:
|
|
162
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionRollback')];
|
|
163
|
+
case 3:
|
|
191
164
|
_a.sent();
|
|
192
|
-
|
|
193
|
-
case 5: return [2 /*return*/];
|
|
165
|
+
return [2 /*return*/];
|
|
194
166
|
}
|
|
195
167
|
});
|
|
196
168
|
});
|
|
@@ -200,9 +172,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
200
172
|
*/
|
|
201
173
|
OracleQueryRunner.prototype.query = function (query, parameters, useStructuredResult) {
|
|
202
174
|
if (useStructuredResult === void 0) { useStructuredResult = false; }
|
|
203
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
175
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
204
176
|
var databaseConnection, queryStartTime, executionOptions, raw, maxQueryExecutionTime, queryEndTime, queryExecutionTime, result, err_1;
|
|
205
|
-
return tslib_1.__generator(this, function (_a) {
|
|
177
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
206
178
|
switch (_a.label) {
|
|
207
179
|
case 0:
|
|
208
180
|
if (this.isReleased)
|
|
@@ -261,9 +233,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
261
233
|
* Returns raw data stream.
|
|
262
234
|
*/
|
|
263
235
|
OracleQueryRunner.prototype.stream = function (query, parameters, onEnd, onError) {
|
|
264
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
236
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
265
237
|
var executionOptions, databaseConnection, stream;
|
|
266
|
-
return tslib_1.__generator(this, function (_a) {
|
|
238
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
267
239
|
switch (_a.label) {
|
|
268
240
|
case 0:
|
|
269
241
|
if (this.isReleased) {
|
|
@@ -300,8 +272,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
300
272
|
* Returns all available database names including system databases.
|
|
301
273
|
*/
|
|
302
274
|
OracleQueryRunner.prototype.getDatabases = function () {
|
|
303
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
304
|
-
return tslib_1.__generator(this, function (_a) {
|
|
275
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
276
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
305
277
|
return [2 /*return*/, Promise.resolve([])];
|
|
306
278
|
});
|
|
307
279
|
});
|
|
@@ -311,8 +283,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
311
283
|
* If database parameter specified, returns schemas of that database.
|
|
312
284
|
*/
|
|
313
285
|
OracleQueryRunner.prototype.getSchemas = function (database) {
|
|
314
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
315
|
-
return tslib_1.__generator(this, function (_a) {
|
|
286
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
287
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
316
288
|
return [2 /*return*/, Promise.resolve([])];
|
|
317
289
|
});
|
|
318
290
|
});
|
|
@@ -321,9 +293,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
321
293
|
* Checks if database with the given name exist.
|
|
322
294
|
*/
|
|
323
295
|
OracleQueryRunner.prototype.hasDatabase = function (database) {
|
|
324
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
296
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
325
297
|
var query, e_1;
|
|
326
|
-
return tslib_1.__generator(this, function (_a) {
|
|
298
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
327
299
|
switch (_a.label) {
|
|
328
300
|
case 0:
|
|
329
301
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -343,9 +315,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
343
315
|
* Loads currently using database
|
|
344
316
|
*/
|
|
345
317
|
OracleQueryRunner.prototype.getCurrentDatabase = function () {
|
|
346
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
318
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
347
319
|
var query;
|
|
348
|
-
return tslib_1.__generator(this, function (_a) {
|
|
320
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
349
321
|
switch (_a.label) {
|
|
350
322
|
case 0: return [4 /*yield*/, this.query("SELECT SYS_CONTEXT('USERENV','DB_NAME') AS \"db_name\" FROM dual")];
|
|
351
323
|
case 1:
|
|
@@ -359,8 +331,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
359
331
|
* Checks if schema with the given name exist.
|
|
360
332
|
*/
|
|
361
333
|
OracleQueryRunner.prototype.hasSchema = function (schema) {
|
|
362
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
363
|
-
return tslib_1.__generator(this, function (_a) {
|
|
334
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
335
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
364
336
|
return [2 /*return*/, Promise.resolve(false)];
|
|
365
337
|
});
|
|
366
338
|
});
|
|
@@ -369,9 +341,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
369
341
|
* Loads currently using database schema
|
|
370
342
|
*/
|
|
371
343
|
OracleQueryRunner.prototype.getCurrentSchema = function () {
|
|
372
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
344
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
373
345
|
var query;
|
|
374
|
-
return tslib_1.__generator(this, function (_a) {
|
|
346
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
375
347
|
switch (_a.label) {
|
|
376
348
|
case 0: return [4 /*yield*/, this.query("SELECT SYS_CONTEXT('USERENV','CURRENT_SCHEMA') AS \"schema_name\" FROM dual")];
|
|
377
349
|
case 1:
|
|
@@ -385,9 +357,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
385
357
|
* Checks if table with the given name exist in the database.
|
|
386
358
|
*/
|
|
387
359
|
OracleQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
388
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
360
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
389
361
|
var tableName, sql, result;
|
|
390
|
-
return tslib_1.__generator(this, function (_a) {
|
|
362
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
391
363
|
switch (_a.label) {
|
|
392
364
|
case 0:
|
|
393
365
|
tableName = this.driver.parseTableName(tableOrName).tableName;
|
|
@@ -404,9 +376,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
404
376
|
* Checks if column with the given name exist in the given table.
|
|
405
377
|
*/
|
|
406
378
|
OracleQueryRunner.prototype.hasColumn = function (tableOrName, columnName) {
|
|
407
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
379
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
408
380
|
var tableName, sql, result;
|
|
409
|
-
return tslib_1.__generator(this, function (_a) {
|
|
381
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
410
382
|
switch (_a.label) {
|
|
411
383
|
case 0:
|
|
412
384
|
tableName = this.driver.parseTableName(tableOrName).tableName;
|
|
@@ -423,9 +395,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
423
395
|
* Creates a new database.
|
|
424
396
|
*/
|
|
425
397
|
OracleQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
426
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
398
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
427
399
|
var e_2;
|
|
428
|
-
return tslib_1.__generator(this, function (_a) {
|
|
400
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
429
401
|
switch (_a.label) {
|
|
430
402
|
case 0:
|
|
431
403
|
if (!ifNotExist) return [3 /*break*/, 5];
|
|
@@ -458,8 +430,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
458
430
|
* Drops database.
|
|
459
431
|
*/
|
|
460
432
|
OracleQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
461
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
462
|
-
return tslib_1.__generator(this, function (_a) {
|
|
433
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
434
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
463
435
|
return [2 /*return*/, Promise.resolve()];
|
|
464
436
|
});
|
|
465
437
|
});
|
|
@@ -468,8 +440,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
468
440
|
* Creates a new table schema.
|
|
469
441
|
*/
|
|
470
442
|
OracleQueryRunner.prototype.createSchema = function (schemaPath, ifNotExist) {
|
|
471
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
472
|
-
return tslib_1.__generator(this, function (_a) {
|
|
443
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
444
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
473
445
|
throw new error_1.TypeORMError("Schema create queries are not supported by Oracle driver.");
|
|
474
446
|
});
|
|
475
447
|
});
|
|
@@ -478,8 +450,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
478
450
|
* Drops table schema.
|
|
479
451
|
*/
|
|
480
452
|
OracleQueryRunner.prototype.dropSchema = function (schemaPath, ifExist) {
|
|
481
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
482
|
-
return tslib_1.__generator(this, function (_a) {
|
|
453
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
454
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
483
455
|
throw new error_1.TypeORMError("Schema drop queries are not supported by Oracle driver.");
|
|
484
456
|
});
|
|
485
457
|
});
|
|
@@ -491,10 +463,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
491
463
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
492
464
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
493
465
|
if (createIndices === void 0) { createIndices = true; }
|
|
494
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
466
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
495
467
|
var isTableExist, upQueries, downQueries;
|
|
496
468
|
var _this = this;
|
|
497
|
-
return tslib_1.__generator(this, function (_a) {
|
|
469
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
498
470
|
switch (_a.label) {
|
|
499
471
|
case 0:
|
|
500
472
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -536,10 +508,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
536
508
|
OracleQueryRunner.prototype.dropTable = function (tableOrName, ifExist, dropForeignKeys, dropIndices) {
|
|
537
509
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
538
510
|
if (dropIndices === void 0) { dropIndices = true; }
|
|
539
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
511
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
540
512
|
var isTableExist, createForeignKeys, table, _a, upQueries, downQueries;
|
|
541
513
|
var _this = this;
|
|
542
|
-
return tslib_1.__generator(this, function (_b) {
|
|
514
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
543
515
|
switch (_b.label) {
|
|
544
516
|
case 0:
|
|
545
517
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -586,9 +558,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
586
558
|
* Creates a new view.
|
|
587
559
|
*/
|
|
588
560
|
OracleQueryRunner.prototype.createView = function (view) {
|
|
589
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
561
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
590
562
|
var upQueries, downQueries;
|
|
591
|
-
return tslib_1.__generator(this, function (_a) {
|
|
563
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
592
564
|
switch (_a.label) {
|
|
593
565
|
case 0:
|
|
594
566
|
upQueries = [];
|
|
@@ -609,9 +581,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
609
581
|
* Drops the view.
|
|
610
582
|
*/
|
|
611
583
|
OracleQueryRunner.prototype.dropView = function (target) {
|
|
612
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
584
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
613
585
|
var viewName, view, upQueries, downQueries;
|
|
614
|
-
return tslib_1.__generator(this, function (_a) {
|
|
586
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
615
587
|
switch (_a.label) {
|
|
616
588
|
case 0:
|
|
617
589
|
viewName = target instanceof View_1.View ? target.name : target;
|
|
@@ -636,10 +608,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
636
608
|
* Renames the given table.
|
|
637
609
|
*/
|
|
638
610
|
OracleQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
639
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
611
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
640
612
|
var upQueries, downQueries, oldTable, _a, newTable, _b, dbName, oldTableName, columnNames, oldPkName, newPkName;
|
|
641
613
|
var _this = this;
|
|
642
|
-
return tslib_1.__generator(this, function (_c) {
|
|
614
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
643
615
|
switch (_c.label) {
|
|
644
616
|
case 0:
|
|
645
617
|
upQueries = [];
|
|
@@ -713,9 +685,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
713
685
|
* Creates a new column from the column in the table.
|
|
714
686
|
*/
|
|
715
687
|
OracleQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
716
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
688
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
717
689
|
var table, _a, clonedTable, upQueries, downQueries, primaryColumns, pkName_1, columnNames_1, pkName, columnNames, columnIndex, uniqueConstraint;
|
|
718
|
-
return tslib_1.__generator(this, function (_b) {
|
|
690
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
719
691
|
switch (_b.label) {
|
|
720
692
|
case 0:
|
|
721
693
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -778,14 +750,14 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
778
750
|
* Creates a new columns from the column in the table.
|
|
779
751
|
*/
|
|
780
752
|
OracleQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
781
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
753
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
782
754
|
var columns_1, columns_1_1, column, e_3_1;
|
|
783
755
|
var e_3, _a;
|
|
784
|
-
return tslib_1.__generator(this, function (_b) {
|
|
756
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
785
757
|
switch (_b.label) {
|
|
786
758
|
case 0:
|
|
787
759
|
_b.trys.push([0, 5, 6, 7]);
|
|
788
|
-
columns_1 = tslib_1.__values(columns), columns_1_1 = columns_1.next();
|
|
760
|
+
columns_1 = (0, tslib_1.__values)(columns), columns_1_1 = columns_1.next();
|
|
789
761
|
_b.label = 1;
|
|
790
762
|
case 1:
|
|
791
763
|
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -817,9 +789,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
817
789
|
* Renames column in the given table.
|
|
818
790
|
*/
|
|
819
791
|
OracleQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
820
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
792
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
821
793
|
var table, _a, oldColumn, newColumn;
|
|
822
|
-
return tslib_1.__generator(this, function (_b) {
|
|
794
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
823
795
|
switch (_b.label) {
|
|
824
796
|
case 0:
|
|
825
797
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -854,10 +826,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
854
826
|
* Changes a column in the table.
|
|
855
827
|
*/
|
|
856
828
|
OracleQueryRunner.prototype.changeColumn = function (tableOrName, oldTableColumnOrName, newColumn) {
|
|
857
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
829
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
858
830
|
var table, _a, clonedTable, upQueries, downQueries, oldColumn, primaryColumns, columnNames, oldPkName, newPkName, oldTableColumn, defaultUp, defaultDown, nullableUp, nullableDown, primaryColumns, pkName, columnNames, column, pkName, columnNames, primaryColumn, column, pkName, columnNames, uniqueConstraint, uniqueConstraint;
|
|
859
831
|
var _this = this;
|
|
860
|
-
return tslib_1.__generator(this, function (_b) {
|
|
832
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
861
833
|
switch (_b.label) {
|
|
862
834
|
case 0:
|
|
863
835
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1046,14 +1018,14 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1046
1018
|
* Changes a column in the table.
|
|
1047
1019
|
*/
|
|
1048
1020
|
OracleQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
1049
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1021
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1050
1022
|
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_4_1;
|
|
1051
1023
|
var e_4, _b;
|
|
1052
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1024
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1053
1025
|
switch (_c.label) {
|
|
1054
1026
|
case 0:
|
|
1055
1027
|
_c.trys.push([0, 5, 6, 7]);
|
|
1056
|
-
changedColumns_1 = tslib_1.__values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1028
|
+
changedColumns_1 = (0, tslib_1.__values)(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1057
1029
|
_c.label = 1;
|
|
1058
1030
|
case 1:
|
|
1059
1031
|
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1085,9 +1057,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1085
1057
|
* Drops column in the table.
|
|
1086
1058
|
*/
|
|
1087
1059
|
OracleQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1088
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1060
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1089
1061
|
var table, _a, column, clonedTable, upQueries, downQueries, pkName, columnNames, tableColumn, pkName_2, columnNames_2, columnIndex, columnCheck, columnUnique;
|
|
1090
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1062
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1091
1063
|
switch (_b.label) {
|
|
1092
1064
|
case 0:
|
|
1093
1065
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1154,14 +1126,14 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1154
1126
|
* Drops the columns in the table.
|
|
1155
1127
|
*/
|
|
1156
1128
|
OracleQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1157
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1129
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1158
1130
|
var columns_2, columns_2_1, column, e_5_1;
|
|
1159
1131
|
var e_5, _a;
|
|
1160
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1132
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1161
1133
|
switch (_b.label) {
|
|
1162
1134
|
case 0:
|
|
1163
1135
|
_b.trys.push([0, 5, 6, 7]);
|
|
1164
|
-
columns_2 = tslib_1.__values(columns), columns_2_1 = columns_2.next();
|
|
1136
|
+
columns_2 = (0, tslib_1.__values)(columns), columns_2_1 = columns_2.next();
|
|
1165
1137
|
_b.label = 1;
|
|
1166
1138
|
case 1:
|
|
1167
1139
|
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1193,9 +1165,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1193
1165
|
* Creates a new primary key.
|
|
1194
1166
|
*/
|
|
1195
1167
|
OracleQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1196
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1168
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1197
1169
|
var table, _a, clonedTable, up, down;
|
|
1198
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1170
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1199
1171
|
switch (_b.label) {
|
|
1200
1172
|
case 0:
|
|
1201
1173
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1228,9 +1200,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1228
1200
|
* Updates composite primary keys.
|
|
1229
1201
|
*/
|
|
1230
1202
|
OracleQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1231
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1203
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1232
1204
|
var table, _a, columnNames, clonedTable, upQueries, downQueries, primaryColumns, pkName_3, columnNamesString_1, pkName, columnNamesString;
|
|
1233
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1205
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1234
1206
|
switch (_b.label) {
|
|
1235
1207
|
case 0:
|
|
1236
1208
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1274,9 +1246,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1274
1246
|
* Drops a primary key.
|
|
1275
1247
|
*/
|
|
1276
1248
|
OracleQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1277
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1249
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1278
1250
|
var table, _a, up, down;
|
|
1279
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1251
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1280
1252
|
switch (_b.label) {
|
|
1281
1253
|
case 0:
|
|
1282
1254
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1305,9 +1277,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1305
1277
|
* Creates a new unique constraint.
|
|
1306
1278
|
*/
|
|
1307
1279
|
OracleQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1308
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1280
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1309
1281
|
var table, _a, up, down;
|
|
1310
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1282
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1311
1283
|
switch (_b.label) {
|
|
1312
1284
|
case 0:
|
|
1313
1285
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1337,10 +1309,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1337
1309
|
* Creates a new unique constraints.
|
|
1338
1310
|
*/
|
|
1339
1311
|
OracleQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1340
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1312
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1341
1313
|
var promises;
|
|
1342
1314
|
var _this = this;
|
|
1343
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1315
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1344
1316
|
switch (_a.label) {
|
|
1345
1317
|
case 0:
|
|
1346
1318
|
promises = uniqueConstraints.map(function (uniqueConstraint) { return _this.createUniqueConstraint(tableOrName, uniqueConstraint); });
|
|
@@ -1356,9 +1328,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1356
1328
|
* Drops an unique constraint.
|
|
1357
1329
|
*/
|
|
1358
1330
|
OracleQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1359
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1331
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1360
1332
|
var table, _a, uniqueConstraint, up, down;
|
|
1361
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1333
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1362
1334
|
switch (_b.label) {
|
|
1363
1335
|
case 0:
|
|
1364
1336
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1388,10 +1360,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1388
1360
|
* Creates an unique constraints.
|
|
1389
1361
|
*/
|
|
1390
1362
|
OracleQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1391
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1363
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1392
1364
|
var promises;
|
|
1393
1365
|
var _this = this;
|
|
1394
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1366
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1395
1367
|
switch (_a.label) {
|
|
1396
1368
|
case 0:
|
|
1397
1369
|
promises = uniqueConstraints.map(function (uniqueConstraint) { return _this.dropUniqueConstraint(tableOrName, uniqueConstraint); });
|
|
@@ -1407,9 +1379,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1407
1379
|
* Creates new check constraint.
|
|
1408
1380
|
*/
|
|
1409
1381
|
OracleQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1410
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1382
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1411
1383
|
var table, _a, up, down;
|
|
1412
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1384
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1413
1385
|
switch (_b.label) {
|
|
1414
1386
|
case 0:
|
|
1415
1387
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1439,10 +1411,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1439
1411
|
* Creates new check constraints.
|
|
1440
1412
|
*/
|
|
1441
1413
|
OracleQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1442
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1414
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1443
1415
|
var promises;
|
|
1444
1416
|
var _this = this;
|
|
1445
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1417
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1446
1418
|
switch (_a.label) {
|
|
1447
1419
|
case 0:
|
|
1448
1420
|
promises = checkConstraints.map(function (checkConstraint) { return _this.createCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1458,9 +1430,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1458
1430
|
* Drops check constraint.
|
|
1459
1431
|
*/
|
|
1460
1432
|
OracleQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1461
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1433
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1462
1434
|
var table, _a, checkConstraint, up, down;
|
|
1463
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1435
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1464
1436
|
switch (_b.label) {
|
|
1465
1437
|
case 0:
|
|
1466
1438
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1490,10 +1462,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1490
1462
|
* Drops check constraints.
|
|
1491
1463
|
*/
|
|
1492
1464
|
OracleQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1493
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1465
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1494
1466
|
var promises;
|
|
1495
1467
|
var _this = this;
|
|
1496
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1468
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1497
1469
|
switch (_a.label) {
|
|
1498
1470
|
case 0:
|
|
1499
1471
|
promises = checkConstraints.map(function (checkConstraint) { return _this.dropCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1509,8 +1481,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1509
1481
|
* Creates a new exclusion constraint.
|
|
1510
1482
|
*/
|
|
1511
1483
|
OracleQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1512
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1513
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1484
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1485
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1514
1486
|
throw new error_1.TypeORMError("Oracle does not support exclusion constraints.");
|
|
1515
1487
|
});
|
|
1516
1488
|
});
|
|
@@ -1519,8 +1491,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1519
1491
|
* Creates a new exclusion constraints.
|
|
1520
1492
|
*/
|
|
1521
1493
|
OracleQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1522
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1523
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1494
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1495
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1524
1496
|
throw new error_1.TypeORMError("Oracle does not support exclusion constraints.");
|
|
1525
1497
|
});
|
|
1526
1498
|
});
|
|
@@ -1529,8 +1501,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1529
1501
|
* Drops exclusion constraint.
|
|
1530
1502
|
*/
|
|
1531
1503
|
OracleQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1532
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1533
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1504
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1505
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1534
1506
|
throw new error_1.TypeORMError("Oracle does not support exclusion constraints.");
|
|
1535
1507
|
});
|
|
1536
1508
|
});
|
|
@@ -1539,8 +1511,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1539
1511
|
* Drops exclusion constraints.
|
|
1540
1512
|
*/
|
|
1541
1513
|
OracleQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1542
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1543
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1514
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1515
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1544
1516
|
throw new error_1.TypeORMError("Oracle does not support exclusion constraints.");
|
|
1545
1517
|
});
|
|
1546
1518
|
});
|
|
@@ -1549,9 +1521,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1549
1521
|
* Creates a new foreign key.
|
|
1550
1522
|
*/
|
|
1551
1523
|
OracleQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1552
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1524
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1553
1525
|
var table, _a, up, down;
|
|
1554
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1526
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1555
1527
|
switch (_b.label) {
|
|
1556
1528
|
case 0:
|
|
1557
1529
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1581,10 +1553,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1581
1553
|
* Creates a new foreign keys.
|
|
1582
1554
|
*/
|
|
1583
1555
|
OracleQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1584
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1556
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1585
1557
|
var promises;
|
|
1586
1558
|
var _this = this;
|
|
1587
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1559
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1588
1560
|
switch (_a.label) {
|
|
1589
1561
|
case 0:
|
|
1590
1562
|
promises = foreignKeys.map(function (foreignKey) { return _this.createForeignKey(tableOrName, foreignKey); });
|
|
@@ -1600,9 +1572,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1600
1572
|
* Drops a foreign key from the table.
|
|
1601
1573
|
*/
|
|
1602
1574
|
OracleQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1603
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1575
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1604
1576
|
var table, _a, foreignKey, up, down;
|
|
1605
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1577
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1606
1578
|
switch (_b.label) {
|
|
1607
1579
|
case 0:
|
|
1608
1580
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1632,10 +1604,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1632
1604
|
* Drops a foreign keys from the table.
|
|
1633
1605
|
*/
|
|
1634
1606
|
OracleQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1635
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1607
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1636
1608
|
var promises;
|
|
1637
1609
|
var _this = this;
|
|
1638
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1610
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1639
1611
|
switch (_a.label) {
|
|
1640
1612
|
case 0:
|
|
1641
1613
|
promises = foreignKeys.map(function (foreignKey) { return _this.dropForeignKey(tableOrName, foreignKey); });
|
|
@@ -1651,9 +1623,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1651
1623
|
* Creates a new index.
|
|
1652
1624
|
*/
|
|
1653
1625
|
OracleQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
1654
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1626
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1655
1627
|
var table, _a, up, down;
|
|
1656
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1628
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1657
1629
|
switch (_b.label) {
|
|
1658
1630
|
case 0:
|
|
1659
1631
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1683,10 +1655,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1683
1655
|
* Creates a new indices
|
|
1684
1656
|
*/
|
|
1685
1657
|
OracleQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
1686
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1658
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1687
1659
|
var promises;
|
|
1688
1660
|
var _this = this;
|
|
1689
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1661
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1690
1662
|
switch (_a.label) {
|
|
1691
1663
|
case 0:
|
|
1692
1664
|
promises = indices.map(function (index) { return _this.createIndex(tableOrName, index); });
|
|
@@ -1702,9 +1674,9 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1702
1674
|
* Drops an index from the table.
|
|
1703
1675
|
*/
|
|
1704
1676
|
OracleQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
1705
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1677
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1706
1678
|
var table, _a, index, up, down;
|
|
1707
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1679
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1708
1680
|
switch (_b.label) {
|
|
1709
1681
|
case 0:
|
|
1710
1682
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1734,10 +1706,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1734
1706
|
* Drops an indices from the table.
|
|
1735
1707
|
*/
|
|
1736
1708
|
OracleQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
1737
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1709
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1738
1710
|
var promises;
|
|
1739
1711
|
var _this = this;
|
|
1740
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1712
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1741
1713
|
switch (_a.label) {
|
|
1742
1714
|
case 0:
|
|
1743
1715
|
promises = indices.map(function (index) { return _this.dropIndex(tableOrName, index); });
|
|
@@ -1754,8 +1726,8 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1754
1726
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
1755
1727
|
*/
|
|
1756
1728
|
OracleQueryRunner.prototype.clearTable = function (tableName) {
|
|
1757
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1758
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1729
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1730
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1759
1731
|
switch (_a.label) {
|
|
1760
1732
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tableName))];
|
|
1761
1733
|
case 1:
|
|
@@ -1769,10 +1741,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1769
1741
|
* Removes all tables from the currently connected database.
|
|
1770
1742
|
*/
|
|
1771
1743
|
OracleQueryRunner.prototype.clearDatabase = function () {
|
|
1772
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1744
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1773
1745
|
var dropViewsQuery, dropViewQueries, dropMatViewsQuery, dropMatViewQueries, dropTablesQuery, dropTableQueries, error_2, rollbackError_1;
|
|
1774
1746
|
var _this = this;
|
|
1775
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1747
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1776
1748
|
switch (_a.label) {
|
|
1777
1749
|
case 0: return [4 /*yield*/, this.startTransaction()];
|
|
1778
1750
|
case 1:
|
|
@@ -1827,10 +1799,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1827
1799
|
// Protected Methods
|
|
1828
1800
|
// -------------------------------------------------------------------------
|
|
1829
1801
|
OracleQueryRunner.prototype.loadViews = function (viewNames) {
|
|
1830
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1802
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1831
1803
|
var hasTable, currentDatabase, currentSchema, viewNamesString, query, dbViews;
|
|
1832
1804
|
var _this = this;
|
|
1833
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1805
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1834
1806
|
switch (_a.label) {
|
|
1835
1807
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
1836
1808
|
case 1:
|
|
@@ -1874,10 +1846,10 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1874
1846
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
1875
1847
|
*/
|
|
1876
1848
|
OracleQueryRunner.prototype.loadTables = function (tableNames) {
|
|
1877
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1849
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1878
1850
|
var dbTables, currentSchema, currentDatabase, tablesSql, _a, _b, _c, _d, tablesCondition, tablesSql, _e, _f, _g, _h, columnsCondition, columnsSql, indicesSql, foreignKeysSql, constraintsSql, _j, dbColumns, dbIndices, dbForeignKeys, dbConstraints;
|
|
1879
1851
|
var _this = this;
|
|
1880
|
-
return tslib_1.__generator(this, function (_k) {
|
|
1852
|
+
return (0, tslib_1.__generator)(this, function (_k) {
|
|
1881
1853
|
switch (_k.label) {
|
|
1882
1854
|
case 0:
|
|
1883
1855
|
if (tableNames && tableNames.length === 0) {
|
|
@@ -1897,21 +1869,21 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1897
1869
|
_d = [[]];
|
|
1898
1870
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
1899
1871
|
case 3:
|
|
1900
|
-
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
1872
|
+
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
1901
1873
|
return [3 /*break*/, 6];
|
|
1902
1874
|
case 4:
|
|
1903
1875
|
tablesCondition = tableNames.map(function (tableName) {
|
|
1904
1876
|
var parts = tableName.split(".");
|
|
1905
1877
|
if (parts.length >= 3) {
|
|
1906
|
-
var _a = tslib_1.__read(parts, 3), schema = _a[1], name = _a[2];
|
|
1878
|
+
var _a = (0, tslib_1.__read)(parts, 3), schema = _a[1], name = _a[2];
|
|
1907
1879
|
return "(\"OWNER\" = '" + schema + "' AND \"TABLE_NAME\" = '" + name + "')";
|
|
1908
1880
|
}
|
|
1909
1881
|
else if (parts.length === 2) {
|
|
1910
|
-
var _b = tslib_1.__read(parts, 2), schema = _b[0], name = _b[1];
|
|
1882
|
+
var _b = (0, tslib_1.__read)(parts, 2), schema = _b[0], name = _b[1];
|
|
1911
1883
|
return "(\"OWNER\" = '" + schema + "' AND \"TABLE_NAME\" = '" + name + "')";
|
|
1912
1884
|
}
|
|
1913
1885
|
else if (parts.length === 1) {
|
|
1914
|
-
var _c = tslib_1.__read(parts, 1), name = _c[0];
|
|
1886
|
+
var _c = (0, tslib_1.__read)(parts, 1), name = _c[0];
|
|
1915
1887
|
return "(\"TABLE_NAME\" = '" + name + "')";
|
|
1916
1888
|
}
|
|
1917
1889
|
else {
|
|
@@ -1924,7 +1896,7 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
1924
1896
|
_h = [[]];
|
|
1925
1897
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
1926
1898
|
case 5:
|
|
1927
|
-
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
1899
|
+
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
1928
1900
|
_k.label = 6;
|
|
1929
1901
|
case 6:
|
|
1930
1902
|
// if tables were not found in the db, no need to proceed
|
|
@@ -2157,7 +2129,7 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
2157
2129
|
OracleQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2158
2130
|
var expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2159
2131
|
var type = view.materialized ? "MATERIALIZED_VIEW" : "VIEW";
|
|
2160
|
-
var _a = tslib_1.__read(this.connection.createQueryBuilder()
|
|
2132
|
+
var _a = (0, tslib_1.__read)(this.connection.createQueryBuilder()
|
|
2161
2133
|
.insert()
|
|
2162
2134
|
.into(this.getTypeormMetadataTableName())
|
|
2163
2135
|
.values({ type: type, name: view.name, value: expression })
|
|
@@ -2177,7 +2149,7 @@ var OracleQueryRunner = /** @class */ (function (_super) {
|
|
|
2177
2149
|
OracleQueryRunner.prototype.deleteViewDefinitionSql = function (view) {
|
|
2178
2150
|
var qb = this.connection.createQueryBuilder();
|
|
2179
2151
|
var type = view.materialized ? "MATERIALIZED_VIEW" : "VIEW";
|
|
2180
|
-
var _a = tslib_1.__read(qb.delete()
|
|
2152
|
+
var _a = (0, tslib_1.__read)(qb.delete()
|
|
2181
2153
|
.from(this.getTypeormMetadataTableName())
|
|
2182
2154
|
.where(qb.escape("type") + " = :type", { type: type })
|
|
2183
2155
|
.andWhere(qb.escape("name") + " = :name", { name: view.name })
|