typeorm 0.2.38-dev.d8f6037 → 0.2.39-dev.179ae75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -59
- package/browser/connection/ConnectionMetadataBuilder.js +4 -4
- package/browser/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/browser/connection/ConnectionOptionsReader.js +2 -1
- package/browser/connection/ConnectionOptionsReader.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/browser/decorator/transaction/Transaction.js +3 -3
- package/browser/decorator/transaction/Transaction.js.map +1 -1
- package/browser/driver/DriverUtils.js +1 -1
- package/browser/driver/DriverUtils.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +5 -0
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js +6 -5
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +19 -48
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +5 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +2 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +17 -46
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +5 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js +4 -3
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachConnectionOptions.d.ts +10 -0
- package/browser/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachDriver.js +5 -4
- package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +46 -77
- package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/browser/driver/cordova/CordovaConnectionOptions.d.ts +5 -0
- package/browser/driver/cordova/CordovaConnectionOptions.js.map +1 -1
- package/browser/driver/cordova/CordovaDriver.js +2 -1
- package/browser/driver/cordova/CordovaDriver.js.map +1 -1
- package/browser/driver/expo/ExpoQueryRunner.js +12 -43
- package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/MongoConnectionOptions.d.ts +5 -0
- package/browser/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/browser/driver/mongodb/MongoDriver.js +2 -1
- package/browser/driver/mongodb/MongoDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlConnectionOptions.d.ts +6 -0
- package/browser/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/browser/driver/mysql/MysqlDriver.js +4 -2
- package/browser/driver/mysql/MysqlDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.js +24 -54
- package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/browser/driver/nativescript/NativescriptQueryRunner.js +45 -37
- package/browser/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/browser/driver/oracle/OracleConnectionOptions.d.ts +5 -0
- package/browser/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/browser/driver/oracle/OracleDriver.js +5 -4
- package/browser/driver/oracle/OracleDriver.js.map +1 -1
- package/browser/driver/oracle/OracleQueryRunner.js +20 -48
- package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.d.ts +10 -0
- package/browser/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresDriver.js +6 -5
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +21 -51
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/react-native/ReactNativeConnectionOptions.d.ts +5 -0
- package/browser/driver/react-native/ReactNativeConnectionOptions.js.map +1 -1
- package/browser/driver/react-native/ReactNativeDriver.js +2 -1
- package/browser/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/browser/driver/sap/SapConnectionOptions.d.ts +16 -6
- package/browser/driver/sap/SapConnectionOptions.js.map +1 -1
- package/browser/driver/sap/SapDriver.js +6 -3
- package/browser/driver/sap/SapDriver.js.map +1 -1
- package/browser/driver/sap/SapQueryRunner.js +20 -50
- package/browser/driver/sap/SapQueryRunner.js.map +1 -1
- package/browser/driver/sqlite/SqliteConnectionOptions.d.ts +5 -0
- package/browser/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/browser/driver/sqlite/SqliteDriver.js +4 -3
- package/browser/driver/sqlite/SqliteDriver.js.map +1 -1
- package/browser/driver/sqlite/SqliteQueryRunner.js +16 -8
- package/browser/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +19 -49
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqljs/SqljsConnectionOptions.d.ts +5 -0
- package/browser/driver/sqljs/SqljsConnectionOptions.js.map +1 -1
- package/browser/driver/sqljs/SqljsDriver.js +4 -2
- package/browser/driver/sqljs/SqljsDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/browser/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerDriver.js +7 -6
- package/browser/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.js +84 -116
- package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/browser/entity-manager/MongoEntityManager.js +8 -13
- package/browser/entity-manager/MongoEntityManager.js.map +1 -1
- package/browser/find-options/FindOptionsUtils.js +1 -1
- package/browser/find-options/FindOptionsUtils.js.map +1 -1
- package/browser/metadata/ColumnMetadata.js +4 -4
- package/browser/metadata/ColumnMetadata.js.map +1 -1
- package/browser/metadata/EmbeddedMetadata.js +1 -1
- package/browser/metadata/EmbeddedMetadata.js.map +1 -1
- package/browser/metadata/EntityMetadata.js +1 -1
- package/browser/metadata/EntityMetadata.js.map +1 -1
- package/browser/metadata/RelationMetadata.js +4 -4
- package/browser/metadata/RelationMetadata.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/browser/naming-strategy/DefaultNamingStrategy.js +5 -5
- package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/browser/persistence/Subject.js +1 -1
- package/browser/persistence/Subject.js.map +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/browser/persistence/SubjectExecutor.js +1 -1
- package/browser/persistence/SubjectExecutor.js.map +1 -1
- package/browser/persistence/SubjectTopoligicalSorter.js +5 -5
- package/browser/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/browser/persistence/tree/ClosureSubjectExecutor.js +4 -4
- package/browser/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
- package/browser/query-builder/DeleteQueryBuilder.js +3 -10
- package/browser/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/InsertQueryBuilder.js +4 -6
- package/browser/query-builder/InsertQueryBuilder.js.map +1 -1
- package/browser/query-builder/QueryBuilder.js +9 -9
- package/browser/query-builder/QueryBuilder.js.map +1 -1
- package/browser/query-builder/RelationLoader.js +2 -2
- package/browser/query-builder/RelationLoader.js.map +1 -1
- package/browser/query-builder/RelationRemover.js +6 -6
- package/browser/query-builder/RelationRemover.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.js +14 -14
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-builder/SoftDeleteQueryBuilder.js +3 -10
- package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/UpdateQueryBuilder.js +5 -12
- package/browser/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/browser/query-builder/relation-id/RelationIdLoader.js +1 -1
- package/browser/query-builder/relation-id/RelationIdLoader.js.map +1 -1
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js +2 -2
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.js +2 -2
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/query-runner/QueryLock.js +1 -1
- package/browser/query-runner/QueryLock.js.map +1 -1
- package/browser/repository/BaseEntity.js +1 -1
- package/browser/repository/BaseEntity.js.map +1 -1
- package/browser/repository/Repository.js +1 -1
- package/browser/repository/Repository.js.map +1 -1
- package/browser/repository/TreeRepository.js +2 -2
- package/browser/repository/TreeRepository.js.map +1 -1
- package/browser/schema-builder/table/TableCheck.js +1 -1
- package/browser/schema-builder/table/TableCheck.js.map +1 -1
- package/browser/schema-builder/table/TableForeignKey.js +2 -2
- package/browser/schema-builder/table/TableForeignKey.js.map +1 -1
- package/browser/schema-builder/table/TableIndex.js +1 -1
- package/browser/schema-builder/table/TableIndex.js.map +1 -1
- package/browser/schema-builder/table/TableUnique.js +1 -1
- package/browser/schema-builder/table/TableUnique.js.map +1 -1
- package/browser/subscriber/Broadcaster.d.ts +23 -2
- package/browser/subscriber/Broadcaster.js +35 -2
- package/browser/subscriber/Broadcaster.js.map +1 -1
- package/browser/subscriber/BroadcasterResult.d.ts +4 -0
- package/browser/subscriber/BroadcasterResult.js +19 -0
- package/browser/subscriber/BroadcasterResult.js.map +1 -1
- package/cache/DbQueryResultCache.js +12 -12
- package/cache/RedisQueryResultCache.js +12 -12
- package/cli.js +1 -6
- package/cli.js.map +1 -1
- package/commands/CacheClearCommand.js +4 -4
- package/commands/CacheClearCommand.js.map +1 -1
- package/commands/CommandUtils.js +10 -10
- package/commands/CommandUtils.js.map +1 -1
- package/commands/EntityCreateCommand.js +3 -3
- package/commands/EntityCreateCommand.js.map +1 -1
- package/commands/InitCommand.js +5 -5
- package/commands/InitCommand.js.map +1 -1
- package/commands/MigrationCreateCommand.js +5 -5
- package/commands/MigrationCreateCommand.js.map +1 -1
- package/commands/MigrationGenerateCommand.js +7 -7
- package/commands/MigrationGenerateCommand.js.map +1 -1
- package/commands/MigrationRevertCommand.js +4 -4
- package/commands/MigrationRevertCommand.js.map +1 -1
- package/commands/MigrationRunCommand.js +5 -5
- package/commands/MigrationRunCommand.js.map +1 -1
- package/commands/MigrationShowCommand.js +5 -5
- package/commands/MigrationShowCommand.js.map +1 -1
- package/commands/QueryCommand.js +4 -4
- package/commands/QueryCommand.js.map +1 -1
- package/commands/SchemaDropCommand.js +4 -4
- package/commands/SchemaDropCommand.js.map +1 -1
- package/commands/SchemaLogCommand.js +5 -5
- package/commands/SchemaLogCommand.js.map +1 -1
- package/commands/SchemaSyncCommand.js +4 -4
- package/commands/SchemaSyncCommand.js.map +1 -1
- package/commands/SubscriberCreateCommand.js +3 -3
- package/commands/SubscriberCreateCommand.js.map +1 -1
- package/commands/VersionCommand.js +3 -3
- package/commands/VersionCommand.js.map +1 -1
- package/connection/Connection.js +19 -19
- package/connection/Connection.js.map +1 -1
- package/connection/ConnectionMetadataBuilder.js +11 -11
- package/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/connection/ConnectionOptionsReader.js +11 -10
- package/connection/ConnectionOptionsReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsEnvReader.js +2 -2
- package/connection/options-reader/ConnectionOptionsXmlReader.js +3 -3
- package/connection/options-reader/ConnectionOptionsXmlReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsYmlReader.js +4 -4
- package/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/decorator/Check.js +1 -1
- package/decorator/Check.js.map +1 -1
- package/decorator/EntityRepository.js +1 -1
- package/decorator/EntityRepository.js.map +1 -1
- package/decorator/Exclusion.js +1 -1
- package/decorator/Exclusion.js.map +1 -1
- package/decorator/Generated.js +1 -1
- package/decorator/Generated.js.map +1 -1
- package/decorator/Index.js +1 -1
- package/decorator/Index.js.map +1 -1
- package/decorator/Unique.js +1 -1
- package/decorator/Unique.js.map +1 -1
- package/decorator/columns/Column.js +4 -4
- package/decorator/columns/Column.js.map +1 -1
- package/decorator/columns/CreateDateColumn.js +1 -1
- package/decorator/columns/CreateDateColumn.js.map +1 -1
- package/decorator/columns/DeleteDateColumn.js +1 -1
- package/decorator/columns/DeleteDateColumn.js.map +1 -1
- package/decorator/columns/ObjectIdColumn.js +1 -1
- package/decorator/columns/ObjectIdColumn.js.map +1 -1
- package/decorator/columns/PrimaryColumn.js +2 -2
- package/decorator/columns/PrimaryColumn.js.map +1 -1
- package/decorator/columns/PrimaryGeneratedColumn.js +2 -2
- package/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/decorator/columns/UpdateDateColumn.js +1 -1
- package/decorator/columns/UpdateDateColumn.js.map +1 -1
- package/decorator/columns/VersionColumn.js +1 -1
- package/decorator/columns/VersionColumn.js.map +1 -1
- package/decorator/columns/ViewColumn.js +1 -1
- package/decorator/columns/ViewColumn.js.map +1 -1
- package/decorator/entity/ChildEntity.js +2 -2
- package/decorator/entity/ChildEntity.js.map +1 -1
- package/decorator/entity/Entity.js +1 -1
- package/decorator/entity/Entity.js.map +1 -1
- package/decorator/entity/TableInheritance.js +1 -1
- package/decorator/entity/TableInheritance.js.map +1 -1
- package/decorator/entity-view/ViewEntity.js +1 -1
- package/decorator/entity-view/ViewEntity.js.map +1 -1
- package/decorator/listeners/AfterInsert.js +1 -1
- package/decorator/listeners/AfterInsert.js.map +1 -1
- package/decorator/listeners/AfterLoad.js +1 -1
- package/decorator/listeners/AfterLoad.js.map +1 -1
- package/decorator/listeners/AfterRemove.js +1 -1
- package/decorator/listeners/AfterRemove.js.map +1 -1
- package/decorator/listeners/AfterUpdate.js +1 -1
- package/decorator/listeners/AfterUpdate.js.map +1 -1
- package/decorator/listeners/BeforeInsert.js +1 -1
- package/decorator/listeners/BeforeInsert.js.map +1 -1
- package/decorator/listeners/BeforeRemove.js +1 -1
- package/decorator/listeners/BeforeRemove.js.map +1 -1
- package/decorator/listeners/BeforeUpdate.js +1 -1
- package/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/decorator/listeners/EventSubscriber.js +1 -1
- package/decorator/listeners/EventSubscriber.js.map +1 -1
- package/decorator/relations/JoinColumn.js +1 -1
- package/decorator/relations/JoinColumn.js.map +1 -1
- package/decorator/relations/JoinTable.js +1 -1
- package/decorator/relations/JoinTable.js.map +1 -1
- package/decorator/relations/ManyToMany.js +1 -1
- package/decorator/relations/ManyToMany.js.map +1 -1
- package/decorator/relations/ManyToOne.js +1 -1
- package/decorator/relations/ManyToOne.js.map +1 -1
- package/decorator/relations/OneToMany.js +1 -1
- package/decorator/relations/OneToMany.js.map +1 -1
- package/decorator/relations/OneToOne.js +1 -1
- package/decorator/relations/OneToOne.js.map +1 -1
- package/decorator/relations/RelationCount.js +1 -1
- package/decorator/relations/RelationCount.js.map +1 -1
- package/decorator/relations/RelationId.js +1 -1
- package/decorator/relations/RelationId.js.map +1 -1
- package/decorator/transaction/Transaction.js +7 -7
- package/decorator/transaction/Transaction.js.map +1 -1
- package/decorator/transaction/TransactionManager.js +1 -1
- package/decorator/transaction/TransactionManager.js.map +1 -1
- package/decorator/transaction/TransactionRepository.js +1 -1
- package/decorator/transaction/TransactionRepository.js.map +1 -1
- package/decorator/tree/Tree.js +1 -1
- package/decorator/tree/Tree.js.map +1 -1
- package/decorator/tree/TreeChildren.js +1 -1
- package/decorator/tree/TreeChildren.js.map +1 -1
- package/decorator/tree/TreeLevelColumn.js +1 -1
- package/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/decorator/tree/TreeParent.js +1 -1
- package/decorator/tree/TreeParent.js.map +1 -1
- package/driver/DriverUtils.js +9 -9
- package/driver/DriverUtils.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +5 -0
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiDriver.js +12 -11
- package/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +146 -175
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +5 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +10 -9
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +29 -58
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +5 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3Driver.js +12 -11
- package/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +5 -5
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/driver/capacitor/CapacitorDriver.js +7 -7
- package/driver/capacitor/CapacitorDriver.js.map +1 -1
- package/driver/capacitor/CapacitorQueryRunner.js +5 -5
- package/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
- package/driver/cockroachdb/CockroachConnectionOptions.d.ts +10 -0
- package/driver/cockroachdb/CockroachConnectionOptions.js.map +1 -1
- package/driver/cockroachdb/CockroachDriver.js +15 -14
- package/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +180 -211
- package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/driver/cordova/CordovaConnectionOptions.d.ts +5 -0
- package/driver/cordova/CordovaConnectionOptions.js.map +1 -1
- package/driver/cordova/CordovaDriver.js +5 -4
- package/driver/cordova/CordovaDriver.js.map +1 -1
- package/driver/cordova/CordovaQueryRunner.js +13 -13
- package/driver/cordova/CordovaQueryRunner.js.map +1 -1
- package/driver/expo/ExpoDriver.js +3 -3
- package/driver/expo/ExpoDriver.js.map +1 -1
- package/driver/expo/ExpoQueryRunner.js +23 -54
- package/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/driver/mongodb/MongoConnectionOptions.d.ts +5 -0
- package/driver/mongodb/MongoConnectionOptions.js.map +1 -1
- package/driver/mongodb/MongoDriver.js +4 -3
- package/driver/mongodb/MongoDriver.js.map +1 -1
- package/driver/mongodb/MongoQueryRunner.js +178 -178
- package/driver/mysql/MysqlConnectionOptions.d.ts +6 -0
- package/driver/mysql/MysqlConnectionOptions.js.map +1 -1
- package/driver/mysql/MysqlDriver.js +9 -7
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.js +152 -182
- package/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/driver/nativescript/NativescriptDriver.js +3 -3
- package/driver/nativescript/NativescriptDriver.js.map +1 -1
- package/driver/nativescript/NativescriptQueryRunner.js +48 -40
- package/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/driver/oracle/OracleConnectionOptions.d.ts +5 -0
- package/driver/oracle/OracleConnectionOptions.js.map +1 -1
- package/driver/oracle/OracleDriver.js +13 -12
- package/driver/oracle/OracleDriver.js.map +1 -1
- package/driver/oracle/OracleQueryRunner.js +143 -171
- package/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/driver/postgres/PostgresConnectionOptions.d.ts +10 -0
- package/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/driver/postgres/PostgresDriver.js +24 -23
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.js +169 -199
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/react-native/ReactNativeConnectionOptions.d.ts +5 -0
- package/driver/react-native/ReactNativeConnectionOptions.js.map +1 -1
- package/driver/react-native/ReactNativeDriver.js +5 -4
- package/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/driver/react-native/ReactNativeQueryRunner.js +3 -3
- package/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
- package/driver/sap/SapConnectionOptions.d.ts +16 -6
- package/driver/sap/SapConnectionOptions.js.map +1 -1
- package/driver/sap/SapDriver.js +11 -8
- package/driver/sap/SapDriver.js.map +1 -1
- package/driver/sap/SapQueryRunner.js +153 -183
- package/driver/sap/SapQueryRunner.js.map +1 -1
- package/driver/sqlite/SqliteConnectionOptions.d.ts +5 -0
- package/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/driver/sqlite/SqliteDriver.js +12 -11
- package/driver/sqlite/SqliteDriver.js.map +1 -1
- package/driver/sqlite/SqliteQueryRunner.js +21 -13
- package/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteDriver.js +4 -4
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +138 -168
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqljs/SqljsConnectionOptions.d.ts +5 -0
- package/driver/sqljs/SqljsConnectionOptions.js.map +1 -1
- package/driver/sqljs/SqljsDriver.js +17 -15
- package/driver/sqljs/SqljsDriver.js.map +1 -1
- package/driver/sqljs/SqljsQueryRunner.js +9 -9
- package/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
- package/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
- package/driver/sqlserver/SqlServerDriver.js +13 -12
- package/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/driver/sqlserver/SqlServerQueryRunner.js +220 -252
- package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/entity-manager/EntityManager.js +30 -30
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-manager/MongoEntityManager.js +23 -28
- package/entity-manager/MongoEntityManager.js.map +1 -1
- package/entity-manager/SqljsEntityManager.js +5 -5
- package/entity-manager/SqljsEntityManager.js.map +1 -1
- package/entity-schema/EntitySchemaTransformer.js +1 -1
- package/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/error/AlreadyHasActiveConnectionError.js +1 -1
- package/error/AlreadyHasActiveConnectionError.js.map +1 -1
- package/error/CannotAttachTreeChildrenEntityError.js +1 -1
- package/error/CannotAttachTreeChildrenEntityError.js.map +1 -1
- package/error/CannotConnectAlreadyConnectedError.js +1 -1
- package/error/CannotConnectAlreadyConnectedError.js.map +1 -1
- package/error/CannotCreateEntityIdMapError.js +1 -1
- package/error/CannotCreateEntityIdMapError.js.map +1 -1
- package/error/CannotDetermineEntityError.js +1 -1
- package/error/CannotDetermineEntityError.js.map +1 -1
- package/error/CannotExecuteNotConnectedError.js +1 -1
- package/error/CannotExecuteNotConnectedError.js.map +1 -1
- package/error/CannotGetEntityManagerNotConnectedError.js +1 -1
- package/error/CannotGetEntityManagerNotConnectedError.js.map +1 -1
- package/error/CannotReflectMethodParameterTypeError.js +1 -1
- package/error/CannotReflectMethodParameterTypeError.js.map +1 -1
- package/error/CircularRelationsError.js +1 -1
- package/error/CircularRelationsError.js.map +1 -1
- package/error/ColumnTypeUndefinedError.js +1 -1
- package/error/ColumnTypeUndefinedError.js.map +1 -1
- package/error/ConnectionIsNotSetError.js +1 -1
- package/error/ConnectionIsNotSetError.js.map +1 -1
- package/error/ConnectionNotFoundError.js +1 -1
- package/error/ConnectionNotFoundError.js.map +1 -1
- package/error/CustomRepositoryCannotInheritRepositoryError.js +1 -1
- package/error/CustomRepositoryCannotInheritRepositoryError.js.map +1 -1
- package/error/CustomRepositoryDoesNotHaveEntityError.js +1 -1
- package/error/CustomRepositoryDoesNotHaveEntityError.js.map +1 -1
- package/error/CustomRepositoryNotFoundError.js +1 -1
- package/error/CustomRepositoryNotFoundError.js.map +1 -1
- package/error/DataTypeNotSupportedError.js +1 -1
- package/error/DataTypeNotSupportedError.js.map +1 -1
- package/error/DriverOptionNotSetError.js +1 -1
- package/error/DriverOptionNotSetError.js.map +1 -1
- package/error/DriverPackageNotInstalledError.js +1 -1
- package/error/DriverPackageNotInstalledError.js.map +1 -1
- package/error/EntityColumnNotFound.js +1 -1
- package/error/EntityColumnNotFound.js.map +1 -1
- package/error/EntityMetadataNotFoundError.js +1 -1
- package/error/EntityMetadataNotFoundError.js.map +1 -1
- package/error/EntityNotFoundError.js +1 -1
- package/error/EntityNotFoundError.js.map +1 -1
- package/error/FindRelationsNotFoundError.js +1 -1
- package/error/FindRelationsNotFoundError.js.map +1 -1
- package/error/InitializedRelationError.js +1 -1
- package/error/InitializedRelationError.js.map +1 -1
- package/error/InsertValuesMissingError.js +1 -1
- package/error/InsertValuesMissingError.js.map +1 -1
- package/error/LimitOnUpdateNotSupportedError.js +1 -1
- package/error/LimitOnUpdateNotSupportedError.js.map +1 -1
- package/error/LockNotSupportedOnGivenDriverError.js +1 -1
- package/error/LockNotSupportedOnGivenDriverError.js.map +1 -1
- package/error/MetadataAlreadyExistsError.js +1 -1
- package/error/MetadataAlreadyExistsError.js.map +1 -1
- package/error/MetadataWithSuchNameAlreadyExistsError.js +1 -1
- package/error/MetadataWithSuchNameAlreadyExistsError.js.map +1 -1
- package/error/MissingDeleteDateColumnError.js +1 -1
- package/error/MissingDeleteDateColumnError.js.map +1 -1
- package/error/MissingDriverError.js +1 -1
- package/error/MissingDriverError.js.map +1 -1
- package/error/MissingJoinColumnError.js +1 -1
- package/error/MissingJoinColumnError.js.map +1 -1
- package/error/MissingJoinTableError.js +1 -1
- package/error/MissingJoinTableError.js.map +1 -1
- package/error/MissingPrimaryColumnError.js +1 -1
- package/error/MissingPrimaryColumnError.js.map +1 -1
- package/error/MustBeEntityError.js +1 -1
- package/error/MustBeEntityError.js.map +1 -1
- package/error/NamingStrategyNotFoundError.js +1 -1
- package/error/NamingStrategyNotFoundError.js.map +1 -1
- package/error/NestedSetMultipleRootError.js +1 -1
- package/error/NestedSetMultipleRootError.js.map +1 -1
- package/error/NoConnectionForRepositoryError.js +1 -1
- package/error/NoConnectionForRepositoryError.js.map +1 -1
- package/error/NoConnectionOptionError.js +1 -1
- package/error/NoConnectionOptionError.js.map +1 -1
- package/error/NoNeedToReleaseEntityManagerError.js +1 -1
- package/error/NoNeedToReleaseEntityManagerError.js.map +1 -1
- package/error/NoVersionOrUpdateDateColumnError.js +1 -1
- package/error/NoVersionOrUpdateDateColumnError.js.map +1 -1
- package/error/OffsetWithoutLimitNotSupportedError.js +1 -1
- package/error/OffsetWithoutLimitNotSupportedError.js.map +1 -1
- package/error/OptimisticLockCanNotBeUsedError.js +1 -1
- package/error/OptimisticLockCanNotBeUsedError.js.map +1 -1
- package/error/OptimisticLockVersionMismatchError.js +1 -1
- package/error/OptimisticLockVersionMismatchError.js.map +1 -1
- package/error/PersistedEntityNotFoundError.js +1 -1
- package/error/PersistedEntityNotFoundError.js.map +1 -1
- package/error/PessimisticLockTransactionRequiredError.js +1 -1
- package/error/PessimisticLockTransactionRequiredError.js.map +1 -1
- package/error/PrimaryColumnCannotBeNullableError.js +1 -1
- package/error/PrimaryColumnCannotBeNullableError.js.map +1 -1
- package/error/QueryFailedError.js +3 -3
- package/error/QueryFailedError.js.map +1 -1
- package/error/QueryRunnerAlreadyReleasedError.js +1 -1
- package/error/QueryRunnerAlreadyReleasedError.js.map +1 -1
- package/error/QueryRunnerProviderAlreadyReleasedError.js +1 -1
- package/error/QueryRunnerProviderAlreadyReleasedError.js.map +1 -1
- package/error/RepositoryNotFoundError.js +1 -1
- package/error/RepositoryNotFoundError.js.map +1 -1
- package/error/RepositoryNotTreeError.js +1 -1
- package/error/RepositoryNotTreeError.js.map +1 -1
- package/error/ReturningStatementNotSupportedError.js +1 -1
- package/error/ReturningStatementNotSupportedError.js.map +1 -1
- package/error/SubjectRemovedAndUpdatedError.js +1 -1
- package/error/SubjectRemovedAndUpdatedError.js.map +1 -1
- package/error/SubjectWithoutIdentifierError.js +1 -1
- package/error/SubjectWithoutIdentifierError.js.map +1 -1
- package/error/TransactionAlreadyStartedError.js +1 -1
- package/error/TransactionAlreadyStartedError.js.map +1 -1
- package/error/TransactionNotStartedError.js +1 -1
- package/error/TransactionNotStartedError.js.map +1 -1
- package/error/TreeRepositoryNotSupportedError.js +1 -1
- package/error/TreeRepositoryNotSupportedError.js.map +1 -1
- package/error/TypeORMError.js +1 -1
- package/error/TypeORMError.js.map +1 -1
- package/error/UpdateValuesMissingError.js +1 -1
- package/error/UpdateValuesMissingError.js.map +1 -1
- package/error/UsingJoinColumnIsNotAllowedError.js +1 -1
- package/error/UsingJoinColumnIsNotAllowedError.js.map +1 -1
- package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +1 -1
- package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js.map +1 -1
- package/error/UsingJoinTableIsNotAllowedError.js +1 -1
- package/error/UsingJoinTableIsNotAllowedError.js.map +1 -1
- package/error/UsingJoinTableOnlyOnOneSideAllowedError.js +1 -1
- package/error/UsingJoinTableOnlyOnOneSideAllowedError.js.map +1 -1
- package/error/index.js +62 -62
- package/error/index.js.map +1 -1
- package/find-options/FindOptionsUtils.js +4 -4
- package/find-options/FindOptionsUtils.js.map +1 -1
- package/globals.js +7 -7
- package/globals.js.map +1 -1
- package/index.js +102 -102
- package/index.js.map +1 -1
- package/logger/DebugLogger.js +9 -9
- package/logger/DebugLogger.js.map +1 -1
- package/logger/FileLogger.js +1 -1
- package/logger/FileLogger.js.map +1 -1
- package/metadata/ColumnMetadata.js +4 -4
- package/metadata/ColumnMetadata.js.map +1 -1
- package/metadata/EmbeddedMetadata.js +1 -1
- package/metadata/EmbeddedMetadata.js.map +1 -1
- package/metadata/EntityMetadata.js +2 -2
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/RelationMetadata.js +4 -4
- package/metadata/RelationMetadata.js.map +1 -1
- package/metadata-builder/EntityMetadataBuilder.js +5 -5
- package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/migration/MigrationExecutor.js +33 -33
- package/migration/MigrationExecutor.js.map +1 -1
- package/naming-strategy/DefaultNamingStrategy.js +10 -10
- package/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/package.json +1 -1
- package/persistence/EntityPersistExecutor.js +5 -5
- package/persistence/EntityPersistExecutor.js.map +1 -1
- package/persistence/Subject.js +1 -1
- package/persistence/Subject.js.map +1 -1
- package/persistence/SubjectDatabaseEntityLoader.js +6 -6
- package/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/persistence/SubjectExecutor.js +31 -31
- package/persistence/SubjectExecutor.js.map +1 -1
- package/persistence/SubjectTopoligicalSorter.js +5 -5
- package/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/persistence/subject-builder/CascadesSubjectBuilder.js +1 -1
- package/persistence/subject-builder/CascadesSubjectBuilder.js.map +1 -1
- package/persistence/tree/ClosureSubjectExecutor.js +13 -13
- package/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
- package/persistence/tree/MaterializedPathSubjectExecutor.js +5 -5
- package/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/persistence/tree/NestedSetSubjectExecutor.js +14 -14
- package/persistence/tree/NestedSetSubjectExecutor.js.map +1 -1
- package/platform/PlatformTools.js +8 -8
- package/platform/PlatformTools.js.map +1 -1
- package/query-builder/DeleteQueryBuilder.js +7 -14
- package/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/query-builder/InsertQueryBuilder.js +9 -11
- package/query-builder/InsertQueryBuilder.js.map +1 -1
- package/query-builder/JoinAttribute.js +1 -1
- package/query-builder/JoinAttribute.js.map +1 -1
- package/query-builder/QueryBuilder.js +37 -37
- package/query-builder/QueryBuilder.js.map +1 -1
- package/query-builder/QueryBuilderUtils.js +1 -1
- package/query-builder/QueryBuilderUtils.js.map +1 -1
- package/query-builder/QueryExpressionMap.js +3 -3
- package/query-builder/QueryExpressionMap.js.map +1 -1
- package/query-builder/RelationLoader.js +2 -2
- package/query-builder/RelationLoader.js.map +1 -1
- package/query-builder/RelationQueryBuilder.js +13 -13
- package/query-builder/RelationQueryBuilder.js.map +1 -1
- package/query-builder/RelationRemover.js +12 -12
- package/query-builder/RelationRemover.js.map +1 -1
- package/query-builder/RelationUpdater.js +2 -2
- package/query-builder/ReturningResultsEntityUpdator.js +6 -6
- package/query-builder/SelectQueryBuilder.js +43 -43
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-builder/SoftDeleteQueryBuilder.js +7 -14
- package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/query-builder/UpdateQueryBuilder.js +10 -17
- package/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/query-builder/relation-count/RelationCountAttribute.js +2 -2
- package/query-builder/relation-count/RelationCountAttribute.js.map +1 -1
- package/query-builder/relation-count/RelationCountLoader.js +4 -4
- package/query-builder/relation-id/RelationIdAttribute.js +1 -1
- package/query-builder/relation-id/RelationIdAttribute.js.map +1 -1
- package/query-builder/relation-id/RelationIdLoader.js +5 -5
- package/query-builder/relation-id/RelationIdLoader.js.map +1 -1
- package/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +3 -3
- package/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js.map +1 -1
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js +2 -2
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/query-runner/BaseQueryRunner.js +25 -25
- package/query-runner/BaseQueryRunner.js.map +1 -1
- package/query-runner/QueryLock.js +3 -3
- package/query-runner/QueryLock.js.map +1 -1
- package/repository/AbstractRepository.js +1 -1
- package/repository/AbstractRepository.js.map +1 -1
- package/repository/BaseEntity.js +4 -4
- package/repository/BaseEntity.js.map +1 -1
- package/repository/MongoRepository.js +1 -1
- package/repository/MongoRepository.js.map +1 -1
- package/repository/Repository.js +1 -1
- package/repository/Repository.js.map +1 -1
- package/repository/TreeRepository.js +7 -7
- package/repository/TreeRepository.js.map +1 -1
- package/schema-builder/MongoSchemaBuilder.js +2 -2
- package/schema-builder/RdbmsSchemaBuilder.js +95 -95
- package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/schema-builder/table/Table.js +1 -1
- package/schema-builder/table/Table.js.map +1 -1
- package/schema-builder/table/TableCheck.js +1 -1
- package/schema-builder/table/TableCheck.js.map +1 -1
- package/schema-builder/table/TableForeignKey.js +2 -2
- package/schema-builder/table/TableForeignKey.js.map +1 -1
- package/schema-builder/table/TableIndex.js +1 -1
- package/schema-builder/table/TableIndex.js.map +1 -1
- package/schema-builder/table/TableUnique.js +1 -1
- package/schema-builder/table/TableUnique.js.map +1 -1
- package/subscriber/Broadcaster.d.ts +23 -2
- package/subscriber/Broadcaster.js +35 -2
- package/subscriber/Broadcaster.js.map +1 -1
- package/subscriber/BroadcasterResult.d.ts +4 -0
- package/subscriber/BroadcasterResult.js +19 -0
- package/subscriber/BroadcasterResult.js.map +1 -1
- package/util/DateUtils.js +1 -1
- package/util/DateUtils.js.map +1 -1
- package/util/DirectoryExportedClassesLoader.js +1 -1
- package/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/util/ObjectUtils.js +2 -2
- package/util/ObjectUtils.js.map +1 -1
- package/util/OrmUtils.js +2 -2
- package/util/OrmUtils.js.map +1 -1
- package/util/StringUtils.js +2 -2
- package/util/StringUtils.js.map +1 -1
|
@@ -16,13 +16,12 @@ var OrmUtils_1 = require("../../util/OrmUtils");
|
|
|
16
16
|
var TableUnique_1 = require("../../schema-builder/table/TableUnique");
|
|
17
17
|
var BaseQueryRunner_1 = require("../../query-runner/BaseQueryRunner");
|
|
18
18
|
var Broadcaster_1 = require("../../subscriber/Broadcaster");
|
|
19
|
-
var BroadcasterResult_1 = require("../../subscriber/BroadcasterResult");
|
|
20
19
|
var error_1 = require("../../error");
|
|
21
20
|
/**
|
|
22
21
|
* Runs queries on a single mysql database connection.
|
|
23
22
|
*/
|
|
24
23
|
var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
25
|
-
tslib_1.__extends(AuroraDataApiQueryRunner, _super);
|
|
24
|
+
(0, tslib_1.__extends)(AuroraDataApiQueryRunner, _super);
|
|
26
25
|
// -------------------------------------------------------------------------
|
|
27
26
|
// Constructor
|
|
28
27
|
// -------------------------------------------------------------------------
|
|
@@ -42,8 +41,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
42
41
|
* Returns obtained database connection.
|
|
43
42
|
*/
|
|
44
43
|
AuroraDataApiQueryRunner.prototype.connect = function () {
|
|
45
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
46
|
-
return tslib_1.__generator(this, function (_a) {
|
|
44
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
45
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
47
46
|
return [2 /*return*/, {}];
|
|
48
47
|
});
|
|
49
48
|
});
|
|
@@ -62,33 +61,23 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
62
61
|
* Starts transaction on the current connection.
|
|
63
62
|
*/
|
|
64
63
|
AuroraDataApiQueryRunner.prototype.startTransaction = function (isolationLevel) {
|
|
65
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
66
|
-
|
|
67
|
-
return tslib_1.__generator(this, function (_a) {
|
|
64
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
65
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
68
66
|
switch (_a.label) {
|
|
69
67
|
case 0:
|
|
70
68
|
if (this.isTransactionActive)
|
|
71
69
|
throw new TransactionAlreadyStartedError_1.TransactionAlreadyStartedError();
|
|
72
|
-
|
|
73
|
-
this.broadcaster.broadcastBeforeTransactionStartEvent(beforeBroadcastResult);
|
|
74
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
75
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
70
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionStart')];
|
|
76
71
|
case 1:
|
|
77
72
|
_a.sent();
|
|
78
|
-
_a.label = 2;
|
|
79
|
-
case 2:
|
|
80
73
|
this.isTransactionActive = true;
|
|
81
74
|
return [4 /*yield*/, this.client.startTransaction()];
|
|
82
|
-
case
|
|
75
|
+
case 2:
|
|
83
76
|
_a.sent();
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
87
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
88
|
-
case 4:
|
|
77
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionStart')];
|
|
78
|
+
case 3:
|
|
89
79
|
_a.sent();
|
|
90
|
-
|
|
91
|
-
case 5: return [2 /*return*/];
|
|
80
|
+
return [2 /*return*/];
|
|
92
81
|
}
|
|
93
82
|
});
|
|
94
83
|
});
|
|
@@ -98,32 +87,23 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
98
87
|
* Error will be thrown if transaction was not started.
|
|
99
88
|
*/
|
|
100
89
|
AuroraDataApiQueryRunner.prototype.commitTransaction = function () {
|
|
101
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
102
|
-
|
|
103
|
-
return tslib_1.__generator(this, function (_a) {
|
|
90
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
91
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
104
92
|
switch (_a.label) {
|
|
105
93
|
case 0:
|
|
106
94
|
if (!this.isTransactionActive)
|
|
107
95
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
108
|
-
|
|
109
|
-
this.broadcaster.broadcastBeforeTransactionCommitEvent(beforeBroadcastResult);
|
|
110
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
111
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
96
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionCommit')];
|
|
112
97
|
case 1:
|
|
113
98
|
_a.sent();
|
|
114
|
-
|
|
115
|
-
case 2:
|
|
116
|
-
case 3:
|
|
99
|
+
return [4 /*yield*/, this.client.commitTransaction()];
|
|
100
|
+
case 2:
|
|
117
101
|
_a.sent();
|
|
118
102
|
this.isTransactionActive = false;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
122
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
123
|
-
case 4:
|
|
103
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionCommit')];
|
|
104
|
+
case 3:
|
|
124
105
|
_a.sent();
|
|
125
|
-
|
|
126
|
-
case 5: return [2 /*return*/];
|
|
106
|
+
return [2 /*return*/];
|
|
127
107
|
}
|
|
128
108
|
});
|
|
129
109
|
});
|
|
@@ -133,32 +113,23 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
133
113
|
* Error will be thrown if transaction was not started.
|
|
134
114
|
*/
|
|
135
115
|
AuroraDataApiQueryRunner.prototype.rollbackTransaction = function () {
|
|
136
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
137
|
-
|
|
138
|
-
return tslib_1.__generator(this, function (_a) {
|
|
116
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
117
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
139
118
|
switch (_a.label) {
|
|
140
119
|
case 0:
|
|
141
120
|
if (!this.isTransactionActive)
|
|
142
121
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
143
|
-
|
|
144
|
-
this.broadcaster.broadcastBeforeTransactionRollbackEvent(beforeBroadcastResult);
|
|
145
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
146
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
122
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionRollback')];
|
|
147
123
|
case 1:
|
|
148
124
|
_a.sent();
|
|
149
|
-
|
|
150
|
-
case 2:
|
|
151
|
-
case 3:
|
|
125
|
+
return [4 /*yield*/, this.client.rollbackTransaction()];
|
|
126
|
+
case 2:
|
|
152
127
|
_a.sent();
|
|
153
128
|
this.isTransactionActive = false;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
157
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
158
|
-
case 4:
|
|
129
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionRollback')];
|
|
130
|
+
case 3:
|
|
159
131
|
_a.sent();
|
|
160
|
-
|
|
161
|
-
case 5: return [2 /*return*/];
|
|
132
|
+
return [2 /*return*/];
|
|
162
133
|
}
|
|
163
134
|
});
|
|
164
135
|
});
|
|
@@ -168,9 +139,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
168
139
|
*/
|
|
169
140
|
AuroraDataApiQueryRunner.prototype.query = function (query, parameters, useStructuredResult) {
|
|
170
141
|
if (useStructuredResult === void 0) { useStructuredResult = false; }
|
|
171
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
142
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
172
143
|
var raw, result;
|
|
173
|
-
return tslib_1.__generator(this, function (_a) {
|
|
144
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
174
145
|
switch (_a.label) {
|
|
175
146
|
case 0:
|
|
176
147
|
if (this.isReleased)
|
|
@@ -201,9 +172,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
201
172
|
var _this = this;
|
|
202
173
|
if (this.isReleased)
|
|
203
174
|
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
204
|
-
return new Promise(function (ok, fail) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
175
|
+
return new Promise(function (ok, fail) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
205
176
|
var databaseConnection, stream, err_1;
|
|
206
|
-
return tslib_1.__generator(this, function (_a) {
|
|
177
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
207
178
|
switch (_a.label) {
|
|
208
179
|
case 0:
|
|
209
180
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -230,8 +201,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
230
201
|
* Returns all available database names including system databases.
|
|
231
202
|
*/
|
|
232
203
|
AuroraDataApiQueryRunner.prototype.getDatabases = function () {
|
|
233
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
234
|
-
return tslib_1.__generator(this, function (_a) {
|
|
204
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
205
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
235
206
|
return [2 /*return*/, Promise.resolve([])];
|
|
236
207
|
});
|
|
237
208
|
});
|
|
@@ -241,8 +212,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
241
212
|
* If database parameter specified, returns schemas of that database.
|
|
242
213
|
*/
|
|
243
214
|
AuroraDataApiQueryRunner.prototype.getSchemas = function (database) {
|
|
244
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
245
|
-
return tslib_1.__generator(this, function (_a) {
|
|
215
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
216
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
246
217
|
throw new error_1.TypeORMError("MySql driver does not support table schemas");
|
|
247
218
|
});
|
|
248
219
|
});
|
|
@@ -251,9 +222,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
251
222
|
* Checks if database with the given name exist.
|
|
252
223
|
*/
|
|
253
224
|
AuroraDataApiQueryRunner.prototype.hasDatabase = function (database) {
|
|
254
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
225
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
255
226
|
var result;
|
|
256
|
-
return tslib_1.__generator(this, function (_a) {
|
|
227
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
257
228
|
switch (_a.label) {
|
|
258
229
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM `INFORMATION_SCHEMA`.`SCHEMATA` WHERE `SCHEMA_NAME` = '" + database + "'")];
|
|
259
230
|
case 1:
|
|
@@ -267,9 +238,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
267
238
|
* Loads currently using database
|
|
268
239
|
*/
|
|
269
240
|
AuroraDataApiQueryRunner.prototype.getCurrentDatabase = function () {
|
|
270
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
241
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
271
242
|
var query;
|
|
272
|
-
return tslib_1.__generator(this, function (_a) {
|
|
243
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
273
244
|
switch (_a.label) {
|
|
274
245
|
case 0: return [4 /*yield*/, this.query("SELECT DATABASE() AS `db_name`")];
|
|
275
246
|
case 1:
|
|
@@ -283,8 +254,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
283
254
|
* Checks if schema with the given name exist.
|
|
284
255
|
*/
|
|
285
256
|
AuroraDataApiQueryRunner.prototype.hasSchema = function (schema) {
|
|
286
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
287
|
-
return tslib_1.__generator(this, function (_a) {
|
|
257
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
258
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
288
259
|
throw new error_1.TypeORMError("MySql driver does not support table schemas");
|
|
289
260
|
});
|
|
290
261
|
});
|
|
@@ -293,9 +264,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
293
264
|
* Loads currently using database schema
|
|
294
265
|
*/
|
|
295
266
|
AuroraDataApiQueryRunner.prototype.getCurrentSchema = function () {
|
|
296
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
267
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
297
268
|
var query;
|
|
298
|
-
return tslib_1.__generator(this, function (_a) {
|
|
269
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
299
270
|
switch (_a.label) {
|
|
300
271
|
case 0: return [4 /*yield*/, this.query("SELECT SCHEMA() AS `schema_name`")];
|
|
301
272
|
case 1:
|
|
@@ -309,9 +280,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
309
280
|
* Checks if table with the given name exist in the database.
|
|
310
281
|
*/
|
|
311
282
|
AuroraDataApiQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
312
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
283
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
313
284
|
var parsedTableName, sql, result;
|
|
314
|
-
return tslib_1.__generator(this, function (_a) {
|
|
285
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
315
286
|
switch (_a.label) {
|
|
316
287
|
case 0:
|
|
317
288
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -328,9 +299,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
328
299
|
* Checks if column with the given name exist in the given table.
|
|
329
300
|
*/
|
|
330
301
|
AuroraDataApiQueryRunner.prototype.hasColumn = function (tableOrName, column) {
|
|
331
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
302
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
332
303
|
var parsedTableName, columnName, sql, result;
|
|
333
|
-
return tslib_1.__generator(this, function (_a) {
|
|
304
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
334
305
|
switch (_a.label) {
|
|
335
306
|
case 0:
|
|
336
307
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -348,9 +319,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
348
319
|
* Creates a new database.
|
|
349
320
|
*/
|
|
350
321
|
AuroraDataApiQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
351
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
322
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
352
323
|
var up, down;
|
|
353
|
-
return tslib_1.__generator(this, function (_a) {
|
|
324
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
354
325
|
switch (_a.label) {
|
|
355
326
|
case 0:
|
|
356
327
|
up = ifNotExist ? "CREATE DATABASE IF NOT EXISTS `" + database + "`" : "CREATE DATABASE `" + database + "`";
|
|
@@ -367,9 +338,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
367
338
|
* Drops database.
|
|
368
339
|
*/
|
|
369
340
|
AuroraDataApiQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
370
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
341
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
371
342
|
var up, down;
|
|
372
|
-
return tslib_1.__generator(this, function (_a) {
|
|
343
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
373
344
|
switch (_a.label) {
|
|
374
345
|
case 0:
|
|
375
346
|
up = ifExist ? "DROP DATABASE IF EXISTS `" + database + "`" : "DROP DATABASE `" + database + "`";
|
|
@@ -386,8 +357,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
386
357
|
* Creates a new table schema.
|
|
387
358
|
*/
|
|
388
359
|
AuroraDataApiQueryRunner.prototype.createSchema = function (schemaPath, ifNotExist) {
|
|
389
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
390
|
-
return tslib_1.__generator(this, function (_a) {
|
|
360
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
361
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
391
362
|
throw new error_1.TypeORMError("Schema create queries are not supported by MySql driver.");
|
|
392
363
|
});
|
|
393
364
|
});
|
|
@@ -396,8 +367,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
396
367
|
* Drops table schema.
|
|
397
368
|
*/
|
|
398
369
|
AuroraDataApiQueryRunner.prototype.dropSchema = function (schemaPath, ifExist) {
|
|
399
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
400
|
-
return tslib_1.__generator(this, function (_a) {
|
|
370
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
371
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
401
372
|
throw new error_1.TypeORMError("Schema drop queries are not supported by MySql driver.");
|
|
402
373
|
});
|
|
403
374
|
});
|
|
@@ -408,10 +379,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
408
379
|
AuroraDataApiQueryRunner.prototype.createTable = function (table, ifNotExist, createForeignKeys) {
|
|
409
380
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
410
381
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
411
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
382
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
412
383
|
var isTableExist, upQueries, downQueries;
|
|
413
384
|
var _this = this;
|
|
414
|
-
return tslib_1.__generator(this, function (_a) {
|
|
385
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
415
386
|
switch (_a.label) {
|
|
416
387
|
case 0:
|
|
417
388
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -445,10 +416,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
445
416
|
*/
|
|
446
417
|
AuroraDataApiQueryRunner.prototype.dropTable = function (target, ifExist, dropForeignKeys) {
|
|
447
418
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
448
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
419
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
449
420
|
var isTableExist, createForeignKeys, tablePath, table, upQueries, downQueries;
|
|
450
421
|
var _this = this;
|
|
451
|
-
return tslib_1.__generator(this, function (_a) {
|
|
422
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
452
423
|
switch (_a.label) {
|
|
453
424
|
case 0:
|
|
454
425
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -483,9 +454,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
483
454
|
* Creates a new view.
|
|
484
455
|
*/
|
|
485
456
|
AuroraDataApiQueryRunner.prototype.createView = function (view) {
|
|
486
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
457
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
487
458
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
488
|
-
return tslib_1.__generator(this, function (_e) {
|
|
459
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
489
460
|
switch (_e.label) {
|
|
490
461
|
case 0:
|
|
491
462
|
upQueries = [];
|
|
@@ -512,9 +483,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
512
483
|
* Drops the view.
|
|
513
484
|
*/
|
|
514
485
|
AuroraDataApiQueryRunner.prototype.dropView = function (target) {
|
|
515
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
486
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
516
487
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
517
|
-
return tslib_1.__generator(this, function (_e) {
|
|
488
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
518
489
|
switch (_e.label) {
|
|
519
490
|
case 0:
|
|
520
491
|
viewName = target instanceof View_1.View ? target.name : target;
|
|
@@ -545,10 +516,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
545
516
|
* Renames a table.
|
|
546
517
|
*/
|
|
547
518
|
AuroraDataApiQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
548
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
519
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
549
520
|
var upQueries, downQueries, oldTable, _a, newTable, database;
|
|
550
521
|
var _this = this;
|
|
551
|
-
return tslib_1.__generator(this, function (_b) {
|
|
522
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
552
523
|
switch (_b.label) {
|
|
553
524
|
case 0:
|
|
554
525
|
upQueries = [];
|
|
@@ -625,9 +596,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
625
596
|
* Creates a new column from the column in the table.
|
|
626
597
|
*/
|
|
627
598
|
AuroraDataApiQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
628
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
599
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
629
600
|
var table, _a, clonedTable, upQueries, downQueries, skipColumnLevelPrimary, generatedColumn, nonGeneratedColumn, primaryColumns, columnNames, nonGeneratedColumn, columnIndex, uniqueIndex;
|
|
630
|
-
return tslib_1.__generator(this, function (_b) {
|
|
601
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
631
602
|
switch (_b.label) {
|
|
632
603
|
case 0:
|
|
633
604
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -705,14 +676,14 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
705
676
|
* Creates a new columns from the column in the table.
|
|
706
677
|
*/
|
|
707
678
|
AuroraDataApiQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
708
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
679
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
709
680
|
var columns_1, columns_1_1, column, e_1_1;
|
|
710
681
|
var e_1, _a;
|
|
711
|
-
return tslib_1.__generator(this, function (_b) {
|
|
682
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
712
683
|
switch (_b.label) {
|
|
713
684
|
case 0:
|
|
714
685
|
_b.trys.push([0, 5, 6, 7]);
|
|
715
|
-
columns_1 = tslib_1.__values(columns), columns_1_1 = columns_1.next();
|
|
686
|
+
columns_1 = (0, tslib_1.__values)(columns), columns_1_1 = columns_1.next();
|
|
716
687
|
_b.label = 1;
|
|
717
688
|
case 1:
|
|
718
689
|
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -744,9 +715,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
744
715
|
* Renames column in the given table.
|
|
745
716
|
*/
|
|
746
717
|
AuroraDataApiQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
747
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
718
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
748
719
|
var table, _a, oldColumn, newColumn;
|
|
749
|
-
return tslib_1.__generator(this, function (_b) {
|
|
720
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
750
721
|
switch (_b.label) {
|
|
751
722
|
case 0:
|
|
752
723
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -781,10 +752,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
781
752
|
* Changes a column in the table.
|
|
782
753
|
*/
|
|
783
754
|
AuroraDataApiQueryRunner.prototype.changeColumn = function (tableOrName, oldColumnOrName, newColumn) {
|
|
784
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
755
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
785
756
|
var table, _a, clonedTable, upQueries, downQueries, oldColumn, oldTableColumn, generatedColumn, nonGeneratedColumn, primaryColumns, columnNames, column, columnNames, primaryColumn, column, columnNames, nonGeneratedColumn, uniqueIndex, uniqueIndex_1, tableUnique;
|
|
786
757
|
var _this = this;
|
|
787
|
-
return tslib_1.__generator(this, function (_b) {
|
|
758
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
788
759
|
switch (_b.label) {
|
|
789
760
|
case 0:
|
|
790
761
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -961,14 +932,14 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
961
932
|
* Changes a column in the table.
|
|
962
933
|
*/
|
|
963
934
|
AuroraDataApiQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
964
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
935
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
965
936
|
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_2_1;
|
|
966
937
|
var e_2, _b;
|
|
967
|
-
return tslib_1.__generator(this, function (_c) {
|
|
938
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
968
939
|
switch (_c.label) {
|
|
969
940
|
case 0:
|
|
970
941
|
_c.trys.push([0, 5, 6, 7]);
|
|
971
|
-
changedColumns_1 = tslib_1.__values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
942
|
+
changedColumns_1 = (0, tslib_1.__values)(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
972
943
|
_c.label = 1;
|
|
973
944
|
case 1:
|
|
974
945
|
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1000,9 +971,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1000
971
|
* Drops column in the table.
|
|
1001
972
|
*/
|
|
1002
973
|
AuroraDataApiQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1003
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
974
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1004
975
|
var table, _a, column, clonedTable, upQueries, downQueries, generatedColumn, nonGeneratedColumn, columnNames, tableColumn, columnNames_1, nonGeneratedColumn, columnIndex, uniqueName_1, foundUnique, indexName_1, foundIndex;
|
|
1005
|
-
return tslib_1.__generator(this, function (_b) {
|
|
976
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1006
977
|
switch (_b.label) {
|
|
1007
978
|
case 0:
|
|
1008
979
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1084,14 +1055,14 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1084
1055
|
* Drops the columns in the table.
|
|
1085
1056
|
*/
|
|
1086
1057
|
AuroraDataApiQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1087
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1058
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1088
1059
|
var columns_2, columns_2_1, column, e_3_1;
|
|
1089
1060
|
var e_3, _a;
|
|
1090
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1061
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1091
1062
|
switch (_b.label) {
|
|
1092
1063
|
case 0:
|
|
1093
1064
|
_b.trys.push([0, 5, 6, 7]);
|
|
1094
|
-
columns_2 = tslib_1.__values(columns), columns_2_1 = columns_2.next();
|
|
1065
|
+
columns_2 = (0, tslib_1.__values)(columns), columns_2_1 = columns_2.next();
|
|
1095
1066
|
_b.label = 1;
|
|
1096
1067
|
case 1:
|
|
1097
1068
|
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1123,9 +1094,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1123
1094
|
* Creates a new primary key.
|
|
1124
1095
|
*/
|
|
1125
1096
|
AuroraDataApiQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1126
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1097
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1127
1098
|
var table, _a, clonedTable, up, down;
|
|
1128
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1099
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1129
1100
|
switch (_b.label) {
|
|
1130
1101
|
case 0:
|
|
1131
1102
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1157,9 +1128,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1157
1128
|
* Updates composite primary keys.
|
|
1158
1129
|
*/
|
|
1159
1130
|
AuroraDataApiQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1160
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1131
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1161
1132
|
var table, _a, clonedTable, columnNames, upQueries, downQueries, generatedColumn, nonGeneratedColumn, primaryColumns, columnNames_2, columnNamesString, newOrExistGeneratedColumn, nonGeneratedColumn, changedGeneratedColumn;
|
|
1162
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1133
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1163
1134
|
switch (_b.label) {
|
|
1164
1135
|
case 0:
|
|
1165
1136
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1220,9 +1191,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1220
1191
|
* Drops a primary key.
|
|
1221
1192
|
*/
|
|
1222
1193
|
AuroraDataApiQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1223
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1194
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1224
1195
|
var table, _a, up, down;
|
|
1225
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1196
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1226
1197
|
switch (_b.label) {
|
|
1227
1198
|
case 0:
|
|
1228
1199
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1251,8 +1222,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1251
1222
|
* Creates a new unique constraint.
|
|
1252
1223
|
*/
|
|
1253
1224
|
AuroraDataApiQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1254
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1255
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1225
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1226
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1256
1227
|
throw new error_1.TypeORMError("MySql does not support unique constraints. Use unique index instead.");
|
|
1257
1228
|
});
|
|
1258
1229
|
});
|
|
@@ -1261,8 +1232,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1261
1232
|
* Creates a new unique constraints.
|
|
1262
1233
|
*/
|
|
1263
1234
|
AuroraDataApiQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1264
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1265
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1235
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1236
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1266
1237
|
throw new error_1.TypeORMError("MySql does not support unique constraints. Use unique index instead.");
|
|
1267
1238
|
});
|
|
1268
1239
|
});
|
|
@@ -1271,8 +1242,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1271
1242
|
* Drops an unique constraint.
|
|
1272
1243
|
*/
|
|
1273
1244
|
AuroraDataApiQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1274
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1275
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1245
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1246
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1276
1247
|
throw new error_1.TypeORMError("MySql does not support unique constraints. Use unique index instead.");
|
|
1277
1248
|
});
|
|
1278
1249
|
});
|
|
@@ -1281,8 +1252,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1281
1252
|
* Drops an unique constraints.
|
|
1282
1253
|
*/
|
|
1283
1254
|
AuroraDataApiQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1284
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1285
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1255
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1256
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1286
1257
|
throw new error_1.TypeORMError("MySql does not support unique constraints. Use unique index instead.");
|
|
1287
1258
|
});
|
|
1288
1259
|
});
|
|
@@ -1291,8 +1262,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1291
1262
|
* Creates a new check constraint.
|
|
1292
1263
|
*/
|
|
1293
1264
|
AuroraDataApiQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1294
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1295
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1265
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1266
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1296
1267
|
throw new error_1.TypeORMError("MySql does not support check constraints.");
|
|
1297
1268
|
});
|
|
1298
1269
|
});
|
|
@@ -1301,8 +1272,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1301
1272
|
* Creates a new check constraints.
|
|
1302
1273
|
*/
|
|
1303
1274
|
AuroraDataApiQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1304
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1305
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1275
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1276
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1306
1277
|
throw new error_1.TypeORMError("MySql does not support check constraints.");
|
|
1307
1278
|
});
|
|
1308
1279
|
});
|
|
@@ -1311,8 +1282,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1311
1282
|
* Drops check constraint.
|
|
1312
1283
|
*/
|
|
1313
1284
|
AuroraDataApiQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1314
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1315
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1285
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1286
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1316
1287
|
throw new error_1.TypeORMError("MySql does not support check constraints.");
|
|
1317
1288
|
});
|
|
1318
1289
|
});
|
|
@@ -1321,8 +1292,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1321
1292
|
* Drops check constraints.
|
|
1322
1293
|
*/
|
|
1323
1294
|
AuroraDataApiQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1324
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1325
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1295
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1296
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1326
1297
|
throw new error_1.TypeORMError("MySql does not support check constraints.");
|
|
1327
1298
|
});
|
|
1328
1299
|
});
|
|
@@ -1331,8 +1302,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1331
1302
|
* Creates a new exclusion constraint.
|
|
1332
1303
|
*/
|
|
1333
1304
|
AuroraDataApiQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1334
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1335
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1305
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1306
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1336
1307
|
throw new error_1.TypeORMError("MySql does not support exclusion constraints.");
|
|
1337
1308
|
});
|
|
1338
1309
|
});
|
|
@@ -1341,8 +1312,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1341
1312
|
* Creates a new exclusion constraints.
|
|
1342
1313
|
*/
|
|
1343
1314
|
AuroraDataApiQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1344
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1345
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1315
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1316
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1346
1317
|
throw new error_1.TypeORMError("MySql does not support exclusion constraints.");
|
|
1347
1318
|
});
|
|
1348
1319
|
});
|
|
@@ -1351,8 +1322,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1351
1322
|
* Drops exclusion constraint.
|
|
1352
1323
|
*/
|
|
1353
1324
|
AuroraDataApiQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1354
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1355
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1325
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1326
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1356
1327
|
throw new error_1.TypeORMError("MySql does not support exclusion constraints.");
|
|
1357
1328
|
});
|
|
1358
1329
|
});
|
|
@@ -1361,8 +1332,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1361
1332
|
* Drops exclusion constraints.
|
|
1362
1333
|
*/
|
|
1363
1334
|
AuroraDataApiQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1364
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1365
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1335
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1336
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1366
1337
|
throw new error_1.TypeORMError("MySql does not support exclusion constraints.");
|
|
1367
1338
|
});
|
|
1368
1339
|
});
|
|
@@ -1371,9 +1342,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1371
1342
|
* Creates a new foreign key.
|
|
1372
1343
|
*/
|
|
1373
1344
|
AuroraDataApiQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1374
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1345
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1375
1346
|
var table, _a, up, down;
|
|
1376
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1347
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1377
1348
|
switch (_b.label) {
|
|
1378
1349
|
case 0:
|
|
1379
1350
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1403,10 +1374,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1403
1374
|
* Creates a new foreign keys.
|
|
1404
1375
|
*/
|
|
1405
1376
|
AuroraDataApiQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1406
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1377
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1407
1378
|
var promises;
|
|
1408
1379
|
var _this = this;
|
|
1409
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1380
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1410
1381
|
switch (_a.label) {
|
|
1411
1382
|
case 0:
|
|
1412
1383
|
promises = foreignKeys.map(function (foreignKey) { return _this.createForeignKey(tableOrName, foreignKey); });
|
|
@@ -1422,9 +1393,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1422
1393
|
* Drops a foreign key.
|
|
1423
1394
|
*/
|
|
1424
1395
|
AuroraDataApiQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1425
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1396
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1426
1397
|
var table, _a, foreignKey, up, down;
|
|
1427
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1398
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1428
1399
|
switch (_b.label) {
|
|
1429
1400
|
case 0:
|
|
1430
1401
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1454,10 +1425,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1454
1425
|
* Drops a foreign keys from the table.
|
|
1455
1426
|
*/
|
|
1456
1427
|
AuroraDataApiQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1457
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1428
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1458
1429
|
var promises;
|
|
1459
1430
|
var _this = this;
|
|
1460
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1431
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1461
1432
|
switch (_a.label) {
|
|
1462
1433
|
case 0:
|
|
1463
1434
|
promises = foreignKeys.map(function (foreignKey) { return _this.dropForeignKey(tableOrName, foreignKey); });
|
|
@@ -1473,9 +1444,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1473
1444
|
* Creates a new index.
|
|
1474
1445
|
*/
|
|
1475
1446
|
AuroraDataApiQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
1476
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1447
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1477
1448
|
var table, _a, up, down;
|
|
1478
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1449
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1479
1450
|
switch (_b.label) {
|
|
1480
1451
|
case 0:
|
|
1481
1452
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1505,10 +1476,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1505
1476
|
* Creates a new indices
|
|
1506
1477
|
*/
|
|
1507
1478
|
AuroraDataApiQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
1508
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1479
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1509
1480
|
var promises;
|
|
1510
1481
|
var _this = this;
|
|
1511
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1482
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1512
1483
|
switch (_a.label) {
|
|
1513
1484
|
case 0:
|
|
1514
1485
|
promises = indices.map(function (index) { return _this.createIndex(tableOrName, index); });
|
|
@@ -1524,9 +1495,9 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1524
1495
|
* Drops an index.
|
|
1525
1496
|
*/
|
|
1526
1497
|
AuroraDataApiQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
1527
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1498
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1528
1499
|
var table, _a, index, up, down;
|
|
1529
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1500
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1530
1501
|
switch (_b.label) {
|
|
1531
1502
|
case 0:
|
|
1532
1503
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1556,10 +1527,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1556
1527
|
* Drops an indices from the table.
|
|
1557
1528
|
*/
|
|
1558
1529
|
AuroraDataApiQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
1559
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1530
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1560
1531
|
var promises;
|
|
1561
1532
|
var _this = this;
|
|
1562
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1533
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1563
1534
|
switch (_a.label) {
|
|
1564
1535
|
case 0:
|
|
1565
1536
|
promises = indices.map(function (index) { return _this.dropIndex(tableOrName, index); });
|
|
@@ -1576,8 +1547,8 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1576
1547
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
1577
1548
|
*/
|
|
1578
1549
|
AuroraDataApiQueryRunner.prototype.clearTable = function (tableOrName) {
|
|
1579
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1580
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1550
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1551
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1581
1552
|
switch (_a.label) {
|
|
1582
1553
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tableOrName))];
|
|
1583
1554
|
case 1:
|
|
@@ -1593,10 +1564,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1593
1564
|
* (because it can clear all your database).
|
|
1594
1565
|
*/
|
|
1595
1566
|
AuroraDataApiQueryRunner.prototype.clearDatabase = function (database) {
|
|
1596
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1567
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1597
1568
|
var dbName, isDatabaseExist, selectViewDropsQuery, dropViewQueries, disableForeignKeysCheckQuery, dropTablesQuery, enableForeignKeysCheckQuery, dropQueries, error_2, rollbackError_1;
|
|
1598
1569
|
var _this = this;
|
|
1599
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1570
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1600
1571
|
switch (_a.label) {
|
|
1601
1572
|
case 0:
|
|
1602
1573
|
dbName = database ? database : this.driver.database;
|
|
@@ -1662,10 +1633,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1662
1633
|
// Protected Methods
|
|
1663
1634
|
// -------------------------------------------------------------------------
|
|
1664
1635
|
AuroraDataApiQueryRunner.prototype.loadViews = function (viewNames) {
|
|
1665
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1636
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1666
1637
|
var hasTable, currentDatabase, viewsCondition, query, dbViews;
|
|
1667
1638
|
var _this = this;
|
|
1668
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1639
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1669
1640
|
switch (_a.label) {
|
|
1670
1641
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
1671
1642
|
case 1:
|
|
@@ -1707,10 +1678,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1707
1678
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
1708
1679
|
*/
|
|
1709
1680
|
AuroraDataApiQueryRunner.prototype.loadTables = function (tableNames) {
|
|
1710
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1681
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1711
1682
|
var dbTables, currentDatabase, tablesSql, _a, _b, _c, _d, tablesCondition, tablesSql, _e, _f, _g, _h, columnsCondition, columnsSql, primaryKeySql, collationsSql, indicesCondition, indicesSql, foreignKeysCondition, foreignKeysSql, _j, dbColumns, dbPrimaryKeys, dbCollations, dbIndices, dbForeignKeys;
|
|
1712
1683
|
var _this = this;
|
|
1713
|
-
return tslib_1.__generator(this, function (_k) {
|
|
1684
|
+
return (0, tslib_1.__generator)(this, function (_k) {
|
|
1714
1685
|
switch (_k.label) {
|
|
1715
1686
|
case 0:
|
|
1716
1687
|
// if no tables given then no need to proceed
|
|
@@ -1728,11 +1699,11 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1728
1699
|
_d = [[]];
|
|
1729
1700
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
1730
1701
|
case 2:
|
|
1731
|
-
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
1702
|
+
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
1732
1703
|
return [3 /*break*/, 5];
|
|
1733
1704
|
case 3:
|
|
1734
1705
|
tablesCondition = tableNames.map(function (tableName) {
|
|
1735
|
-
var _a = tslib_1.__read(tableName.split("."), 2), database = _a[0], name = _a[1];
|
|
1706
|
+
var _a = (0, tslib_1.__read)(tableName.split("."), 2), database = _a[0], name = _a[1];
|
|
1736
1707
|
if (!name) {
|
|
1737
1708
|
name = database;
|
|
1738
1709
|
database = _this.driver.database || currentDatabase;
|
|
@@ -1745,7 +1716,7 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1745
1716
|
_h = [[]];
|
|
1746
1717
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
1747
1718
|
case 4:
|
|
1748
|
-
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
1719
|
+
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
1749
1720
|
_k.label = 5;
|
|
1750
1721
|
case 5:
|
|
1751
1722
|
if (dbTables.length === 0) {
|
|
@@ -1784,10 +1755,10 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
1784
1755
|
case 6:
|
|
1785
1756
|
_j = tslib_1.__read.apply(void 0, [_k.sent(), 5]), dbColumns = _j[0], dbPrimaryKeys = _j[1], dbCollations = _j[2], dbIndices = _j[3], dbForeignKeys = _j[4];
|
|
1786
1757
|
// create tables for loaded tables
|
|
1787
|
-
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
1758
|
+
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
1788
1759
|
var table, dbCollation, defaultCollation, defaultCharset, db, tableForeignKeyConstraints, tableIndexConstraints;
|
|
1789
1760
|
var _this = this;
|
|
1790
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1761
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1791
1762
|
table = new Table_1.Table();
|
|
1792
1763
|
dbCollation = dbCollations.find(function (coll) { return coll["SCHEMA_NAME"] === dbTable["TABLE_SCHEMA"]; });
|
|
1793
1764
|
defaultCollation = dbCollation["COLLATION"];
|
|
@@ -2017,15 +1988,15 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
2017
1988
|
}
|
|
2018
1989
|
};
|
|
2019
1990
|
AuroraDataApiQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2020
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1991
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2021
1992
|
var currentDatabase, expression, _a, query, parameters;
|
|
2022
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1993
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2023
1994
|
switch (_b.label) {
|
|
2024
1995
|
case 0: return [4 /*yield*/, this.getCurrentDatabase()];
|
|
2025
1996
|
case 1:
|
|
2026
1997
|
currentDatabase = _b.sent();
|
|
2027
1998
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2028
|
-
_a = tslib_1.__read(this.connection.createQueryBuilder()
|
|
1999
|
+
_a = (0, tslib_1.__read)(this.connection.createQueryBuilder()
|
|
2029
2000
|
.insert()
|
|
2030
2001
|
.into(this.getTypeormMetadataTableName())
|
|
2031
2002
|
.values({ type: "VIEW", schema: currentDatabase, name: view.name, value: expression })
|
|
@@ -2045,16 +2016,16 @@ var AuroraDataApiQueryRunner = /** @class */ (function (_super) {
|
|
|
2045
2016
|
* Builds remove view sql.
|
|
2046
2017
|
*/
|
|
2047
2018
|
AuroraDataApiQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
|
|
2048
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2019
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2049
2020
|
var currentDatabase, viewName, qb, _a, query, parameters;
|
|
2050
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2021
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2051
2022
|
switch (_b.label) {
|
|
2052
2023
|
case 0: return [4 /*yield*/, this.getCurrentDatabase()];
|
|
2053
2024
|
case 1:
|
|
2054
2025
|
currentDatabase = _b.sent();
|
|
2055
2026
|
viewName = viewOrPath instanceof View_1.View ? viewOrPath.name : viewOrPath;
|
|
2056
2027
|
qb = this.connection.createQueryBuilder();
|
|
2057
|
-
_a = tslib_1.__read(qb.delete()
|
|
2028
|
+
_a = (0, tslib_1.__read)(qb.delete()
|
|
2058
2029
|
.from(this.getTypeormMetadataTableName())
|
|
2059
2030
|
.where(qb.escape("type") + " = 'VIEW'")
|
|
2060
2031
|
.andWhere(qb.escape("schema") + " = :schema", { schema: currentDatabase })
|