typeorm 0.2.38 → 0.2.39-dev.1649882
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -59
- package/browser/connection/ConnectionMetadataBuilder.js +4 -4
- package/browser/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/browser/connection/ConnectionOptionsReader.js +2 -1
- package/browser/connection/ConnectionOptionsReader.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/browser/decorator/entity-view/ViewEntity.js +1 -0
- package/browser/decorator/entity-view/ViewEntity.js.map +1 -1
- package/browser/decorator/options/ViewEntityOptions.d.ts +5 -0
- package/browser/decorator/options/ViewEntityOptions.js.map +1 -1
- package/browser/decorator/transaction/Transaction.js +3 -3
- package/browser/decorator/transaction/Transaction.js.map +1 -1
- package/browser/driver/DriverUtils.js +1 -1
- package/browser/driver/DriverUtils.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +5 -0
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js +6 -5
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +19 -48
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +5 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +2 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +17 -46
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +5 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js +4 -3
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachConnectionOptions.d.ts +10 -0
- package/browser/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachDriver.js +28 -18
- package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +109 -146
- package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/browser/driver/cordova/CordovaConnectionOptions.d.ts +5 -0
- package/browser/driver/cordova/CordovaConnectionOptions.js.map +1 -1
- package/browser/driver/cordova/CordovaDriver.d.ts +1 -1
- package/browser/driver/cordova/CordovaDriver.js +27 -19
- package/browser/driver/cordova/CordovaDriver.js.map +1 -1
- package/browser/driver/cordova/CordovaQueryRunner.js +50 -43
- package/browser/driver/cordova/CordovaQueryRunner.js.map +1 -1
- package/browser/driver/expo/ExpoQueryRunner.js +12 -43
- package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/MongoConnectionOptions.d.ts +5 -0
- package/browser/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/browser/driver/mongodb/MongoDriver.js +2 -1
- package/browser/driver/mongodb/MongoDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlConnectionOptions.d.ts +6 -0
- package/browser/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/browser/driver/mysql/MysqlDriver.js +4 -2
- package/browser/driver/mysql/MysqlDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.js +24 -54
- package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/browser/driver/nativescript/NativescriptQueryRunner.js +45 -37
- package/browser/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/browser/driver/oracle/OracleConnectionOptions.d.ts +5 -0
- package/browser/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/browser/driver/oracle/OracleDriver.js +5 -4
- package/browser/driver/oracle/OracleDriver.js.map +1 -1
- package/browser/driver/oracle/OracleQueryRunner.js +20 -48
- package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.d.ts +10 -0
- package/browser/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresDriver.d.ts +2 -2
- package/browser/driver/postgres/PostgresDriver.js +37 -45
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +28 -66
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/react-native/ReactNativeConnectionOptions.d.ts +5 -0
- package/browser/driver/react-native/ReactNativeConnectionOptions.js.map +1 -1
- package/browser/driver/react-native/ReactNativeDriver.js +2 -1
- package/browser/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/browser/driver/sap/SapConnectionOptions.d.ts +16 -6
- package/browser/driver/sap/SapConnectionOptions.js.map +1 -1
- package/browser/driver/sap/SapDriver.js +6 -3
- package/browser/driver/sap/SapDriver.js.map +1 -1
- package/browser/driver/sap/SapQueryRunner.js +30 -78
- package/browser/driver/sap/SapQueryRunner.js.map +1 -1
- package/browser/driver/sqlite/SqliteConnectionOptions.d.ts +5 -0
- package/browser/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/browser/driver/sqlite/SqliteDriver.js +4 -3
- package/browser/driver/sqlite/SqliteDriver.js.map +1 -1
- package/browser/driver/sqlite/SqliteQueryRunner.js +16 -8
- package/browser/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +19 -49
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqljs/SqljsConnectionOptions.d.ts +5 -0
- package/browser/driver/sqljs/SqljsConnectionOptions.js.map +1 -1
- package/browser/driver/sqljs/SqljsDriver.js +9 -24
- package/browser/driver/sqljs/SqljsDriver.js.map +1 -1
- package/browser/driver/sqljs/SqljsQueryRunner.js +9 -10
- package/browser/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/browser/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerDriver.js +7 -6
- package/browser/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.js +84 -116
- package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/browser/entity-manager/MongoEntityManager.js +8 -13
- package/browser/entity-manager/MongoEntityManager.js.map +1 -1
- package/browser/find-options/FindOptionsUtils.js +1 -1
- package/browser/find-options/FindOptionsUtils.js.map +1 -1
- package/browser/metadata/ColumnMetadata.js +4 -4
- package/browser/metadata/ColumnMetadata.js.map +1 -1
- package/browser/metadata/EmbeddedMetadata.js +1 -1
- package/browser/metadata/EmbeddedMetadata.js.map +1 -1
- package/browser/metadata/EntityMetadata.d.ts +5 -0
- package/browser/metadata/EntityMetadata.js +2 -1
- package/browser/metadata/EntityMetadata.js.map +1 -1
- package/browser/metadata/RelationMetadata.js +4 -4
- package/browser/metadata/RelationMetadata.js.map +1 -1
- package/browser/metadata-args/TableMetadataArgs.d.ts +4 -0
- package/browser/metadata-args/TableMetadataArgs.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/browser/migration/MigrationExecutor.d.ts +1 -1
- package/browser/migration/MigrationExecutor.js +6 -14
- package/browser/migration/MigrationExecutor.js.map +1 -1
- package/browser/naming-strategy/DefaultNamingStrategy.js +5 -5
- package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/browser/persistence/Subject.js +1 -1
- package/browser/persistence/Subject.js.map +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/browser/persistence/SubjectExecutor.js +4 -4
- package/browser/persistence/SubjectExecutor.js.map +1 -1
- package/browser/persistence/SubjectTopoligicalSorter.js +5 -5
- package/browser/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/browser/persistence/subject-builder/OneToManySubjectBuilder.js +10 -4
- package/browser/persistence/subject-builder/OneToManySubjectBuilder.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.d.ts +1 -1
- package/browser/query-builder/SelectQueryBuilder.js +33 -17
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-builder/SoftDeleteQueryBuilder.js +3 -10
- package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/UpdateQueryBuilder.js +5 -12
- package/browser/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/browser/query-builder/relation-id/RelationIdLoader.js +1 -1
- package/browser/query-builder/relation-id/RelationIdLoader.js.map +1 -1
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js +4 -10
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.js +5 -4
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/query-runner/QueryLock.js +1 -1
- package/browser/query-runner/QueryLock.js.map +1 -1
- package/browser/repository/BaseEntity.js +1 -1
- package/browser/repository/BaseEntity.js.map +1 -1
- package/browser/repository/Repository.js +1 -1
- package/browser/repository/Repository.js.map +1 -1
- package/browser/repository/TreeRepository.js +2 -2
- package/browser/repository/TreeRepository.js.map +1 -1
- package/browser/schema-builder/RdbmsSchemaBuilder.js +223 -148
- package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/browser/schema-builder/table/TableCheck.js +1 -1
- package/browser/schema-builder/table/TableCheck.js.map +1 -1
- package/browser/schema-builder/table/TableForeignKey.js +2 -2
- package/browser/schema-builder/table/TableForeignKey.js.map +1 -1
- package/browser/schema-builder/table/TableIndex.js +1 -1
- package/browser/schema-builder/table/TableIndex.js.map +1 -1
- package/browser/schema-builder/table/TableUnique.js +1 -1
- package/browser/schema-builder/table/TableUnique.js.map +1 -1
- package/browser/schema-builder/util/ViewUtils.d.ts +7 -0
- package/browser/schema-builder/util/ViewUtils.js +25 -0
- package/browser/schema-builder/util/ViewUtils.js.map +1 -0
- package/browser/subscriber/Broadcaster.d.ts +23 -2
- package/browser/subscriber/Broadcaster.js +35 -2
- package/browser/subscriber/Broadcaster.js.map +1 -1
- package/browser/subscriber/BroadcasterResult.d.ts +4 -0
- package/browser/subscriber/BroadcasterResult.js +19 -0
- package/browser/subscriber/BroadcasterResult.js.map +1 -1
- package/cache/DbQueryResultCache.js +12 -12
- package/cache/RedisQueryResultCache.js +12 -12
- package/cli.js +1 -6
- package/cli.js.map +1 -1
- package/commands/CacheClearCommand.js +4 -4
- package/commands/CacheClearCommand.js.map +1 -1
- package/commands/CommandUtils.js +10 -10
- package/commands/CommandUtils.js.map +1 -1
- package/commands/EntityCreateCommand.js +3 -3
- package/commands/EntityCreateCommand.js.map +1 -1
- package/commands/InitCommand.js +5 -5
- package/commands/InitCommand.js.map +1 -1
- package/commands/MigrationCreateCommand.js +5 -5
- package/commands/MigrationCreateCommand.js.map +1 -1
- package/commands/MigrationGenerateCommand.js +7 -7
- package/commands/MigrationGenerateCommand.js.map +1 -1
- package/commands/MigrationRevertCommand.js +4 -4
- package/commands/MigrationRevertCommand.js.map +1 -1
- package/commands/MigrationRunCommand.js +5 -5
- package/commands/MigrationRunCommand.js.map +1 -1
- package/commands/MigrationShowCommand.js +5 -5
- package/commands/MigrationShowCommand.js.map +1 -1
- package/commands/QueryCommand.js +4 -4
- package/commands/QueryCommand.js.map +1 -1
- package/commands/SchemaDropCommand.js +4 -4
- package/commands/SchemaDropCommand.js.map +1 -1
- package/commands/SchemaLogCommand.js +5 -5
- package/commands/SchemaLogCommand.js.map +1 -1
- package/commands/SchemaSyncCommand.js +4 -4
- package/commands/SchemaSyncCommand.js.map +1 -1
- package/commands/SubscriberCreateCommand.js +3 -3
- package/commands/SubscriberCreateCommand.js.map +1 -1
- package/commands/VersionCommand.js +3 -3
- package/commands/VersionCommand.js.map +1 -1
- package/connection/Connection.js +19 -19
- package/connection/Connection.js.map +1 -1
- package/connection/ConnectionMetadataBuilder.js +11 -11
- package/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/connection/ConnectionOptionsReader.js +11 -10
- package/connection/ConnectionOptionsReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsEnvReader.js +2 -2
- package/connection/options-reader/ConnectionOptionsXmlReader.js +3 -3
- package/connection/options-reader/ConnectionOptionsXmlReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsYmlReader.js +4 -4
- package/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/decorator/Check.js +1 -1
- package/decorator/Check.js.map +1 -1
- package/decorator/EntityRepository.js +1 -1
- package/decorator/EntityRepository.js.map +1 -1
- package/decorator/Exclusion.js +1 -1
- package/decorator/Exclusion.js.map +1 -1
- package/decorator/Generated.js +1 -1
- package/decorator/Generated.js.map +1 -1
- package/decorator/Index.js +1 -1
- package/decorator/Index.js.map +1 -1
- package/decorator/Unique.js +1 -1
- package/decorator/Unique.js.map +1 -1
- package/decorator/columns/Column.js +4 -4
- package/decorator/columns/Column.js.map +1 -1
- package/decorator/columns/CreateDateColumn.js +1 -1
- package/decorator/columns/CreateDateColumn.js.map +1 -1
- package/decorator/columns/DeleteDateColumn.js +1 -1
- package/decorator/columns/DeleteDateColumn.js.map +1 -1
- package/decorator/columns/ObjectIdColumn.js +1 -1
- package/decorator/columns/ObjectIdColumn.js.map +1 -1
- package/decorator/columns/PrimaryColumn.js +2 -2
- package/decorator/columns/PrimaryColumn.js.map +1 -1
- package/decorator/columns/PrimaryGeneratedColumn.js +2 -2
- package/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/decorator/columns/UpdateDateColumn.js +1 -1
- package/decorator/columns/UpdateDateColumn.js.map +1 -1
- package/decorator/columns/VersionColumn.js +1 -1
- package/decorator/columns/VersionColumn.js.map +1 -1
- package/decorator/columns/ViewColumn.js +1 -1
- package/decorator/columns/ViewColumn.js.map +1 -1
- package/decorator/entity/ChildEntity.js +2 -2
- package/decorator/entity/ChildEntity.js.map +1 -1
- package/decorator/entity/Entity.js +1 -1
- package/decorator/entity/Entity.js.map +1 -1
- package/decorator/entity/TableInheritance.js +1 -1
- package/decorator/entity/TableInheritance.js.map +1 -1
- package/decorator/entity-view/ViewEntity.js +2 -1
- package/decorator/entity-view/ViewEntity.js.map +1 -1
- package/decorator/listeners/AfterInsert.js +1 -1
- package/decorator/listeners/AfterInsert.js.map +1 -1
- package/decorator/listeners/AfterLoad.js +1 -1
- package/decorator/listeners/AfterLoad.js.map +1 -1
- package/decorator/listeners/AfterRemove.js +1 -1
- package/decorator/listeners/AfterRemove.js.map +1 -1
- package/decorator/listeners/AfterUpdate.js +1 -1
- package/decorator/listeners/AfterUpdate.js.map +1 -1
- package/decorator/listeners/BeforeInsert.js +1 -1
- package/decorator/listeners/BeforeInsert.js.map +1 -1
- package/decorator/listeners/BeforeRemove.js +1 -1
- package/decorator/listeners/BeforeRemove.js.map +1 -1
- package/decorator/listeners/BeforeUpdate.js +1 -1
- package/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/decorator/listeners/EventSubscriber.js +1 -1
- package/decorator/listeners/EventSubscriber.js.map +1 -1
- package/decorator/options/ViewEntityOptions.d.ts +5 -0
- package/decorator/options/ViewEntityOptions.js.map +1 -1
- package/decorator/relations/JoinColumn.js +1 -1
- package/decorator/relations/JoinColumn.js.map +1 -1
- package/decorator/relations/JoinTable.js +1 -1
- package/decorator/relations/JoinTable.js.map +1 -1
- package/decorator/relations/ManyToMany.js +1 -1
- package/decorator/relations/ManyToMany.js.map +1 -1
- package/decorator/relations/ManyToOne.js +1 -1
- package/decorator/relations/ManyToOne.js.map +1 -1
- package/decorator/relations/OneToMany.js +1 -1
- package/decorator/relations/OneToMany.js.map +1 -1
- package/decorator/relations/OneToOne.js +1 -1
- package/decorator/relations/OneToOne.js.map +1 -1
- package/decorator/relations/RelationCount.js +1 -1
- package/decorator/relations/RelationCount.js.map +1 -1
- package/decorator/relations/RelationId.js +1 -1
- package/decorator/relations/RelationId.js.map +1 -1
- package/decorator/transaction/Transaction.js +7 -7
- package/decorator/transaction/Transaction.js.map +1 -1
- package/decorator/transaction/TransactionManager.js +1 -1
- package/decorator/transaction/TransactionManager.js.map +1 -1
- package/decorator/transaction/TransactionRepository.js +1 -1
- package/decorator/transaction/TransactionRepository.js.map +1 -1
- package/decorator/tree/Tree.js +1 -1
- package/decorator/tree/Tree.js.map +1 -1
- package/decorator/tree/TreeChildren.js +1 -1
- package/decorator/tree/TreeChildren.js.map +1 -1
- package/decorator/tree/TreeLevelColumn.js +1 -1
- package/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/decorator/tree/TreeParent.js +1 -1
- package/decorator/tree/TreeParent.js.map +1 -1
- package/driver/DriverUtils.js +9 -9
- package/driver/DriverUtils.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +5 -0
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiDriver.js +12 -11
- package/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +146 -175
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +5 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +10 -9
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +29 -58
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +5 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3Driver.js +12 -11
- package/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +5 -5
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/driver/capacitor/CapacitorDriver.js +7 -7
- package/driver/capacitor/CapacitorDriver.js.map +1 -1
- package/driver/capacitor/CapacitorQueryRunner.js +5 -5
- package/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
- package/driver/cockroachdb/CockroachConnectionOptions.d.ts +10 -0
- package/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/driver/cockroachdb/CockroachDriver.js +38 -28
- package/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +241 -278
- package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/driver/cordova/CordovaConnectionOptions.d.ts +5 -0
- package/driver/cordova/CordovaConnectionOptions.js.map +1 -1
- package/driver/cordova/CordovaDriver.d.ts +1 -1
- package/driver/cordova/CordovaDriver.js +30 -22
- package/driver/cordova/CordovaDriver.js.map +1 -1
- package/driver/cordova/CordovaQueryRunner.js +61 -54
- package/driver/cordova/CordovaQueryRunner.js.map +1 -1
- package/driver/expo/ExpoDriver.js +3 -3
- package/driver/expo/ExpoDriver.js.map +1 -1
- package/driver/expo/ExpoQueryRunner.js +23 -54
- package/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/driver/mongodb/MongoConnectionOptions.d.ts +5 -0
- package/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/driver/mongodb/MongoDriver.js +4 -3
- package/driver/mongodb/MongoDriver.js.map +1 -1
- package/driver/mongodb/MongoQueryRunner.js +178 -178
- package/driver/mysql/MysqlConnectionOptions.d.ts +6 -0
- package/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/driver/mysql/MysqlDriver.js +9 -7
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.js +152 -182
- package/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/driver/nativescript/NativescriptDriver.js +3 -3
- package/driver/nativescript/NativescriptDriver.js.map +1 -1
- package/driver/nativescript/NativescriptQueryRunner.js +48 -40
- package/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/driver/oracle/OracleConnectionOptions.d.ts +5 -0
- package/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/driver/oracle/OracleDriver.js +13 -12
- package/driver/oracle/OracleDriver.js.map +1 -1
- package/driver/oracle/OracleQueryRunner.js +143 -171
- package/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/driver/postgres/PostgresConnectionOptions.d.ts +10 -0
- package/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/driver/postgres/PostgresDriver.d.ts +2 -2
- package/driver/postgres/PostgresDriver.js +52 -60
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.js +175 -213
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/react-native/ReactNativeConnectionOptions.d.ts +5 -0
- package/driver/react-native/ReactNativeConnectionOptions.js.map +1 -1
- package/driver/react-native/ReactNativeDriver.js +5 -4
- package/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/driver/react-native/ReactNativeQueryRunner.js +3 -3
- package/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
- package/driver/sap/SapConnectionOptions.d.ts +16 -6
- package/driver/sap/SapConnectionOptions.js.map +1 -1
- package/driver/sap/SapDriver.js +11 -8
- package/driver/sap/SapDriver.js.map +1 -1
- package/driver/sap/SapQueryRunner.js +159 -207
- package/driver/sap/SapQueryRunner.js.map +1 -1
- package/driver/sqlite/SqliteConnectionOptions.d.ts +5 -0
- package/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/driver/sqlite/SqliteDriver.js +12 -11
- package/driver/sqlite/SqliteDriver.js.map +1 -1
- package/driver/sqlite/SqliteQueryRunner.js +21 -13
- package/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteDriver.js +4 -4
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +138 -168
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqljs/SqljsConnectionOptions.d.ts +5 -0
- package/driver/sqljs/SqljsConnectionOptions.js.map +1 -1
- package/driver/sqljs/SqljsDriver.js +22 -37
- package/driver/sqljs/SqljsDriver.js.map +1 -1
- package/driver/sqljs/SqljsQueryRunner.js +17 -18
- package/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/driver/sqlserver/SqlServerDriver.js +13 -12
- package/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/driver/sqlserver/SqlServerQueryRunner.js +220 -252
- package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/entity-manager/EntityManager.js +30 -30
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-manager/MongoEntityManager.js +23 -28
- package/entity-manager/MongoEntityManager.js.map +1 -1
- package/entity-manager/SqljsEntityManager.js +5 -5
- package/entity-manager/SqljsEntityManager.js.map +1 -1
- package/entity-schema/EntitySchemaTransformer.js +1 -1
- package/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/error/AlreadyHasActiveConnectionError.js +1 -1
- package/error/AlreadyHasActiveConnectionError.js.map +1 -1
- package/error/CannotAttachTreeChildrenEntityError.js +1 -1
- package/error/CannotAttachTreeChildrenEntityError.js.map +1 -1
- package/error/CannotConnectAlreadyConnectedError.js +1 -1
- package/error/CannotConnectAlreadyConnectedError.js.map +1 -1
- package/error/CannotCreateEntityIdMapError.js +1 -1
- package/error/CannotCreateEntityIdMapError.js.map +1 -1
- package/error/CannotDetermineEntityError.js +1 -1
- package/error/CannotDetermineEntityError.js.map +1 -1
- package/error/CannotExecuteNotConnectedError.js +1 -1
- package/error/CannotExecuteNotConnectedError.js.map +1 -1
- package/error/CannotGetEntityManagerNotConnectedError.js +1 -1
- package/error/CannotGetEntityManagerNotConnectedError.js.map +1 -1
- package/error/CannotReflectMethodParameterTypeError.js +1 -1
- package/error/CannotReflectMethodParameterTypeError.js.map +1 -1
- package/error/CircularRelationsError.js +1 -1
- package/error/CircularRelationsError.js.map +1 -1
- package/error/ColumnTypeUndefinedError.js +1 -1
- package/error/ColumnTypeUndefinedError.js.map +1 -1
- package/error/ConnectionIsNotSetError.js +1 -1
- package/error/ConnectionIsNotSetError.js.map +1 -1
- package/error/ConnectionNotFoundError.js +1 -1
- package/error/ConnectionNotFoundError.js.map +1 -1
- package/error/CustomRepositoryCannotInheritRepositoryError.js +1 -1
- package/error/CustomRepositoryCannotInheritRepositoryError.js.map +1 -1
- package/error/CustomRepositoryDoesNotHaveEntityError.js +1 -1
- package/error/CustomRepositoryDoesNotHaveEntityError.js.map +1 -1
- package/error/CustomRepositoryNotFoundError.js +1 -1
- package/error/CustomRepositoryNotFoundError.js.map +1 -1
- package/error/DataTypeNotSupportedError.js +1 -1
- package/error/DataTypeNotSupportedError.js.map +1 -1
- package/error/DriverOptionNotSetError.js +1 -1
- package/error/DriverOptionNotSetError.js.map +1 -1
- package/error/DriverPackageNotInstalledError.js +1 -1
- package/error/DriverPackageNotInstalledError.js.map +1 -1
- package/error/EntityColumnNotFound.js +1 -1
- package/error/EntityColumnNotFound.js.map +1 -1
- package/error/EntityMetadataNotFoundError.js +1 -1
- package/error/EntityMetadataNotFoundError.js.map +1 -1
- package/error/EntityNotFoundError.js +1 -1
- package/error/EntityNotFoundError.js.map +1 -1
- package/error/FindRelationsNotFoundError.js +1 -1
- package/error/FindRelationsNotFoundError.js.map +1 -1
- package/error/InitializedRelationError.js +1 -1
- package/error/InitializedRelationError.js.map +1 -1
- package/error/InsertValuesMissingError.js +1 -1
- package/error/InsertValuesMissingError.js.map +1 -1
- package/error/LimitOnUpdateNotSupportedError.js +1 -1
- package/error/LimitOnUpdateNotSupportedError.js.map +1 -1
- package/error/LockNotSupportedOnGivenDriverError.js +1 -1
- package/error/LockNotSupportedOnGivenDriverError.js.map +1 -1
- package/error/MetadataAlreadyExistsError.js +1 -1
- package/error/MetadataAlreadyExistsError.js.map +1 -1
- package/error/MetadataWithSuchNameAlreadyExistsError.js +1 -1
- package/error/MetadataWithSuchNameAlreadyExistsError.js.map +1 -1
- package/error/MissingDeleteDateColumnError.js +1 -1
- package/error/MissingDeleteDateColumnError.js.map +1 -1
- package/error/MissingDriverError.js +1 -1
- package/error/MissingDriverError.js.map +1 -1
- package/error/MissingJoinColumnError.js +1 -1
- package/error/MissingJoinColumnError.js.map +1 -1
- package/error/MissingJoinTableError.js +1 -1
- package/error/MissingJoinTableError.js.map +1 -1
- package/error/MissingPrimaryColumnError.js +1 -1
- package/error/MissingPrimaryColumnError.js.map +1 -1
- package/error/MustBeEntityError.js +1 -1
- package/error/MustBeEntityError.js.map +1 -1
- package/error/NamingStrategyNotFoundError.js +1 -1
- package/error/NamingStrategyNotFoundError.js.map +1 -1
- package/error/NestedSetMultipleRootError.js +1 -1
- package/error/NestedSetMultipleRootError.js.map +1 -1
- package/error/NoConnectionForRepositoryError.js +1 -1
- package/error/NoConnectionForRepositoryError.js.map +1 -1
- package/error/NoConnectionOptionError.js +1 -1
- package/error/NoConnectionOptionError.js.map +1 -1
- package/error/NoNeedToReleaseEntityManagerError.js +1 -1
- package/error/NoNeedToReleaseEntityManagerError.js.map +1 -1
- package/error/NoVersionOrUpdateDateColumnError.js +1 -1
- package/error/NoVersionOrUpdateDateColumnError.js.map +1 -1
- package/error/OffsetWithoutLimitNotSupportedError.js +1 -1
- package/error/OffsetWithoutLimitNotSupportedError.js.map +1 -1
- package/error/OptimisticLockCanNotBeUsedError.js +1 -1
- package/error/OptimisticLockCanNotBeUsedError.js.map +1 -1
- package/error/OptimisticLockVersionMismatchError.js +1 -1
- package/error/OptimisticLockVersionMismatchError.js.map +1 -1
- package/error/PersistedEntityNotFoundError.js +1 -1
- package/error/PersistedEntityNotFoundError.js.map +1 -1
- package/error/PessimisticLockTransactionRequiredError.js +1 -1
- package/error/PessimisticLockTransactionRequiredError.js.map +1 -1
- package/error/PrimaryColumnCannotBeNullableError.js +1 -1
- package/error/PrimaryColumnCannotBeNullableError.js.map +1 -1
- package/error/QueryFailedError.js +3 -3
- package/error/QueryFailedError.js.map +1 -1
- package/error/QueryRunnerAlreadyReleasedError.js +1 -1
- package/error/QueryRunnerAlreadyReleasedError.js.map +1 -1
- package/error/QueryRunnerProviderAlreadyReleasedError.js +1 -1
- package/error/QueryRunnerProviderAlreadyReleasedError.js.map +1 -1
- package/error/RepositoryNotFoundError.js +1 -1
- package/error/RepositoryNotFoundError.js.map +1 -1
- package/error/RepositoryNotTreeError.js +1 -1
- package/error/RepositoryNotTreeError.js.map +1 -1
- package/error/ReturningStatementNotSupportedError.js +1 -1
- package/error/ReturningStatementNotSupportedError.js.map +1 -1
- package/error/SubjectRemovedAndUpdatedError.js +1 -1
- package/error/SubjectRemovedAndUpdatedError.js.map +1 -1
- package/error/SubjectWithoutIdentifierError.js +1 -1
- package/error/SubjectWithoutIdentifierError.js.map +1 -1
- package/error/TransactionAlreadyStartedError.js +1 -1
- package/error/TransactionAlreadyStartedError.js.map +1 -1
- package/error/TransactionNotStartedError.js +1 -1
- package/error/TransactionNotStartedError.js.map +1 -1
- package/error/TreeRepositoryNotSupportedError.js +1 -1
- package/error/TreeRepositoryNotSupportedError.js.map +1 -1
- package/error/TypeORMError.js +1 -1
- package/error/TypeORMError.js.map +1 -1
- package/error/UpdateValuesMissingError.js +1 -1
- package/error/UpdateValuesMissingError.js.map +1 -1
- package/error/UsingJoinColumnIsNotAllowedError.js +1 -1
- package/error/UsingJoinColumnIsNotAllowedError.js.map +1 -1
- package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +1 -1
- package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js.map +1 -1
- package/error/UsingJoinTableIsNotAllowedError.js +1 -1
- package/error/UsingJoinTableIsNotAllowedError.js.map +1 -1
- package/error/UsingJoinTableOnlyOnOneSideAllowedError.js +1 -1
- package/error/UsingJoinTableOnlyOnOneSideAllowedError.js.map +1 -1
- package/error/index.js +62 -62
- package/error/index.js.map +1 -1
- package/find-options/FindOptionsUtils.js +4 -4
- package/find-options/FindOptionsUtils.js.map +1 -1
- package/globals.js +7 -7
- package/globals.js.map +1 -1
- package/index.js +102 -102
- package/index.js.map +1 -1
- package/logger/DebugLogger.js +9 -9
- package/logger/DebugLogger.js.map +1 -1
- package/logger/FileLogger.js +1 -1
- package/logger/FileLogger.js.map +1 -1
- package/metadata/ColumnMetadata.js +4 -4
- package/metadata/ColumnMetadata.js.map +1 -1
- package/metadata/EmbeddedMetadata.js +1 -1
- package/metadata/EmbeddedMetadata.js.map +1 -1
- package/metadata/EntityMetadata.d.ts +5 -0
- package/metadata/EntityMetadata.js +3 -2
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/RelationMetadata.js +4 -4
- package/metadata/RelationMetadata.js.map +1 -1
- package/metadata-args/TableMetadataArgs.d.ts +4 -0
- package/metadata-args/TableMetadataArgs.js.map +1 -1
- package/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/migration/MigrationExecutor.d.ts +1 -1
- package/migration/MigrationExecutor.js +39 -47
- package/migration/MigrationExecutor.js.map +1 -1
- package/naming-strategy/DefaultNamingStrategy.js +10 -10
- package/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/package.json +1 -239
- package/persistence/EntityPersistExecutor.js +5 -5
- package/persistence/EntityPersistExecutor.js.map +1 -1
- package/persistence/Subject.js +1 -1
- package/persistence/Subject.js.map +1 -1
- package/persistence/SubjectDatabaseEntityLoader.js +6 -6
- package/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/persistence/SubjectExecutor.js +33 -33
- package/persistence/SubjectExecutor.js.map +1 -1
- package/persistence/SubjectTopoligicalSorter.js +5 -5
- package/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/persistence/subject-builder/CascadesSubjectBuilder.js +1 -1
- package/persistence/subject-builder/CascadesSubjectBuilder.js.map +1 -1
- package/persistence/subject-builder/OneToManySubjectBuilder.js +10 -4
- package/persistence/subject-builder/OneToManySubjectBuilder.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.d.ts +1 -1
- package/query-builder/SelectQueryBuilder.js +61 -45
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-builder/SoftDeleteQueryBuilder.js +7 -14
- package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/query-builder/UpdateQueryBuilder.js +10 -17
- package/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/query-builder/relation-count/RelationCountAttribute.js +2 -2
- package/query-builder/relation-count/RelationCountAttribute.js.map +1 -1
- package/query-builder/relation-count/RelationCountLoader.js +4 -4
- package/query-builder/relation-id/RelationIdAttribute.js +1 -1
- package/query-builder/relation-id/RelationIdAttribute.js.map +1 -1
- package/query-builder/relation-id/RelationIdLoader.js +5 -5
- package/query-builder/relation-id/RelationIdLoader.js.map +1 -1
- package/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +3 -3
- package/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js.map +1 -1
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js +4 -10
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/query-runner/BaseQueryRunner.js +28 -27
- package/query-runner/BaseQueryRunner.js.map +1 -1
- package/query-runner/QueryLock.js +3 -3
- package/query-runner/QueryLock.js.map +1 -1
- package/repository/AbstractRepository.js +1 -1
- package/repository/AbstractRepository.js.map +1 -1
- package/repository/BaseEntity.js +4 -4
- package/repository/BaseEntity.js.map +1 -1
- package/repository/MongoRepository.js +1 -1
- package/repository/MongoRepository.js.map +1 -1
- package/repository/Repository.js +1 -1
- package/repository/Repository.js.map +1 -1
- package/repository/TreeRepository.js +7 -7
- package/repository/TreeRepository.js.map +1 -1
- package/schema-builder/MongoSchemaBuilder.js +2 -2
- package/schema-builder/RdbmsSchemaBuilder.js +311 -236
- package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/schema-builder/table/Table.js +1 -1
- package/schema-builder/table/Table.js.map +1 -1
- package/schema-builder/table/TableCheck.js +1 -1
- package/schema-builder/table/TableCheck.js.map +1 -1
- package/schema-builder/table/TableForeignKey.js +2 -2
- package/schema-builder/table/TableForeignKey.js.map +1 -1
- package/schema-builder/table/TableIndex.js +1 -1
- package/schema-builder/table/TableIndex.js.map +1 -1
- package/schema-builder/table/TableUnique.js +1 -1
- package/schema-builder/table/TableUnique.js.map +1 -1
- package/schema-builder/util/ViewUtils.d.ts +7 -0
- package/schema-builder/util/ViewUtils.js +28 -0
- package/schema-builder/util/ViewUtils.js.map +1 -0
- package/subscriber/Broadcaster.d.ts +23 -2
- package/subscriber/Broadcaster.js +35 -2
- package/subscriber/Broadcaster.js.map +1 -1
- package/subscriber/BroadcasterResult.d.ts +4 -0
- package/subscriber/BroadcasterResult.js +19 -0
- package/subscriber/BroadcasterResult.js.map +1 -1
- package/util/DateUtils.js +1 -1
- package/util/DateUtils.js.map +1 -1
- package/util/DirectoryExportedClassesLoader.js +1 -1
- package/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/util/ObjectUtils.js +2 -2
- package/util/ObjectUtils.js.map +1 -1
- package/util/OrmUtils.js +2 -2
- package/util/OrmUtils.js.map +1 -1
- package/util/StringUtils.js +2 -2
- package/util/StringUtils.js.map +1 -1
|
@@ -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,9 @@ 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 () {
|
|
195
|
-
var release, statement, result, databaseConnection_1,
|
|
196
|
-
|
|
197
|
-
return tslib_1.__generator(this, function (_a) {
|
|
164
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
165
|
+
var release, statement, result, databaseConnection_1, queryStartTime, isInsertQuery, raw, maxQueryExecutionTime, queryEndTime, queryExecutionTime, lastIdQuery_1, identityValueResult, e_1;
|
|
166
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
198
167
|
switch (_a.label) {
|
|
199
168
|
case 0:
|
|
200
169
|
if (this.isReleased)
|
|
@@ -212,29 +181,20 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
212
181
|
// we disable autocommit because ROLLBACK does not work in autocommit mode
|
|
213
182
|
databaseConnection_1.setAutoCommit(!this.isTransactionActive);
|
|
214
183
|
this.driver.connection.logger.logQuery(query, parameters, this);
|
|
215
|
-
|
|
184
|
+
queryStartTime = +new Date();
|
|
216
185
|
isInsertQuery = query.substr(0, 11) === "INSERT INTO";
|
|
217
186
|
statement = databaseConnection_1.prepare(query);
|
|
218
187
|
return [4 /*yield*/, new Promise(function (ok, fail) {
|
|
219
|
-
statement.exec(parameters, function (err, raw) { return
|
|
220
|
-
var maxQueryExecutionTime, queryEndTime, queryExecutionTime;
|
|
221
|
-
return tslib_1.__generator(this, function (_a) {
|
|
222
|
-
maxQueryExecutionTime = this.driver.connection.options.maxQueryExecutionTime;
|
|
223
|
-
queryEndTime = +new Date();
|
|
224
|
-
queryExecutionTime = queryEndTime - queryStartTime_1;
|
|
225
|
-
if (maxQueryExecutionTime && queryExecutionTime > maxQueryExecutionTime) {
|
|
226
|
-
this.driver.connection.logger.logQuerySlow(queryExecutionTime, query, parameters, this);
|
|
227
|
-
}
|
|
228
|
-
if (err) {
|
|
229
|
-
fail(new error_1.QueryFailedError(query, parameters, err));
|
|
230
|
-
}
|
|
231
|
-
ok(raw);
|
|
232
|
-
return [2 /*return*/];
|
|
233
|
-
});
|
|
234
|
-
}); });
|
|
188
|
+
statement.exec(parameters, function (err, raw) { return err ? fail(new error_1.QueryFailedError(query, parameters, err)) : ok(raw); });
|
|
235
189
|
})];
|
|
236
190
|
case 4:
|
|
237
191
|
raw = _a.sent();
|
|
192
|
+
maxQueryExecutionTime = this.driver.connection.options.maxQueryExecutionTime;
|
|
193
|
+
queryEndTime = +new Date();
|
|
194
|
+
queryExecutionTime = queryEndTime - queryStartTime;
|
|
195
|
+
if (maxQueryExecutionTime && queryExecutionTime > maxQueryExecutionTime) {
|
|
196
|
+
this.driver.connection.logger.logQuerySlow(queryExecutionTime, query, parameters, this);
|
|
197
|
+
}
|
|
238
198
|
if (typeof raw === "number") {
|
|
239
199
|
result.affected = raw;
|
|
240
200
|
}
|
|
@@ -246,15 +206,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
246
206
|
lastIdQuery_1 = "SELECT CURRENT_IDENTITY_VALUE() FROM \"SYS\".\"DUMMY\"";
|
|
247
207
|
this.driver.connection.logger.logQuery(lastIdQuery_1, [], this);
|
|
248
208
|
return [4 /*yield*/, new Promise(function (ok, fail) {
|
|
249
|
-
databaseConnection_1.exec(lastIdQuery_1, function (err, raw) { return
|
|
250
|
-
return tslib_1.__generator(this, function (_a) {
|
|
251
|
-
if (err) {
|
|
252
|
-
fail(new error_1.QueryFailedError(lastIdQuery_1, [], err));
|
|
253
|
-
}
|
|
254
|
-
ok(raw);
|
|
255
|
-
return [2 /*return*/];
|
|
256
|
-
});
|
|
257
|
-
}); });
|
|
209
|
+
databaseConnection_1.exec(lastIdQuery_1, function (err, raw) { return err ? fail(new error_1.QueryFailedError(lastIdQuery_1, [], err)) : ok(raw); });
|
|
258
210
|
})];
|
|
259
211
|
case 5:
|
|
260
212
|
identityValueResult = _a.sent();
|
|
@@ -292,8 +244,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
292
244
|
* Returns raw data stream.
|
|
293
245
|
*/
|
|
294
246
|
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) {
|
|
247
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
248
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
297
249
|
throw new error_1.TypeORMError("Stream is not supported by SAP driver.");
|
|
298
250
|
});
|
|
299
251
|
});
|
|
@@ -302,9 +254,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
302
254
|
* Returns all available database names including system databases.
|
|
303
255
|
*/
|
|
304
256
|
SapQueryRunner.prototype.getDatabases = function () {
|
|
305
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
257
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
306
258
|
var results;
|
|
307
|
-
return tslib_1.__generator(this, function (_a) {
|
|
259
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
308
260
|
switch (_a.label) {
|
|
309
261
|
case 0: return [4 /*yield*/, this.query("SELECT DATABASE_NAME FROM \"SYS\".\"M_DATABASES\"")];
|
|
310
262
|
case 1:
|
|
@@ -319,9 +271,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
319
271
|
* If database parameter specified, returns schemas of that database.
|
|
320
272
|
*/
|
|
321
273
|
SapQueryRunner.prototype.getSchemas = function (database) {
|
|
322
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
274
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
323
275
|
var query, results;
|
|
324
|
-
return tslib_1.__generator(this, function (_a) {
|
|
276
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
325
277
|
switch (_a.label) {
|
|
326
278
|
case 0:
|
|
327
279
|
query = database ? "SELECT * FROM \"" + database + "\".\"SYS\".\"SCHEMAS\"" : "SELECT * FROM \"SYS\".\"SCHEMAS\"";
|
|
@@ -337,9 +289,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
337
289
|
* Checks if database with the given name exist.
|
|
338
290
|
*/
|
|
339
291
|
SapQueryRunner.prototype.hasDatabase = function (database) {
|
|
340
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
292
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
341
293
|
var databases;
|
|
342
|
-
return tslib_1.__generator(this, function (_a) {
|
|
294
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
343
295
|
switch (_a.label) {
|
|
344
296
|
case 0: return [4 /*yield*/, this.getDatabases()];
|
|
345
297
|
case 1:
|
|
@@ -353,9 +305,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
353
305
|
* Returns current database.
|
|
354
306
|
*/
|
|
355
307
|
SapQueryRunner.prototype.getCurrentDatabase = function () {
|
|
356
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
308
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
357
309
|
var currentDBQuery;
|
|
358
|
-
return tslib_1.__generator(this, function (_a) {
|
|
310
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
359
311
|
switch (_a.label) {
|
|
360
312
|
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
313
|
case 1:
|
|
@@ -369,9 +321,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
369
321
|
* Checks if schema with the given name exist.
|
|
370
322
|
*/
|
|
371
323
|
SapQueryRunner.prototype.hasSchema = function (schema) {
|
|
372
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
324
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
373
325
|
var schemas;
|
|
374
|
-
return tslib_1.__generator(this, function (_a) {
|
|
326
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
375
327
|
switch (_a.label) {
|
|
376
328
|
case 0: return [4 /*yield*/, this.getSchemas()];
|
|
377
329
|
case 1:
|
|
@@ -385,9 +337,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
385
337
|
* Returns current schema.
|
|
386
338
|
*/
|
|
387
339
|
SapQueryRunner.prototype.getCurrentSchema = function () {
|
|
388
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
340
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
389
341
|
var currentSchemaQuery;
|
|
390
|
-
return tslib_1.__generator(this, function (_a) {
|
|
342
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
391
343
|
switch (_a.label) {
|
|
392
344
|
case 0: return [4 /*yield*/, this.query("SELECT CURRENT_SCHEMA AS \"schema_name\" FROM \"SYS\".\"DUMMY\"")];
|
|
393
345
|
case 1:
|
|
@@ -401,9 +353,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
401
353
|
* Checks if table with the given name exist in the database.
|
|
402
354
|
*/
|
|
403
355
|
SapQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
404
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
356
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
405
357
|
var parsedTableName, _a, sql, result;
|
|
406
|
-
return tslib_1.__generator(this, function (_b) {
|
|
358
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
407
359
|
switch (_b.label) {
|
|
408
360
|
case 0:
|
|
409
361
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -427,9 +379,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
427
379
|
* Checks if column with the given name exist in the given table.
|
|
428
380
|
*/
|
|
429
381
|
SapQueryRunner.prototype.hasColumn = function (tableOrName, columnName) {
|
|
430
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
382
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
431
383
|
var parsedTableName, _a, sql, result;
|
|
432
|
-
return tslib_1.__generator(this, function (_b) {
|
|
384
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
433
385
|
switch (_b.label) {
|
|
434
386
|
case 0:
|
|
435
387
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -453,8 +405,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
453
405
|
* Creates a new database.
|
|
454
406
|
*/
|
|
455
407
|
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) {
|
|
408
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
409
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
458
410
|
return [2 /*return*/, Promise.resolve()];
|
|
459
411
|
});
|
|
460
412
|
});
|
|
@@ -463,8 +415,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
463
415
|
* Drops database.
|
|
464
416
|
*/
|
|
465
417
|
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) {
|
|
418
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
419
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
468
420
|
return [2 /*return*/, Promise.resolve()];
|
|
469
421
|
});
|
|
470
422
|
});
|
|
@@ -473,9 +425,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
473
425
|
* Creates a new table schema.
|
|
474
426
|
*/
|
|
475
427
|
SapQueryRunner.prototype.createSchema = function (schemaPath, ifNotExist) {
|
|
476
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
428
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
477
429
|
var schema, exist, result, up, down;
|
|
478
|
-
return tslib_1.__generator(this, function (_a) {
|
|
430
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
479
431
|
switch (_a.label) {
|
|
480
432
|
case 0:
|
|
481
433
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[1];
|
|
@@ -503,9 +455,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
503
455
|
* Drops table schema
|
|
504
456
|
*/
|
|
505
457
|
SapQueryRunner.prototype.dropSchema = function (schemaPath, ifExist, isCascade) {
|
|
506
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
458
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
507
459
|
var schema, exist, result, up, down;
|
|
508
|
-
return tslib_1.__generator(this, function (_a) {
|
|
460
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
509
461
|
switch (_a.label) {
|
|
510
462
|
case 0:
|
|
511
463
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[0];
|
|
@@ -536,10 +488,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
536
488
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
537
489
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
538
490
|
if (createIndices === void 0) { createIndices = true; }
|
|
539
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
491
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
540
492
|
var isTableExist, upQueries, downQueries;
|
|
541
493
|
var _this = this;
|
|
542
|
-
return tslib_1.__generator(this, function (_a) {
|
|
494
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
543
495
|
switch (_a.label) {
|
|
544
496
|
case 0:
|
|
545
497
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -581,10 +533,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
581
533
|
SapQueryRunner.prototype.dropTable = function (tableOrName, ifExist, dropForeignKeys, dropIndices) {
|
|
582
534
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
583
535
|
if (dropIndices === void 0) { dropIndices = true; }
|
|
584
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
536
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
585
537
|
var isTableExist, createForeignKeys, table, _a, upQueries, downQueries;
|
|
586
538
|
var _this = this;
|
|
587
|
-
return tslib_1.__generator(this, function (_b) {
|
|
539
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
588
540
|
switch (_b.label) {
|
|
589
541
|
case 0:
|
|
590
542
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -633,9 +585,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
633
585
|
* Creates a new view.
|
|
634
586
|
*/
|
|
635
587
|
SapQueryRunner.prototype.createView = function (view) {
|
|
636
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
588
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
637
589
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
638
|
-
return tslib_1.__generator(this, function (_e) {
|
|
590
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
639
591
|
switch (_e.label) {
|
|
640
592
|
case 0:
|
|
641
593
|
upQueries = [];
|
|
@@ -662,9 +614,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
662
614
|
* Drops the view.
|
|
663
615
|
*/
|
|
664
616
|
SapQueryRunner.prototype.dropView = function (target) {
|
|
665
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
617
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
666
618
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
667
|
-
return tslib_1.__generator(this, function (_e) {
|
|
619
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
668
620
|
switch (_e.label) {
|
|
669
621
|
case 0:
|
|
670
622
|
viewName = target instanceof View_1.View ? target.name : target;
|
|
@@ -695,10 +647,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
695
647
|
* Renames a table.
|
|
696
648
|
*/
|
|
697
649
|
SapQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
698
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
650
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
699
651
|
var upQueries, downQueries, oldTable, _a, newTable, _b, schemaName, oldTableName, referencedForeignKeySql, dbForeignKeys, referencedForeignKeys, referencedForeignKeyTableMapping, columnNames, columnNamesString, oldPkName, newPkName;
|
|
700
652
|
var _this = this;
|
|
701
|
-
return tslib_1.__generator(this, function (_c) {
|
|
653
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
702
654
|
switch (_c.label) {
|
|
703
655
|
case 0:
|
|
704
656
|
upQueries = [];
|
|
@@ -806,10 +758,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
806
758
|
* Creates a new column from the column in the table.
|
|
807
759
|
*/
|
|
808
760
|
SapQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
809
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
761
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
810
762
|
var table, _a, parsedTableName, _b, clonedTable, upQueries, downQueries, primaryColumns, referencedForeignKeySql, dbForeignKeys_1, referencedForeignKeys, referencedForeignKeyTableMapping_1, pkName_1, columnNames_1, pkName, columnNames, columnIndex, uniqueIndex;
|
|
811
763
|
var _this = this;
|
|
812
|
-
return tslib_1.__generator(this, function (_c) {
|
|
764
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
813
765
|
switch (_c.label) {
|
|
814
766
|
case 0:
|
|
815
767
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -917,14 +869,14 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
917
869
|
* Creates a new columns from the column in the table.
|
|
918
870
|
*/
|
|
919
871
|
SapQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
920
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
872
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
921
873
|
var columns_1, columns_1_1, column, e_2_1;
|
|
922
874
|
var e_2, _a;
|
|
923
|
-
return tslib_1.__generator(this, function (_b) {
|
|
875
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
924
876
|
switch (_b.label) {
|
|
925
877
|
case 0:
|
|
926
878
|
_b.trys.push([0, 5, 6, 7]);
|
|
927
|
-
columns_1 = tslib_1.__values(columns), columns_1_1 = columns_1.next();
|
|
879
|
+
columns_1 = (0, tslib_1.__values)(columns), columns_1_1 = columns_1.next();
|
|
928
880
|
_b.label = 1;
|
|
929
881
|
case 1:
|
|
930
882
|
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -956,9 +908,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
956
908
|
* Renames column in the given table.
|
|
957
909
|
*/
|
|
958
910
|
SapQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
959
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
911
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
960
912
|
var table, _a, oldColumn, newColumn;
|
|
961
|
-
return tslib_1.__generator(this, function (_b) {
|
|
913
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
962
914
|
switch (_b.label) {
|
|
963
915
|
case 0:
|
|
964
916
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -993,10 +945,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
993
945
|
* Changes a column in the table.
|
|
994
946
|
*/
|
|
995
947
|
SapQueryRunner.prototype.changeColumn = function (tableOrName, oldTableColumnOrName, newColumn) {
|
|
996
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
948
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
997
949
|
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
950
|
var _this = this;
|
|
999
|
-
return tslib_1.__generator(this, function (_b) {
|
|
951
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1000
952
|
switch (_b.label) {
|
|
1001
953
|
case 0:
|
|
1002
954
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1188,14 +1140,14 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1188
1140
|
* Changes a column in the table.
|
|
1189
1141
|
*/
|
|
1190
1142
|
SapQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
1191
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1143
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1192
1144
|
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_3_1;
|
|
1193
1145
|
var e_3, _b;
|
|
1194
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1146
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1195
1147
|
switch (_c.label) {
|
|
1196
1148
|
case 0:
|
|
1197
1149
|
_c.trys.push([0, 5, 6, 7]);
|
|
1198
|
-
changedColumns_1 = tslib_1.__values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1150
|
+
changedColumns_1 = (0, tslib_1.__values)(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1199
1151
|
_c.label = 1;
|
|
1200
1152
|
case 1:
|
|
1201
1153
|
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1227,10 +1179,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1227
1179
|
* Drops column in the table.
|
|
1228
1180
|
*/
|
|
1229
1181
|
SapQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1230
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1182
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1231
1183
|
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
1184
|
var _this = this;
|
|
1233
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1185
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1234
1186
|
switch (_c.label) {
|
|
1235
1187
|
case 0:
|
|
1236
1188
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1350,14 +1302,14 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1350
1302
|
* Drops the columns in the table.
|
|
1351
1303
|
*/
|
|
1352
1304
|
SapQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1353
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1305
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1354
1306
|
var columns_2, columns_2_1, column, e_4_1;
|
|
1355
1307
|
var e_4, _a;
|
|
1356
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1308
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1357
1309
|
switch (_b.label) {
|
|
1358
1310
|
case 0:
|
|
1359
1311
|
_b.trys.push([0, 5, 6, 7]);
|
|
1360
|
-
columns_2 = tslib_1.__values(columns), columns_2_1 = columns_2.next();
|
|
1312
|
+
columns_2 = (0, tslib_1.__values)(columns), columns_2_1 = columns_2.next();
|
|
1361
1313
|
_b.label = 1;
|
|
1362
1314
|
case 1:
|
|
1363
1315
|
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1389,9 +1341,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1389
1341
|
* Creates a new primary key.
|
|
1390
1342
|
*/
|
|
1391
1343
|
SapQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1392
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1344
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1393
1345
|
var table, _a, clonedTable, up, down;
|
|
1394
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1346
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1395
1347
|
switch (_b.label) {
|
|
1396
1348
|
case 0:
|
|
1397
1349
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1424,10 +1376,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1424
1376
|
* Updates composite primary keys.
|
|
1425
1377
|
*/
|
|
1426
1378
|
SapQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1427
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1379
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1428
1380
|
var table, _a, parsedTableName, _b, clonedTable, columnNames, upQueries, downQueries, referencedForeignKeySql, dbForeignKeys, referencedForeignKeys, referencedForeignKeyTableMapping, primaryColumns, pkName_3, columnNamesString_1, pkName, columnNamesString;
|
|
1429
1381
|
var _this = this;
|
|
1430
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1382
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1431
1383
|
switch (_c.label) {
|
|
1432
1384
|
case 0:
|
|
1433
1385
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1513,10 +1465,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1513
1465
|
* Drops a primary key.
|
|
1514
1466
|
*/
|
|
1515
1467
|
SapQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1516
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1468
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1517
1469
|
var table, _a, parsedTableName, _b, upQueries, downQueries, referencedForeignKeySql, dbForeignKeys, referencedForeignKeys, referencedForeignKeyTableMapping;
|
|
1518
1470
|
var _this = this;
|
|
1519
|
-
return tslib_1.__generator(this, function (_c) {
|
|
1471
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1520
1472
|
switch (_c.label) {
|
|
1521
1473
|
case 0:
|
|
1522
1474
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1589,8 +1541,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1589
1541
|
* Creates a new unique constraint.
|
|
1590
1542
|
*/
|
|
1591
1543
|
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) {
|
|
1544
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1545
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1594
1546
|
throw new error_1.TypeORMError("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1595
1547
|
});
|
|
1596
1548
|
});
|
|
@@ -1599,8 +1551,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1599
1551
|
* Creates a new unique constraints.
|
|
1600
1552
|
*/
|
|
1601
1553
|
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) {
|
|
1554
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1555
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1604
1556
|
throw new error_1.TypeORMError("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1605
1557
|
});
|
|
1606
1558
|
});
|
|
@@ -1609,8 +1561,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1609
1561
|
* Drops unique constraint.
|
|
1610
1562
|
*/
|
|
1611
1563
|
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) {
|
|
1564
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1565
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1614
1566
|
throw new error_1.TypeORMError("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1615
1567
|
});
|
|
1616
1568
|
});
|
|
@@ -1619,8 +1571,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1619
1571
|
* Drops an unique constraints.
|
|
1620
1572
|
*/
|
|
1621
1573
|
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) {
|
|
1574
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1575
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1624
1576
|
throw new error_1.TypeORMError("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1625
1577
|
});
|
|
1626
1578
|
});
|
|
@@ -1629,9 +1581,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1629
1581
|
* Creates a new check constraint.
|
|
1630
1582
|
*/
|
|
1631
1583
|
SapQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1632
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1584
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1633
1585
|
var table, _a, up, down;
|
|
1634
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1586
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1635
1587
|
switch (_b.label) {
|
|
1636
1588
|
case 0:
|
|
1637
1589
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1661,10 +1613,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1661
1613
|
* Creates a new check constraints.
|
|
1662
1614
|
*/
|
|
1663
1615
|
SapQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1664
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1616
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1665
1617
|
var promises;
|
|
1666
1618
|
var _this = this;
|
|
1667
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1619
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1668
1620
|
switch (_a.label) {
|
|
1669
1621
|
case 0:
|
|
1670
1622
|
promises = checkConstraints.map(function (checkConstraint) { return _this.createCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1680,9 +1632,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1680
1632
|
* Drops check constraint.
|
|
1681
1633
|
*/
|
|
1682
1634
|
SapQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1683
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1635
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1684
1636
|
var table, _a, checkConstraint, up, down;
|
|
1685
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1637
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1686
1638
|
switch (_b.label) {
|
|
1687
1639
|
case 0:
|
|
1688
1640
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1712,10 +1664,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1712
1664
|
* Drops check constraints.
|
|
1713
1665
|
*/
|
|
1714
1666
|
SapQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1715
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1667
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1716
1668
|
var promises;
|
|
1717
1669
|
var _this = this;
|
|
1718
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1670
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1719
1671
|
switch (_a.label) {
|
|
1720
1672
|
case 0:
|
|
1721
1673
|
promises = checkConstraints.map(function (checkConstraint) { return _this.dropCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1731,8 +1683,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1731
1683
|
* Creates a new exclusion constraint.
|
|
1732
1684
|
*/
|
|
1733
1685
|
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) {
|
|
1686
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1687
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1736
1688
|
throw new error_1.TypeORMError("SAP HANA does not support exclusion constraints.");
|
|
1737
1689
|
});
|
|
1738
1690
|
});
|
|
@@ -1741,8 +1693,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1741
1693
|
* Creates a new exclusion constraints.
|
|
1742
1694
|
*/
|
|
1743
1695
|
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) {
|
|
1696
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1697
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1746
1698
|
throw new error_1.TypeORMError("SAP HANA does not support exclusion constraints.");
|
|
1747
1699
|
});
|
|
1748
1700
|
});
|
|
@@ -1751,8 +1703,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1751
1703
|
* Drops exclusion constraint.
|
|
1752
1704
|
*/
|
|
1753
1705
|
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) {
|
|
1706
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1707
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1756
1708
|
throw new error_1.TypeORMError("SAP HANA does not support exclusion constraints.");
|
|
1757
1709
|
});
|
|
1758
1710
|
});
|
|
@@ -1761,8 +1713,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1761
1713
|
* Drops exclusion constraints.
|
|
1762
1714
|
*/
|
|
1763
1715
|
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) {
|
|
1716
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1717
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1766
1718
|
throw new error_1.TypeORMError("SAP HANA does not support exclusion constraints.");
|
|
1767
1719
|
});
|
|
1768
1720
|
});
|
|
@@ -1771,9 +1723,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1771
1723
|
* Creates a new foreign key.
|
|
1772
1724
|
*/
|
|
1773
1725
|
SapQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1774
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1726
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1775
1727
|
var table, _a, up, down;
|
|
1776
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1728
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1777
1729
|
switch (_b.label) {
|
|
1778
1730
|
case 0:
|
|
1779
1731
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1803,10 +1755,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1803
1755
|
* Creates a new foreign keys.
|
|
1804
1756
|
*/
|
|
1805
1757
|
SapQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1806
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1758
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1807
1759
|
var promises;
|
|
1808
1760
|
var _this = this;
|
|
1809
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1761
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1810
1762
|
switch (_a.label) {
|
|
1811
1763
|
case 0:
|
|
1812
1764
|
promises = foreignKeys.map(function (foreignKey) { return _this.createForeignKey(tableOrName, foreignKey); });
|
|
@@ -1822,9 +1774,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1822
1774
|
* Drops a foreign key from the table.
|
|
1823
1775
|
*/
|
|
1824
1776
|
SapQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1825
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1777
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1826
1778
|
var table, _a, foreignKey, up, down;
|
|
1827
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1779
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1828
1780
|
switch (_b.label) {
|
|
1829
1781
|
case 0:
|
|
1830
1782
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1854,10 +1806,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1854
1806
|
* Drops a foreign keys from the table.
|
|
1855
1807
|
*/
|
|
1856
1808
|
SapQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1857
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1809
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1858
1810
|
var promises;
|
|
1859
1811
|
var _this = this;
|
|
1860
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1812
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1861
1813
|
switch (_a.label) {
|
|
1862
1814
|
case 0:
|
|
1863
1815
|
promises = foreignKeys.map(function (foreignKey) { return _this.dropForeignKey(tableOrName, foreignKey); });
|
|
@@ -1873,9 +1825,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1873
1825
|
* Creates a new index.
|
|
1874
1826
|
*/
|
|
1875
1827
|
SapQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
1876
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1828
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1877
1829
|
var table, _a, up, down;
|
|
1878
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1830
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1879
1831
|
switch (_b.label) {
|
|
1880
1832
|
case 0:
|
|
1881
1833
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1905,10 +1857,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1905
1857
|
* Creates a new indices
|
|
1906
1858
|
*/
|
|
1907
1859
|
SapQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
1908
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1860
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1909
1861
|
var promises;
|
|
1910
1862
|
var _this = this;
|
|
1911
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1863
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1912
1864
|
switch (_a.label) {
|
|
1913
1865
|
case 0:
|
|
1914
1866
|
promises = indices.map(function (index) { return _this.createIndex(tableOrName, index); });
|
|
@@ -1924,9 +1876,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1924
1876
|
* Drops an index.
|
|
1925
1877
|
*/
|
|
1926
1878
|
SapQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
1927
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1879
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1928
1880
|
var table, _a, index, up, down;
|
|
1929
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1881
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1930
1882
|
switch (_b.label) {
|
|
1931
1883
|
case 0:
|
|
1932
1884
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1956,10 +1908,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1956
1908
|
* Drops an indices from the table.
|
|
1957
1909
|
*/
|
|
1958
1910
|
SapQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
1959
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1911
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1960
1912
|
var promises;
|
|
1961
1913
|
var _this = this;
|
|
1962
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1914
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1963
1915
|
switch (_a.label) {
|
|
1964
1916
|
case 0:
|
|
1965
1917
|
promises = indices.map(function (index) { return _this.dropIndex(tableOrName, index); });
|
|
@@ -1976,8 +1928,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1976
1928
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
1977
1929
|
*/
|
|
1978
1930
|
SapQueryRunner.prototype.clearTable = function (tablePath) {
|
|
1979
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1980
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1931
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1932
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1981
1933
|
switch (_a.label) {
|
|
1982
1934
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tablePath))];
|
|
1983
1935
|
case 1:
|
|
@@ -1991,10 +1943,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1991
1943
|
* Removes all tables from the currently connected database.
|
|
1992
1944
|
*/
|
|
1993
1945
|
SapQueryRunner.prototype.clearDatabase = function () {
|
|
1994
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1946
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1995
1947
|
var schemas, schemaNamesString, selectTableDropsQuery, dropTableQueries, error_2, rollbackError_1;
|
|
1996
1948
|
var _this = this;
|
|
1997
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1949
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1998
1950
|
switch (_a.label) {
|
|
1999
1951
|
case 0:
|
|
2000
1952
|
schemas = [];
|
|
@@ -2048,10 +2000,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2048
2000
|
// Protected Methods
|
|
2049
2001
|
// -------------------------------------------------------------------------
|
|
2050
2002
|
SapQueryRunner.prototype.loadViews = function (viewNames) {
|
|
2051
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2003
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2052
2004
|
var hasTable, currentDatabase, currentSchema, viewsCondition, query, dbViews;
|
|
2053
2005
|
var _this = this;
|
|
2054
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2006
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2055
2007
|
switch (_a.label) {
|
|
2056
2008
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
2057
2009
|
case 1:
|
|
@@ -2096,10 +2048,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2096
2048
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
2097
2049
|
*/
|
|
2098
2050
|
SapQueryRunner.prototype.loadTables = function (tableNames) {
|
|
2099
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2051
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2100
2052
|
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
2053
|
var _this = this;
|
|
2102
|
-
return tslib_1.__generator(this, function (_k) {
|
|
2054
|
+
return (0, tslib_1.__generator)(this, function (_k) {
|
|
2103
2055
|
switch (_k.label) {
|
|
2104
2056
|
case 0:
|
|
2105
2057
|
if (tableNames && tableNames.length === 0) {
|
|
@@ -2119,11 +2071,11 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2119
2071
|
_d = [[]];
|
|
2120
2072
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2121
2073
|
case 3:
|
|
2122
|
-
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2074
|
+
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2123
2075
|
return [3 /*break*/, 6];
|
|
2124
2076
|
case 4:
|
|
2125
2077
|
tablesCondition = tableNames.map(function (tableName) {
|
|
2126
|
-
var _a = tslib_1.__read(tableName.split("."), 2), schema = _a[0], name = _a[1];
|
|
2078
|
+
var _a = (0, tslib_1.__read)(tableName.split("."), 2), schema = _a[0], name = _a[1];
|
|
2127
2079
|
if (!name) {
|
|
2128
2080
|
name = schema;
|
|
2129
2081
|
schema = _this.driver.options.schema || currentSchema;
|
|
@@ -2136,7 +2088,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2136
2088
|
_h = [[]];
|
|
2137
2089
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
2138
2090
|
case 5:
|
|
2139
|
-
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
2091
|
+
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
2140
2092
|
_k.label = 6;
|
|
2141
2093
|
case 6:
|
|
2142
2094
|
// if tables were not found in the db, no need to proceed
|
|
@@ -2173,10 +2125,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2173
2125
|
case 7:
|
|
2174
2126
|
_j = tslib_1.__read.apply(void 0, [_k.sent(), 4]), dbColumns = _j[0], dbConstraints = _j[1], dbIndices = _j[2], dbForeignKeys = _j[3];
|
|
2175
2127
|
// 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 () {
|
|
2128
|
+
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2177
2129
|
var table, getSchemaFromKey, schema, _a, tableCheckConstraints, tableForeignKeyConstraints, tableIndexConstraints;
|
|
2178
2130
|
var _this = this;
|
|
2179
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2131
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2180
2132
|
switch (_b.label) {
|
|
2181
2133
|
case 0:
|
|
2182
2134
|
table = new Table_1.Table();
|
|
@@ -2193,10 +2145,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2193
2145
|
_a = table;
|
|
2194
2146
|
return [4 /*yield*/, Promise.all(dbColumns
|
|
2195
2147
|
.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 () {
|
|
2148
|
+
.map(function (dbColumn) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
2197
2149
|
var columnConstraints, columnUniqueIndex, tableMetadata, hasIgnoredIndex, isConstraintComposite, tableColumn, length;
|
|
2198
2150
|
var _this = this;
|
|
2199
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2151
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2200
2152
|
columnConstraints = dbConstraints.filter(function (dbConstraint) { return (dbConstraint["TABLE_NAME"] === dbColumn["TABLE_NAME"] &&
|
|
2201
2153
|
dbConstraint["SCHEMA_NAME"] === dbColumn["SCHEMA_NAME"] &&
|
|
2202
2154
|
dbConstraint["COLUMN_NAME"] === dbColumn["COLUMN_NAME"]); });
|
|
@@ -2421,9 +2373,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2421
2373
|
}
|
|
2422
2374
|
};
|
|
2423
2375
|
SapQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2424
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2376
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2425
2377
|
var _a, schema, name, expression, _b, query, parameters;
|
|
2426
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2378
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2427
2379
|
switch (_c.label) {
|
|
2428
2380
|
case 0:
|
|
2429
2381
|
_a = this.driver.parseTableName(view), schema = _a.schema, name = _a.tableName;
|
|
@@ -2434,7 +2386,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2434
2386
|
_c.label = 2;
|
|
2435
2387
|
case 2:
|
|
2436
2388
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2437
|
-
_b = tslib_1.__read(this.connection.createQueryBuilder()
|
|
2389
|
+
_b = (0, tslib_1.__read)(this.connection.createQueryBuilder()
|
|
2438
2390
|
.insert()
|
|
2439
2391
|
.into(this.getTypeormMetadataTableName())
|
|
2440
2392
|
.values({ type: "VIEW", schema: schema, name: name, value: expression })
|
|
@@ -2454,9 +2406,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2454
2406
|
* Builds remove view sql.
|
|
2455
2407
|
*/
|
|
2456
2408
|
SapQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
|
|
2457
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2409
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2458
2410
|
var _a, schema, name, qb, _b, query, parameters;
|
|
2459
|
-
return tslib_1.__generator(this, function (_c) {
|
|
2411
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
2460
2412
|
switch (_c.label) {
|
|
2461
2413
|
case 0:
|
|
2462
2414
|
_a = this.driver.parseTableName(viewOrPath), schema = _a.schema, name = _a.tableName;
|
|
@@ -2467,7 +2419,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2467
2419
|
_c.label = 2;
|
|
2468
2420
|
case 2:
|
|
2469
2421
|
qb = this.connection.createQueryBuilder();
|
|
2470
|
-
_b = tslib_1.__read(qb.delete()
|
|
2422
|
+
_b = (0, tslib_1.__read)(qb.delete()
|
|
2471
2423
|
.from(this.getTypeormMetadataTableName())
|
|
2472
2424
|
.where(qb.escape("type") + " = 'VIEW'")
|
|
2473
2425
|
.andWhere(qb.escape("schema") + " = :schema", { schema: schema })
|