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
|
@@ -16,7 +16,6 @@ var View_1 = require("../../schema-builder/view/View");
|
|
|
16
16
|
var Broadcaster_1 = require("../../subscriber/Broadcaster");
|
|
17
17
|
var OrmUtils_1 = require("../../util/OrmUtils");
|
|
18
18
|
var Query_1 = require("../Query");
|
|
19
|
-
var BroadcasterResult_1 = require("../../subscriber/BroadcasterResult");
|
|
20
19
|
var error_1 = require("../../error");
|
|
21
20
|
var QueryResult_1 = require("../../query-runner/QueryResult");
|
|
22
21
|
var QueryLock_1 = require("../../query-runner/QueryLock");
|
|
@@ -24,7 +23,7 @@ var QueryLock_1 = require("../../query-runner/QueryLock");
|
|
|
24
23
|
* Runs queries on a single SQL Server database connection.
|
|
25
24
|
*/
|
|
26
25
|
var SapQueryRunner = /** @class */ (function (_super) {
|
|
27
|
-
tslib_1.__extends(SapQueryRunner, _super);
|
|
26
|
+
(0, tslib_1.__extends)(SapQueryRunner, _super);
|
|
28
27
|
// -------------------------------------------------------------------------
|
|
29
28
|
// Constructor
|
|
30
29
|
// -------------------------------------------------------------------------
|
|
@@ -45,9 +44,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
45
44
|
* Returns obtained database connection.
|
|
46
45
|
*/
|
|
47
46
|
SapQueryRunner.prototype.connect = function () {
|
|
48
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
47
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
49
48
|
var _a;
|
|
50
|
-
return tslib_1.__generator(this, function (_b) {
|
|
49
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
51
50
|
switch (_b.label) {
|
|
52
51
|
case 0:
|
|
53
52
|
if (this.databaseConnection)
|
|
@@ -76,38 +75,27 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
76
75
|
* Starts transaction.
|
|
77
76
|
*/
|
|
78
77
|
SapQueryRunner.prototype.startTransaction = function (isolationLevel) {
|
|
79
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
80
|
-
|
|
81
|
-
return tslib_1.__generator(this, function (_a) {
|
|
78
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
79
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
82
80
|
switch (_a.label) {
|
|
83
81
|
case 0:
|
|
84
82
|
if (this.isReleased)
|
|
85
83
|
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
86
84
|
if (this.isTransactionActive)
|
|
87
85
|
throw new TransactionAlreadyStartedError_1.TransactionAlreadyStartedError();
|
|
88
|
-
|
|
89
|
-
this.broadcaster.broadcastBeforeTransactionStartEvent(beforeBroadcastResult);
|
|
90
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
91
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
86
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionStart')];
|
|
92
87
|
case 1:
|
|
93
88
|
_a.sent();
|
|
94
|
-
_a.label = 2;
|
|
95
|
-
case 2:
|
|
96
89
|
this.isTransactionActive = true;
|
|
97
|
-
if (!isolationLevel) return [3 /*break*/,
|
|
90
|
+
if (!isolationLevel) return [3 /*break*/, 3];
|
|
98
91
|
return [4 /*yield*/, this.query("SET TRANSACTION ISOLATION LEVEL " + (isolationLevel || ""))];
|
|
99
|
-
case
|
|
92
|
+
case 2:
|
|
100
93
|
_a.sent();
|
|
101
|
-
_a.label =
|
|
94
|
+
_a.label = 3;
|
|
95
|
+
case 3: return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionStart')];
|
|
102
96
|
case 4:
|
|
103
|
-
afterBroadcastResult = new BroadcasterResult_1.BroadcasterResult();
|
|
104
|
-
this.broadcaster.broadcastAfterTransactionStartEvent(afterBroadcastResult);
|
|
105
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 6];
|
|
106
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
107
|
-
case 5:
|
|
108
97
|
_a.sent();
|
|
109
|
-
|
|
110
|
-
case 6: return [2 /*return*/];
|
|
98
|
+
return [2 /*return*/];
|
|
111
99
|
}
|
|
112
100
|
});
|
|
113
101
|
});
|
|
@@ -117,34 +105,25 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
117
105
|
* Error will be thrown if transaction was not started.
|
|
118
106
|
*/
|
|
119
107
|
SapQueryRunner.prototype.commitTransaction = function () {
|
|
120
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
121
|
-
|
|
122
|
-
return tslib_1.__generator(this, function (_a) {
|
|
108
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
109
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
123
110
|
switch (_a.label) {
|
|
124
111
|
case 0:
|
|
125
112
|
if (this.isReleased)
|
|
126
113
|
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
127
114
|
if (!this.isTransactionActive)
|
|
128
115
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
129
|
-
|
|
130
|
-
this.broadcaster.broadcastBeforeTransactionCommitEvent(beforeBroadcastResult);
|
|
131
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
132
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
116
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionCommit')];
|
|
133
117
|
case 1:
|
|
134
118
|
_a.sent();
|
|
135
|
-
|
|
136
|
-
case 2:
|
|
137
|
-
case 3:
|
|
119
|
+
return [4 /*yield*/, this.query("COMMIT")];
|
|
120
|
+
case 2:
|
|
138
121
|
_a.sent();
|
|
139
122
|
this.isTransactionActive = false;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
143
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
144
|
-
case 4:
|
|
123
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionCommit')];
|
|
124
|
+
case 3:
|
|
145
125
|
_a.sent();
|
|
146
|
-
|
|
147
|
-
case 5: return [2 /*return*/];
|
|
126
|
+
return [2 /*return*/];
|
|
148
127
|
}
|
|
149
128
|
});
|
|
150
129
|
});
|
|
@@ -154,34 +133,25 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
154
133
|
* Error will be thrown if transaction was not started.
|
|
155
134
|
*/
|
|
156
135
|
SapQueryRunner.prototype.rollbackTransaction = function () {
|
|
157
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
158
|
-
|
|
159
|
-
return tslib_1.__generator(this, function (_a) {
|
|
136
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
137
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
160
138
|
switch (_a.label) {
|
|
161
139
|
case 0:
|
|
162
140
|
if (this.isReleased)
|
|
163
141
|
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
164
142
|
if (!this.isTransactionActive)
|
|
165
143
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
166
|
-
|
|
167
|
-
this.broadcaster.broadcastBeforeTransactionRollbackEvent(beforeBroadcastResult);
|
|
168
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
169
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
144
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionRollback')];
|
|
170
145
|
case 1:
|
|
171
146
|
_a.sent();
|
|
172
|
-
|
|
173
|
-
case 2:
|
|
174
|
-
case 3:
|
|
147
|
+
return [4 /*yield*/, this.query("ROLLBACK")];
|
|
148
|
+
case 2:
|
|
175
149
|
_a.sent();
|
|
176
150
|
this.isTransactionActive = false;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
180
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
181
|
-
case 4:
|
|
151
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionRollback')];
|
|
152
|
+
case 3:
|
|
182
153
|
_a.sent();
|
|
183
|
-
|
|
184
|
-
case 5: return [2 /*return*/];
|
|
154
|
+
return [2 /*return*/];
|
|
185
155
|
}
|
|
186
156
|
});
|
|
187
157
|
});
|
|
@@ -191,10 +161,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
191
161
|
*/
|
|
192
162
|
SapQueryRunner.prototype.query = function (query, parameters, useStructuredResult) {
|
|
193
163
|
if (useStructuredResult === void 0) { useStructuredResult = false; }
|
|
194
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
164
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
195
165
|
var release, statement, result, databaseConnection_1, queryStartTime_1, isInsertQuery, raw, lastIdQuery_1, identityValueResult, e_1;
|
|
196
166
|
var _this = this;
|
|
197
|
-
return tslib_1.__generator(this, function (_a) {
|
|
167
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
198
168
|
switch (_a.label) {
|
|
199
169
|
case 0:
|
|
200
170
|
if (this.isReleased)
|
|
@@ -216,9 +186,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
216
186
|
isInsertQuery = query.substr(0, 11) === "INSERT INTO";
|
|
217
187
|
statement = databaseConnection_1.prepare(query);
|
|
218
188
|
return [4 /*yield*/, new Promise(function (ok, fail) {
|
|
219
|
-
statement.exec(parameters, function (err, raw) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
189
|
+
statement.exec(parameters, function (err, raw) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
220
190
|
var maxQueryExecutionTime, queryEndTime, queryExecutionTime;
|
|
221
|
-
return tslib_1.__generator(this, function (_a) {
|
|
191
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
222
192
|
maxQueryExecutionTime = this.driver.connection.options.maxQueryExecutionTime;
|
|
223
193
|
queryEndTime = +new Date();
|
|
224
194
|
queryExecutionTime = queryEndTime - queryStartTime_1;
|
|
@@ -246,8 +216,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
246
216
|
lastIdQuery_1 = "SELECT CURRENT_IDENTITY_VALUE() FROM \"SYS\".\"DUMMY\"";
|
|
247
217
|
this.driver.connection.logger.logQuery(lastIdQuery_1, [], this);
|
|
248
218
|
return [4 /*yield*/, new Promise(function (ok, fail) {
|
|
249
|
-
databaseConnection_1.exec(lastIdQuery_1, function (err, raw) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
250
|
-
return tslib_1.__generator(this, function (_a) {
|
|
219
|
+
databaseConnection_1.exec(lastIdQuery_1, function (err, raw) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
220
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
251
221
|
if (err) {
|
|
252
222
|
fail(new error_1.QueryFailedError(lastIdQuery_1, [], err));
|
|
253
223
|
}
|
|
@@ -292,8 +262,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
292
262
|
* Returns raw data stream.
|
|
293
263
|
*/
|
|
294
264
|
SapQueryRunner.prototype.stream = function (query, parameters, onEnd, onError) {
|
|
295
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
296
|
-
return tslib_1.__generator(this, function (_a) {
|
|
265
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
266
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
297
267
|
throw new error_1.TypeORMError("Stream is not supported by SAP driver.");
|
|
298
268
|
});
|
|
299
269
|
});
|
|
@@ -302,9 +272,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
302
272
|
* Returns all available database names including system databases.
|
|
303
273
|
*/
|
|
304
274
|
SapQueryRunner.prototype.getDatabases = function () {
|
|
305
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
275
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
306
276
|
var results;
|
|
307
|
-
return tslib_1.__generator(this, function (_a) {
|
|
277
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
308
278
|
switch (_a.label) {
|
|
309
279
|
case 0: return [4 /*yield*/, this.query("SELECT DATABASE_NAME FROM \"SYS\".\"M_DATABASES\"")];
|
|
310
280
|
case 1:
|
|
@@ -319,9 +289,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
319
289
|
* If database parameter specified, returns schemas of that database.
|
|
320
290
|
*/
|
|
321
291
|
SapQueryRunner.prototype.getSchemas = function (database) {
|
|
322
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
292
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
323
293
|
var query, results;
|
|
324
|
-
return tslib_1.__generator(this, function (_a) {
|
|
294
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
325
295
|
switch (_a.label) {
|
|
326
296
|
case 0:
|
|
327
297
|
query = database ? "SELECT * FROM \"" + database + "\".\"SYS\".\"SCHEMAS\"" : "SELECT * FROM \"SYS\".\"SCHEMAS\"";
|
|
@@ -337,9 +307,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
337
307
|
* Checks if database with the given name exist.
|
|
338
308
|
*/
|
|
339
309
|
SapQueryRunner.prototype.hasDatabase = function (database) {
|
|
340
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
310
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
341
311
|
var databases;
|
|
342
|
-
return tslib_1.__generator(this, function (_a) {
|
|
312
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
343
313
|
switch (_a.label) {
|
|
344
314
|
case 0: return [4 /*yield*/, this.getDatabases()];
|
|
345
315
|
case 1:
|
|
@@ -353,9 +323,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
353
323
|
* Returns current database.
|
|
354
324
|
*/
|
|
355
325
|
SapQueryRunner.prototype.getCurrentDatabase = function () {
|
|
356
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
326
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
357
327
|
var currentDBQuery;
|
|
358
|
-
return tslib_1.__generator(this, function (_a) {
|
|
328
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
359
329
|
switch (_a.label) {
|
|
360
330
|
case 0: return [4 /*yield*/, this.query("SELECT \"VALUE\" AS \"db_name\" FROM \"SYS\".\"M_SYSTEM_OVERVIEW\" WHERE \"SECTION\" = 'System' and \"NAME\" = 'Instance ID'")];
|
|
361
331
|
case 1:
|
|
@@ -369,9 +339,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
369
339
|
* Checks if schema with the given name exist.
|
|
370
340
|
*/
|
|
371
341
|
SapQueryRunner.prototype.hasSchema = function (schema) {
|
|
372
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
342
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
373
343
|
var schemas;
|
|
374
|
-
return tslib_1.__generator(this, function (_a) {
|
|
344
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
375
345
|
switch (_a.label) {
|
|
376
346
|
case 0: return [4 /*yield*/, this.getSchemas()];
|
|
377
347
|
case 1:
|
|
@@ -385,9 +355,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
385
355
|
* Returns current schema.
|
|
386
356
|
*/
|
|
387
357
|
SapQueryRunner.prototype.getCurrentSchema = function () {
|
|
388
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
358
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
389
359
|
var currentSchemaQuery;
|
|
390
|
-
return tslib_1.__generator(this, function (_a) {
|
|
360
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
391
361
|
switch (_a.label) {
|
|
392
362
|
case 0: return [4 /*yield*/, this.query("SELECT CURRENT_SCHEMA AS \"schema_name\" FROM \"SYS\".\"DUMMY\"")];
|
|
393
363
|
case 1:
|
|
@@ -401,9 +371,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
401
371
|
* Checks if table with the given name exist in the database.
|
|
402
372
|
*/
|
|
403
373
|
SapQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
404
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
374
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
405
375
|
var parsedTableName, _a, sql, result;
|
|
406
|
-
return tslib_1.__generator(this, function (_b) {
|
|
376
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
407
377
|
switch (_b.label) {
|
|
408
378
|
case 0:
|
|
409
379
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -427,9 +397,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
427
397
|
* Checks if column with the given name exist in the given table.
|
|
428
398
|
*/
|
|
429
399
|
SapQueryRunner.prototype.hasColumn = function (tableOrName, columnName) {
|
|
430
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
400
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
431
401
|
var parsedTableName, _a, sql, result;
|
|
432
|
-
return tslib_1.__generator(this, function (_b) {
|
|
402
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
433
403
|
switch (_b.label) {
|
|
434
404
|
case 0:
|
|
435
405
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -453,8 +423,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
453
423
|
* Creates a new database.
|
|
454
424
|
*/
|
|
455
425
|
SapQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
456
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
457
|
-
return tslib_1.__generator(this, function (_a) {
|
|
426
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
427
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
458
428
|
return [2 /*return*/, Promise.resolve()];
|
|
459
429
|
});
|
|
460
430
|
});
|
|
@@ -463,8 +433,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
463
433
|
* Drops database.
|
|
464
434
|
*/
|
|
465
435
|
SapQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
466
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
467
|
-
return tslib_1.__generator(this, function (_a) {
|
|
436
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
437
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
468
438
|
return [2 /*return*/, Promise.resolve()];
|
|
469
439
|
});
|
|
470
440
|
});
|
|
@@ -473,9 +443,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
473
443
|
* Creates a new table schema.
|
|
474
444
|
*/
|
|
475
445
|
SapQueryRunner.prototype.createSchema = function (schemaPath, ifNotExist) {
|
|
476
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
446
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
477
447
|
var schema, exist, result, up, down;
|
|
478
|
-
return tslib_1.__generator(this, function (_a) {
|
|
448
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
479
449
|
switch (_a.label) {
|
|
480
450
|
case 0:
|
|
481
451
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[1];
|
|
@@ -503,9 +473,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
503
473
|
* Drops table schema
|
|
504
474
|
*/
|
|
505
475
|
SapQueryRunner.prototype.dropSchema = function (schemaPath, ifExist, isCascade) {
|
|
506
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
476
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
507
477
|
var schema, exist, result, up, down;
|
|
508
|
-
return tslib_1.__generator(this, function (_a) {
|
|
478
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
509
479
|
switch (_a.label) {
|
|
510
480
|
case 0:
|
|
511
481
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[0];
|
|
@@ -536,10 +506,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
536
506
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
537
507
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
538
508
|
if (createIndices === void 0) { createIndices = true; }
|
|
539
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
509
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
540
510
|
var isTableExist, upQueries, downQueries;
|
|
541
511
|
var _this = this;
|
|
542
|
-
return tslib_1.__generator(this, function (_a) {
|
|
512
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
543
513
|
switch (_a.label) {
|
|
544
514
|
case 0:
|
|
545
515
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -581,10 +551,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
581
551
|
SapQueryRunner.prototype.dropTable = function (tableOrName, ifExist, dropForeignKeys, dropIndices) {
|
|
582
552
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
583
553
|
if (dropIndices === void 0) { dropIndices = true; }
|
|
584
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
554
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
585
555
|
var isTableExist, createForeignKeys, table, _a, upQueries, downQueries;
|
|
586
556
|
var _this = this;
|
|
587
|
-
return tslib_1.__generator(this, function (_b) {
|
|
557
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
588
558
|
switch (_b.label) {
|
|
589
559
|
case 0:
|
|
590
560
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -633,9 +603,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
633
603
|
* Creates a new view.
|
|
634
604
|
*/
|
|
635
605
|
SapQueryRunner.prototype.createView = function (view) {
|
|
636
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
606
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
637
607
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
638
|
-
return tslib_1.__generator(this, function (_e) {
|
|
608
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
639
609
|
switch (_e.label) {
|
|
640
610
|
case 0:
|
|
641
611
|
upQueries = [];
|
|
@@ -662,9 +632,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
662
632
|
* Drops the view.
|
|
663
633
|
*/
|
|
664
634
|
SapQueryRunner.prototype.dropView = function (target) {
|
|
665
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
635
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
666
636
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
667
|
-
return tslib_1.__generator(this, function (_e) {
|
|
637
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
668
638
|
switch (_e.label) {
|
|
669
639
|
case 0:
|
|
670
640
|
viewName = target instanceof View_1.View ? target.name : target;
|
|
@@ -695,10 +665,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
695
665
|
* Renames a table.
|
|
696
666
|
*/
|
|
697
667
|
SapQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
698
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
668
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
699
669
|
var upQueries, downQueries, oldTable, _a, newTable, _b, schemaName, oldTableName, referencedForeignKeySql, dbForeignKeys, referencedForeignKeys, referencedForeignKeyTableMapping, columnNames, columnNamesString, oldPkName, newPkName;
|
|
700
670
|
var _this = this;
|
|
701
|
-
return tslib_1.__generator(this, function (_c) {
|
|
671
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
702
672
|
switch (_c.label) {
|
|
703
673
|
case 0:
|
|
704
674
|
upQueries = [];
|
|
@@ -806,10 +776,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
806
776
|
* Creates a new column from the column in the table.
|
|
807
777
|
*/
|
|
808
778
|
SapQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
809
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
779
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
810
780
|
var table, _a, parsedTableName, _b, clonedTable, upQueries, downQueries, primaryColumns, referencedForeignKeySql, dbForeignKeys_1, referencedForeignKeys, referencedForeignKeyTableMapping_1, pkName_1, columnNames_1, pkName, columnNames, columnIndex, uniqueIndex;
|
|
811
781
|
var _this = this;
|
|
812
|
-
return tslib_1.__generator(this, function (_c) {
|
|
782
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
813
783
|
switch (_c.label) {
|
|
814
784
|
case 0:
|
|
815
785
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -917,14 +887,14 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
917
887
|
* Creates a new columns from the column in the table.
|
|
918
888
|
*/
|
|
919
889
|
SapQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
920
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
890
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
921
891
|
var columns_1, columns_1_1, column, e_2_1;
|
|
922
892
|
var e_2, _a;
|
|
923
|
-
return tslib_1.__generator(this, function (_b) {
|
|
893
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
924
894
|
switch (_b.label) {
|
|
925
895
|
case 0:
|
|
926
896
|
_b.trys.push([0, 5, 6, 7]);
|
|
927
|
-
columns_1 = tslib_1.__values(columns), columns_1_1 = columns_1.next();
|
|
897
|
+
columns_1 = (0, tslib_1.__values)(columns), columns_1_1 = columns_1.next();
|
|
928
898
|
_b.label = 1;
|
|
929
899
|
case 1:
|
|
930
900
|
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -956,9 +926,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
956
926
|
* Renames column in the given table.
|
|
957
927
|
*/
|
|
958
928
|
SapQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
959
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
929
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
960
930
|
var table, _a, oldColumn, newColumn;
|
|
961
|
-
return tslib_1.__generator(this, function (_b) {
|
|
931
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
962
932
|
switch (_b.label) {
|
|
963
933
|
case 0:
|
|
964
934
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -993,10 +963,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
993
963
|
* Changes a column in the table.
|
|
994
964
|
*/
|
|
995
965
|
SapQueryRunner.prototype.changeColumn = function (tableOrName, oldTableColumnOrName, newColumn) {
|
|
996
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
966
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
997
967
|
var table, _a, clonedTable, upQueries, downQueries, oldColumn, primaryColumns, columnNames, oldPkName, columnNamesString, newPkName, oldTableColumn, primaryColumns, pkName, columnNames, column, pkName, columnNames, primaryColumn, column, pkName, columnNames, uniqueIndex, uniqueIndex_1, tableUnique;
|
|
998
968
|
var _this = this;
|
|
999
|
-
return tslib_1.__generator(this, function (_b) {
|
|
969
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1000
970
|
switch (_b.label) {
|
|
1001
971
|
case 0:
|
|
1002
972
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1188,14 +1158,14 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1188
1158
|
* Changes a column in the table.
|
|
1189
1159
|
*/
|
|
1190
1160
|
SapQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
1191
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1161
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1192
1162
|
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_3_1;
|
|
1193
1163
|
var e_3, _b;
|
|
1194
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1164
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1195
1165
|
switch (_c.label) {
|
|
1196
1166
|
case 0:
|
|
1197
1167
|
_c.trys.push([0, 5, 6, 7]);
|
|
1198
|
-
changedColumns_1 = tslib_1.__values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1168
|
+
changedColumns_1 = (0, tslib_1.__values)(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1199
1169
|
_c.label = 1;
|
|
1200
1170
|
case 1:
|
|
1201
1171
|
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1227,10 +1197,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1227
1197
|
* Drops column in the table.
|
|
1228
1198
|
*/
|
|
1229
1199
|
SapQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1230
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1200
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1231
1201
|
var table, _a, parsedTableName, _b, column, clonedTable, upQueries, downQueries, referencedForeignKeySql, dbForeignKeys_2, referencedForeignKeys, referencedForeignKeyTableMapping_2, pkName, columnNames, tableColumn, pkName_2, columnNames_2, columnIndex, uniqueName_1, foundUnique, indexName_1, foundIndex, columnCheck;
|
|
1232
1202
|
var _this = this;
|
|
1233
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1203
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1234
1204
|
switch (_c.label) {
|
|
1235
1205
|
case 0:
|
|
1236
1206
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1350,14 +1320,14 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1350
1320
|
* Drops the columns in the table.
|
|
1351
1321
|
*/
|
|
1352
1322
|
SapQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1353
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1323
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1354
1324
|
var columns_2, columns_2_1, column, e_4_1;
|
|
1355
1325
|
var e_4, _a;
|
|
1356
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1326
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1357
1327
|
switch (_b.label) {
|
|
1358
1328
|
case 0:
|
|
1359
1329
|
_b.trys.push([0, 5, 6, 7]);
|
|
1360
|
-
columns_2 = tslib_1.__values(columns), columns_2_1 = columns_2.next();
|
|
1330
|
+
columns_2 = (0, tslib_1.__values)(columns), columns_2_1 = columns_2.next();
|
|
1361
1331
|
_b.label = 1;
|
|
1362
1332
|
case 1:
|
|
1363
1333
|
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1389,9 +1359,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1389
1359
|
* Creates a new primary key.
|
|
1390
1360
|
*/
|
|
1391
1361
|
SapQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1392
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1362
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1393
1363
|
var table, _a, clonedTable, up, down;
|
|
1394
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1364
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1395
1365
|
switch (_b.label) {
|
|
1396
1366
|
case 0:
|
|
1397
1367
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1424,10 +1394,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1424
1394
|
* Updates composite primary keys.
|
|
1425
1395
|
*/
|
|
1426
1396
|
SapQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1427
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1397
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1428
1398
|
var table, _a, parsedTableName, _b, clonedTable, columnNames, upQueries, downQueries, referencedForeignKeySql, dbForeignKeys, referencedForeignKeys, referencedForeignKeyTableMapping, primaryColumns, pkName_3, columnNamesString_1, pkName, columnNamesString;
|
|
1429
1399
|
var _this = this;
|
|
1430
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1400
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1431
1401
|
switch (_c.label) {
|
|
1432
1402
|
case 0:
|
|
1433
1403
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1513,10 +1483,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1513
1483
|
* Drops a primary key.
|
|
1514
1484
|
*/
|
|
1515
1485
|
SapQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1516
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1486
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1517
1487
|
var table, _a, parsedTableName, _b, upQueries, downQueries, referencedForeignKeySql, dbForeignKeys, referencedForeignKeys, referencedForeignKeyTableMapping;
|
|
1518
1488
|
var _this = this;
|
|
1519
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1489
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1520
1490
|
switch (_c.label) {
|
|
1521
1491
|
case 0:
|
|
1522
1492
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1589,8 +1559,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1589
1559
|
* Creates a new unique constraint.
|
|
1590
1560
|
*/
|
|
1591
1561
|
SapQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1592
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1593
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1562
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1563
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1594
1564
|
throw new error_1.TypeORMError("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1595
1565
|
});
|
|
1596
1566
|
});
|
|
@@ -1599,8 +1569,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1599
1569
|
* Creates a new unique constraints.
|
|
1600
1570
|
*/
|
|
1601
1571
|
SapQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1602
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1603
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1572
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1573
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1604
1574
|
throw new error_1.TypeORMError("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1605
1575
|
});
|
|
1606
1576
|
});
|
|
@@ -1609,8 +1579,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1609
1579
|
* Drops unique constraint.
|
|
1610
1580
|
*/
|
|
1611
1581
|
SapQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1612
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1613
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1582
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1583
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1614
1584
|
throw new error_1.TypeORMError("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1615
1585
|
});
|
|
1616
1586
|
});
|
|
@@ -1619,8 +1589,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1619
1589
|
* Drops an unique constraints.
|
|
1620
1590
|
*/
|
|
1621
1591
|
SapQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1622
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1623
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1592
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1593
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1624
1594
|
throw new error_1.TypeORMError("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1625
1595
|
});
|
|
1626
1596
|
});
|
|
@@ -1629,9 +1599,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1629
1599
|
* Creates a new check constraint.
|
|
1630
1600
|
*/
|
|
1631
1601
|
SapQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1632
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1602
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1633
1603
|
var table, _a, up, down;
|
|
1634
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1604
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1635
1605
|
switch (_b.label) {
|
|
1636
1606
|
case 0:
|
|
1637
1607
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1661,10 +1631,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1661
1631
|
* Creates a new check constraints.
|
|
1662
1632
|
*/
|
|
1663
1633
|
SapQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1664
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1634
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1665
1635
|
var promises;
|
|
1666
1636
|
var _this = this;
|
|
1667
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1637
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1668
1638
|
switch (_a.label) {
|
|
1669
1639
|
case 0:
|
|
1670
1640
|
promises = checkConstraints.map(function (checkConstraint) { return _this.createCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1680,9 +1650,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1680
1650
|
* Drops check constraint.
|
|
1681
1651
|
*/
|
|
1682
1652
|
SapQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1683
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1653
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1684
1654
|
var table, _a, checkConstraint, up, down;
|
|
1685
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1655
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1686
1656
|
switch (_b.label) {
|
|
1687
1657
|
case 0:
|
|
1688
1658
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1712,10 +1682,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1712
1682
|
* Drops check constraints.
|
|
1713
1683
|
*/
|
|
1714
1684
|
SapQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1715
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1685
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1716
1686
|
var promises;
|
|
1717
1687
|
var _this = this;
|
|
1718
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1688
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1719
1689
|
switch (_a.label) {
|
|
1720
1690
|
case 0:
|
|
1721
1691
|
promises = checkConstraints.map(function (checkConstraint) { return _this.dropCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1731,8 +1701,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1731
1701
|
* Creates a new exclusion constraint.
|
|
1732
1702
|
*/
|
|
1733
1703
|
SapQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1734
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1735
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1704
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1705
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1736
1706
|
throw new error_1.TypeORMError("SAP HANA does not support exclusion constraints.");
|
|
1737
1707
|
});
|
|
1738
1708
|
});
|
|
@@ -1741,8 +1711,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1741
1711
|
* Creates a new exclusion constraints.
|
|
1742
1712
|
*/
|
|
1743
1713
|
SapQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1744
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1745
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1714
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1715
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1746
1716
|
throw new error_1.TypeORMError("SAP HANA does not support exclusion constraints.");
|
|
1747
1717
|
});
|
|
1748
1718
|
});
|
|
@@ -1751,8 +1721,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1751
1721
|
* Drops exclusion constraint.
|
|
1752
1722
|
*/
|
|
1753
1723
|
SapQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1754
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1755
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1724
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1725
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1756
1726
|
throw new error_1.TypeORMError("SAP HANA does not support exclusion constraints.");
|
|
1757
1727
|
});
|
|
1758
1728
|
});
|
|
@@ -1761,8 +1731,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1761
1731
|
* Drops exclusion constraints.
|
|
1762
1732
|
*/
|
|
1763
1733
|
SapQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1764
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1765
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1734
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1735
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1766
1736
|
throw new error_1.TypeORMError("SAP HANA does not support exclusion constraints.");
|
|
1767
1737
|
});
|
|
1768
1738
|
});
|
|
@@ -1771,9 +1741,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1771
1741
|
* Creates a new foreign key.
|
|
1772
1742
|
*/
|
|
1773
1743
|
SapQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1774
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1744
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1775
1745
|
var table, _a, up, down;
|
|
1776
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1746
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1777
1747
|
switch (_b.label) {
|
|
1778
1748
|
case 0:
|
|
1779
1749
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1803,10 +1773,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1803
1773
|
* Creates a new foreign keys.
|
|
1804
1774
|
*/
|
|
1805
1775
|
SapQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1806
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1776
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1807
1777
|
var promises;
|
|
1808
1778
|
var _this = this;
|
|
1809
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1779
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1810
1780
|
switch (_a.label) {
|
|
1811
1781
|
case 0:
|
|
1812
1782
|
promises = foreignKeys.map(function (foreignKey) { return _this.createForeignKey(tableOrName, foreignKey); });
|
|
@@ -1822,9 +1792,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1822
1792
|
* Drops a foreign key from the table.
|
|
1823
1793
|
*/
|
|
1824
1794
|
SapQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1825
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1795
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1826
1796
|
var table, _a, foreignKey, up, down;
|
|
1827
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1797
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1828
1798
|
switch (_b.label) {
|
|
1829
1799
|
case 0:
|
|
1830
1800
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1854,10 +1824,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1854
1824
|
* Drops a foreign keys from the table.
|
|
1855
1825
|
*/
|
|
1856
1826
|
SapQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1857
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1827
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1858
1828
|
var promises;
|
|
1859
1829
|
var _this = this;
|
|
1860
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1830
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1861
1831
|
switch (_a.label) {
|
|
1862
1832
|
case 0:
|
|
1863
1833
|
promises = foreignKeys.map(function (foreignKey) { return _this.dropForeignKey(tableOrName, foreignKey); });
|
|
@@ -1873,9 +1843,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1873
1843
|
* Creates a new index.
|
|
1874
1844
|
*/
|
|
1875
1845
|
SapQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
1876
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1846
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1877
1847
|
var table, _a, up, down;
|
|
1878
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1848
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1879
1849
|
switch (_b.label) {
|
|
1880
1850
|
case 0:
|
|
1881
1851
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1905,10 +1875,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1905
1875
|
* Creates a new indices
|
|
1906
1876
|
*/
|
|
1907
1877
|
SapQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
1908
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1878
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1909
1879
|
var promises;
|
|
1910
1880
|
var _this = this;
|
|
1911
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1881
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1912
1882
|
switch (_a.label) {
|
|
1913
1883
|
case 0:
|
|
1914
1884
|
promises = indices.map(function (index) { return _this.createIndex(tableOrName, index); });
|
|
@@ -1924,9 +1894,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1924
1894
|
* Drops an index.
|
|
1925
1895
|
*/
|
|
1926
1896
|
SapQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
1927
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1897
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1928
1898
|
var table, _a, index, up, down;
|
|
1929
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1899
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1930
1900
|
switch (_b.label) {
|
|
1931
1901
|
case 0:
|
|
1932
1902
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1956,10 +1926,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1956
1926
|
* Drops an indices from the table.
|
|
1957
1927
|
*/
|
|
1958
1928
|
SapQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
1959
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1929
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1960
1930
|
var promises;
|
|
1961
1931
|
var _this = this;
|
|
1962
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1932
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1963
1933
|
switch (_a.label) {
|
|
1964
1934
|
case 0:
|
|
1965
1935
|
promises = indices.map(function (index) { return _this.dropIndex(tableOrName, index); });
|
|
@@ -1976,8 +1946,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1976
1946
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
1977
1947
|
*/
|
|
1978
1948
|
SapQueryRunner.prototype.clearTable = function (tablePath) {
|
|
1979
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1980
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1949
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1950
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1981
1951
|
switch (_a.label) {
|
|
1982
1952
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tablePath))];
|
|
1983
1953
|
case 1:
|
|
@@ -1991,10 +1961,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1991
1961
|
* Removes all tables from the currently connected database.
|
|
1992
1962
|
*/
|
|
1993
1963
|
SapQueryRunner.prototype.clearDatabase = function () {
|
|
1994
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1964
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1995
1965
|
var schemas, schemaNamesString, selectTableDropsQuery, dropTableQueries, error_2, rollbackError_1;
|
|
1996
1966
|
var _this = this;
|
|
1997
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1967
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1998
1968
|
switch (_a.label) {
|
|
1999
1969
|
case 0:
|
|
2000
1970
|
schemas = [];
|
|
@@ -2048,10 +2018,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2048
2018
|
// Protected Methods
|
|
2049
2019
|
// -------------------------------------------------------------------------
|
|
2050
2020
|
SapQueryRunner.prototype.loadViews = function (viewNames) {
|
|
2051
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2021
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2052
2022
|
var hasTable, currentDatabase, currentSchema, viewsCondition, query, dbViews;
|
|
2053
2023
|
var _this = this;
|
|
2054
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2024
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2055
2025
|
switch (_a.label) {
|
|
2056
2026
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
2057
2027
|
case 1:
|
|
@@ -2096,10 +2066,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2096
2066
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
2097
2067
|
*/
|
|
2098
2068
|
SapQueryRunner.prototype.loadTables = function (tableNames) {
|
|
2099
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2069
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2100
2070
|
var currentSchema, currentDatabase, dbTables, tablesSql, _a, _b, _c, _d, tablesCondition, tablesSql, _e, _f, _g, _h, columnsCondition, columnsSql, constraintsCondition, constraintsSql, indicesCondition, indicesSql, foreignKeysCondition, foreignKeysSql, _j, dbColumns, dbConstraints, dbIndices, dbForeignKeys;
|
|
2101
2071
|
var _this = this;
|
|
2102
|
-
return tslib_1.__generator(this, function (_k) {
|
|
2072
|
+
return (0, tslib_1.__generator)(this, function (_k) {
|
|
2103
2073
|
switch (_k.label) {
|
|
2104
2074
|
case 0:
|
|
2105
2075
|
if (tableNames && tableNames.length === 0) {
|
|
@@ -2119,11 +2089,11 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2119
2089
|
_d = [[]];
|
|
2120
2090
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2121
2091
|
case 3:
|
|
2122
|
-
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2092
|
+
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2123
2093
|
return [3 /*break*/, 6];
|
|
2124
2094
|
case 4:
|
|
2125
2095
|
tablesCondition = tableNames.map(function (tableName) {
|
|
2126
|
-
var _a = tslib_1.__read(tableName.split("."), 2), schema = _a[0], name = _a[1];
|
|
2096
|
+
var _a = (0, tslib_1.__read)(tableName.split("."), 2), schema = _a[0], name = _a[1];
|
|
2127
2097
|
if (!name) {
|
|
2128
2098
|
name = schema;
|
|
2129
2099
|
schema = _this.driver.options.schema || currentSchema;
|
|
@@ -2136,7 +2106,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2136
2106
|
_h = [[]];
|
|
2137
2107
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2138
2108
|
case 5:
|
|
2139
|
-
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2109
|
+
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2140
2110
|
_k.label = 6;
|
|
2141
2111
|
case 6:
|
|
2142
2112
|
// if tables were not found in the db, no need to proceed
|
|
@@ -2173,10 +2143,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2173
2143
|
case 7:
|
|
2174
2144
|
_j = tslib_1.__read.apply(void 0, [_k.sent(), 4]), dbColumns = _j[0], dbConstraints = _j[1], dbIndices = _j[2], dbForeignKeys = _j[3];
|
|
2175
2145
|
// create tables for loaded tables
|
|
2176
|
-
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
2146
|
+
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2177
2147
|
var table, getSchemaFromKey, schema, _a, tableCheckConstraints, tableForeignKeyConstraints, tableIndexConstraints;
|
|
2178
2148
|
var _this = this;
|
|
2179
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2149
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2180
2150
|
switch (_b.label) {
|
|
2181
2151
|
case 0:
|
|
2182
2152
|
table = new Table_1.Table();
|
|
@@ -2193,10 +2163,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2193
2163
|
_a = table;
|
|
2194
2164
|
return [4 /*yield*/, Promise.all(dbColumns
|
|
2195
2165
|
.filter(function (dbColumn) { return dbColumn["TABLE_NAME"] === dbTable["TABLE_NAME"] && dbColumn["SCHEMA_NAME"] === dbTable["SCHEMA_NAME"]; })
|
|
2196
|
-
.map(function (dbColumn) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
2166
|
+
.map(function (dbColumn) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2197
2167
|
var columnConstraints, columnUniqueIndex, tableMetadata, hasIgnoredIndex, isConstraintComposite, tableColumn, length;
|
|
2198
2168
|
var _this = this;
|
|
2199
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2169
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2200
2170
|
columnConstraints = dbConstraints.filter(function (dbConstraint) { return (dbConstraint["TABLE_NAME"] === dbColumn["TABLE_NAME"] &&
|
|
2201
2171
|
dbConstraint["SCHEMA_NAME"] === dbColumn["SCHEMA_NAME"] &&
|
|
2202
2172
|
dbConstraint["COLUMN_NAME"] === dbColumn["COLUMN_NAME"]); });
|
|
@@ -2421,9 +2391,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2421
2391
|
}
|
|
2422
2392
|
};
|
|
2423
2393
|
SapQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2424
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2394
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2425
2395
|
var _a, schema, name, expression, _b, query, parameters;
|
|
2426
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2396
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2427
2397
|
switch (_c.label) {
|
|
2428
2398
|
case 0:
|
|
2429
2399
|
_a = this.driver.parseTableName(view), schema = _a.schema, name = _a.tableName;
|
|
@@ -2434,7 +2404,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2434
2404
|
_c.label = 2;
|
|
2435
2405
|
case 2:
|
|
2436
2406
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2437
|
-
_b = tslib_1.__read(this.connection.createQueryBuilder()
|
|
2407
|
+
_b = (0, tslib_1.__read)(this.connection.createQueryBuilder()
|
|
2438
2408
|
.insert()
|
|
2439
2409
|
.into(this.getTypeormMetadataTableName())
|
|
2440
2410
|
.values({ type: "VIEW", schema: schema, name: name, value: expression })
|
|
@@ -2454,9 +2424,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2454
2424
|
* Builds remove view sql.
|
|
2455
2425
|
*/
|
|
2456
2426
|
SapQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
|
|
2457
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2427
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2458
2428
|
var _a, schema, name, qb, _b, query, parameters;
|
|
2459
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2429
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2460
2430
|
switch (_c.label) {
|
|
2461
2431
|
case 0:
|
|
2462
2432
|
_a = this.driver.parseTableName(viewOrPath), schema = _a.schema, name = _a.tableName;
|
|
@@ -2467,7 +2437,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2467
2437
|
_c.label = 2;
|
|
2468
2438
|
case 2:
|
|
2469
2439
|
qb = this.connection.createQueryBuilder();
|
|
2470
|
-
_b = tslib_1.__read(qb.delete()
|
|
2440
|
+
_b = (0, tslib_1.__read)(qb.delete()
|
|
2471
2441
|
.from(this.getTypeormMetadataTableName())
|
|
2472
2442
|
.where(qb.escape("type") + " = 'VIEW'")
|
|
2473
2443
|
.andWhere(qb.escape("schema") + " = :schema", { schema: schema })
|