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
|
@@ -18,13 +18,12 @@ var TableUnique_1 = require("../../schema-builder/table/TableUnique");
|
|
|
18
18
|
var BaseQueryRunner_1 = require("../../query-runner/BaseQueryRunner");
|
|
19
19
|
var Broadcaster_1 = require("../../subscriber/Broadcaster");
|
|
20
20
|
var VersionUtils_1 = require("../../util/VersionUtils");
|
|
21
|
-
var BroadcasterResult_1 = require("../../subscriber/BroadcasterResult");
|
|
22
21
|
var error_1 = require("../../error");
|
|
23
22
|
/**
|
|
24
23
|
* Runs queries on a single mysql database connection.
|
|
25
24
|
*/
|
|
26
25
|
var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
27
|
-
tslib_1.__extends(MysqlQueryRunner, _super);
|
|
26
|
+
(0, tslib_1.__extends)(MysqlQueryRunner, _super);
|
|
28
27
|
// -------------------------------------------------------------------------
|
|
29
28
|
// Constructor
|
|
30
29
|
// -------------------------------------------------------------------------
|
|
@@ -77,43 +76,32 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
77
76
|
* Starts transaction on the current connection.
|
|
78
77
|
*/
|
|
79
78
|
MysqlQueryRunner.prototype.startTransaction = function (isolationLevel) {
|
|
80
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
81
|
-
|
|
82
|
-
return tslib_1.__generator(this, function (_a) {
|
|
79
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
80
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
83
81
|
switch (_a.label) {
|
|
84
82
|
case 0:
|
|
85
83
|
if (this.isTransactionActive)
|
|
86
84
|
throw new TransactionAlreadyStartedError_1.TransactionAlreadyStartedError();
|
|
87
|
-
|
|
88
|
-
this.broadcaster.broadcastBeforeTransactionStartEvent(beforeBroadcastResult);
|
|
89
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
90
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
85
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionStart')];
|
|
91
86
|
case 1:
|
|
92
87
|
_a.sent();
|
|
93
|
-
_a.label = 2;
|
|
94
|
-
case 2:
|
|
95
88
|
this.isTransactionActive = true;
|
|
96
|
-
if (!isolationLevel) return [3 /*break*/,
|
|
89
|
+
if (!isolationLevel) return [3 /*break*/, 4];
|
|
97
90
|
return [4 /*yield*/, this.query("SET TRANSACTION ISOLATION LEVEL " + isolationLevel)];
|
|
98
|
-
case
|
|
91
|
+
case 2:
|
|
99
92
|
_a.sent();
|
|
100
93
|
return [4 /*yield*/, this.query("START TRANSACTION")];
|
|
101
|
-
case
|
|
94
|
+
case 3:
|
|
102
95
|
_a.sent();
|
|
103
|
-
return [3 /*break*/,
|
|
104
|
-
case
|
|
105
|
-
case
|
|
96
|
+
return [3 /*break*/, 6];
|
|
97
|
+
case 4: return [4 /*yield*/, this.query("START TRANSACTION")];
|
|
98
|
+
case 5:
|
|
106
99
|
_a.sent();
|
|
107
|
-
_a.label =
|
|
100
|
+
_a.label = 6;
|
|
101
|
+
case 6: return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionStart')];
|
|
108
102
|
case 7:
|
|
109
|
-
afterBroadcastResult = new BroadcasterResult_1.BroadcasterResult();
|
|
110
|
-
this.broadcaster.broadcastAfterTransactionStartEvent(afterBroadcastResult);
|
|
111
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 9];
|
|
112
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
113
|
-
case 8:
|
|
114
103
|
_a.sent();
|
|
115
|
-
|
|
116
|
-
case 9: return [2 /*return*/];
|
|
104
|
+
return [2 /*return*/];
|
|
117
105
|
}
|
|
118
106
|
});
|
|
119
107
|
});
|
|
@@ -123,32 +111,23 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
123
111
|
* Error will be thrown if transaction was not started.
|
|
124
112
|
*/
|
|
125
113
|
MysqlQueryRunner.prototype.commitTransaction = function () {
|
|
126
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
127
|
-
|
|
128
|
-
return tslib_1.__generator(this, function (_a) {
|
|
114
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
115
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
129
116
|
switch (_a.label) {
|
|
130
117
|
case 0:
|
|
131
118
|
if (!this.isTransactionActive)
|
|
132
119
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
133
|
-
|
|
134
|
-
this.broadcaster.broadcastBeforeTransactionCommitEvent(beforeBroadcastResult);
|
|
135
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
136
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
120
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionCommit')];
|
|
137
121
|
case 1:
|
|
138
122
|
_a.sent();
|
|
139
|
-
|
|
140
|
-
case 2:
|
|
141
|
-
case 3:
|
|
123
|
+
return [4 /*yield*/, this.query("COMMIT")];
|
|
124
|
+
case 2:
|
|
142
125
|
_a.sent();
|
|
143
126
|
this.isTransactionActive = false;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
147
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
148
|
-
case 4:
|
|
127
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionCommit')];
|
|
128
|
+
case 3:
|
|
149
129
|
_a.sent();
|
|
150
|
-
|
|
151
|
-
case 5: return [2 /*return*/];
|
|
130
|
+
return [2 /*return*/];
|
|
152
131
|
}
|
|
153
132
|
});
|
|
154
133
|
});
|
|
@@ -158,32 +137,23 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
158
137
|
* Error will be thrown if transaction was not started.
|
|
159
138
|
*/
|
|
160
139
|
MysqlQueryRunner.prototype.rollbackTransaction = function () {
|
|
161
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
162
|
-
|
|
163
|
-
return tslib_1.__generator(this, function (_a) {
|
|
140
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
141
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
164
142
|
switch (_a.label) {
|
|
165
143
|
case 0:
|
|
166
144
|
if (!this.isTransactionActive)
|
|
167
145
|
throw new TransactionNotStartedError_1.TransactionNotStartedError();
|
|
168
|
-
|
|
169
|
-
this.broadcaster.broadcastBeforeTransactionRollbackEvent(beforeBroadcastResult);
|
|
170
|
-
if (!(beforeBroadcastResult.promises.length > 0)) return [3 /*break*/, 2];
|
|
171
|
-
return [4 /*yield*/, Promise.all(beforeBroadcastResult.promises)];
|
|
146
|
+
return [4 /*yield*/, this.broadcaster.broadcast('BeforeTransactionRollback')];
|
|
172
147
|
case 1:
|
|
173
148
|
_a.sent();
|
|
174
|
-
|
|
175
|
-
case 2:
|
|
176
|
-
case 3:
|
|
149
|
+
return [4 /*yield*/, this.query("ROLLBACK")];
|
|
150
|
+
case 2:
|
|
177
151
|
_a.sent();
|
|
178
152
|
this.isTransactionActive = false;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
if (!(afterBroadcastResult.promises.length > 0)) return [3 /*break*/, 5];
|
|
182
|
-
return [4 /*yield*/, Promise.all(afterBroadcastResult.promises)];
|
|
183
|
-
case 4:
|
|
153
|
+
return [4 /*yield*/, this.broadcaster.broadcast('AfterTransactionRollback')];
|
|
154
|
+
case 3:
|
|
184
155
|
_a.sent();
|
|
185
|
-
|
|
186
|
-
case 5: return [2 /*return*/];
|
|
156
|
+
return [2 /*return*/];
|
|
187
157
|
}
|
|
188
158
|
});
|
|
189
159
|
});
|
|
@@ -193,15 +163,15 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
193
163
|
*/
|
|
194
164
|
MysqlQueryRunner.prototype.query = function (query, parameters, useStructuredResult) {
|
|
195
165
|
if (useStructuredResult === void 0) { useStructuredResult = false; }
|
|
196
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
166
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
197
167
|
var _this = this;
|
|
198
|
-
return tslib_1.__generator(this, function (_a) {
|
|
168
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
199
169
|
if (this.isReleased)
|
|
200
170
|
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
201
|
-
return [2 /*return*/, new Promise(function (ok, fail) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
171
|
+
return [2 /*return*/, new Promise(function (ok, fail) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
202
172
|
var databaseConnection, queryStartTime_1, err_1;
|
|
203
173
|
var _this = this;
|
|
204
|
-
return tslib_1.__generator(this, function (_a) {
|
|
174
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
205
175
|
switch (_a.label) {
|
|
206
176
|
case 0:
|
|
207
177
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -258,9 +228,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
258
228
|
var _this = this;
|
|
259
229
|
if (this.isReleased)
|
|
260
230
|
throw new QueryRunnerAlreadyReleasedError_1.QueryRunnerAlreadyReleasedError();
|
|
261
|
-
return new Promise(function (ok, fail) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
231
|
+
return new Promise(function (ok, fail) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
262
232
|
var databaseConnection, databaseQuery, err_2;
|
|
263
|
-
return tslib_1.__generator(this, function (_a) {
|
|
233
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
264
234
|
switch (_a.label) {
|
|
265
235
|
case 0:
|
|
266
236
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -288,8 +258,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
288
258
|
* Returns all available database names including system databases.
|
|
289
259
|
*/
|
|
290
260
|
MysqlQueryRunner.prototype.getDatabases = function () {
|
|
291
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
292
|
-
return tslib_1.__generator(this, function (_a) {
|
|
261
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
262
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
293
263
|
return [2 /*return*/, Promise.resolve([])];
|
|
294
264
|
});
|
|
295
265
|
});
|
|
@@ -299,8 +269,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
299
269
|
* If database parameter specified, returns schemas of that database.
|
|
300
270
|
*/
|
|
301
271
|
MysqlQueryRunner.prototype.getSchemas = function (database) {
|
|
302
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
303
|
-
return tslib_1.__generator(this, function (_a) {
|
|
272
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
273
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
304
274
|
throw new error_1.TypeORMError("MySql driver does not support table schemas");
|
|
305
275
|
});
|
|
306
276
|
});
|
|
@@ -309,9 +279,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
309
279
|
* Checks if database with the given name exist.
|
|
310
280
|
*/
|
|
311
281
|
MysqlQueryRunner.prototype.hasDatabase = function (database) {
|
|
312
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
282
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
313
283
|
var result;
|
|
314
|
-
return tslib_1.__generator(this, function (_a) {
|
|
284
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
315
285
|
switch (_a.label) {
|
|
316
286
|
case 0: return [4 /*yield*/, this.query("SELECT * FROM `INFORMATION_SCHEMA`.`SCHEMATA` WHERE `SCHEMA_NAME` = '" + database + "'")];
|
|
317
287
|
case 1:
|
|
@@ -325,9 +295,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
325
295
|
* Loads currently using database
|
|
326
296
|
*/
|
|
327
297
|
MysqlQueryRunner.prototype.getCurrentDatabase = function () {
|
|
328
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
298
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
329
299
|
var query;
|
|
330
|
-
return tslib_1.__generator(this, function (_a) {
|
|
300
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
331
301
|
switch (_a.label) {
|
|
332
302
|
case 0: return [4 /*yield*/, this.query("SELECT DATABASE() AS `db_name`")];
|
|
333
303
|
case 1:
|
|
@@ -341,8 +311,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
341
311
|
* Checks if schema with the given name exist.
|
|
342
312
|
*/
|
|
343
313
|
MysqlQueryRunner.prototype.hasSchema = function (schema) {
|
|
344
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
345
|
-
return tslib_1.__generator(this, function (_a) {
|
|
314
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
315
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
346
316
|
throw new error_1.TypeORMError("MySql driver does not support table schemas");
|
|
347
317
|
});
|
|
348
318
|
});
|
|
@@ -351,9 +321,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
351
321
|
* Loads currently using database schema
|
|
352
322
|
*/
|
|
353
323
|
MysqlQueryRunner.prototype.getCurrentSchema = function () {
|
|
354
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
324
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
355
325
|
var query;
|
|
356
|
-
return tslib_1.__generator(this, function (_a) {
|
|
326
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
357
327
|
switch (_a.label) {
|
|
358
328
|
case 0: return [4 /*yield*/, this.query("SELECT SCHEMA() AS `schema_name`")];
|
|
359
329
|
case 1:
|
|
@@ -367,9 +337,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
367
337
|
* Checks if table with the given name exist in the database.
|
|
368
338
|
*/
|
|
369
339
|
MysqlQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
370
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
340
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
371
341
|
var parsedTableName, sql, result;
|
|
372
|
-
return tslib_1.__generator(this, function (_a) {
|
|
342
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
373
343
|
switch (_a.label) {
|
|
374
344
|
case 0:
|
|
375
345
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -386,9 +356,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
386
356
|
* Checks if column with the given name exist in the given table.
|
|
387
357
|
*/
|
|
388
358
|
MysqlQueryRunner.prototype.hasColumn = function (tableOrName, column) {
|
|
389
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
359
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
390
360
|
var parsedTableName, columnName, sql, result;
|
|
391
|
-
return tslib_1.__generator(this, function (_a) {
|
|
361
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
392
362
|
switch (_a.label) {
|
|
393
363
|
case 0:
|
|
394
364
|
parsedTableName = this.driver.parseTableName(tableOrName);
|
|
@@ -406,9 +376,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
406
376
|
* Creates a new database.
|
|
407
377
|
*/
|
|
408
378
|
MysqlQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
409
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
379
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
410
380
|
var up, down;
|
|
411
|
-
return tslib_1.__generator(this, function (_a) {
|
|
381
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
412
382
|
switch (_a.label) {
|
|
413
383
|
case 0:
|
|
414
384
|
up = ifNotExist ? "CREATE DATABASE IF NOT EXISTS `" + database + "`" : "CREATE DATABASE `" + database + "`";
|
|
@@ -425,9 +395,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
425
395
|
* Drops database.
|
|
426
396
|
*/
|
|
427
397
|
MysqlQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
428
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
398
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
429
399
|
var up, down;
|
|
430
|
-
return tslib_1.__generator(this, function (_a) {
|
|
400
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
431
401
|
switch (_a.label) {
|
|
432
402
|
case 0:
|
|
433
403
|
up = ifExist ? "DROP DATABASE IF EXISTS `" + database + "`" : "DROP DATABASE `" + database + "`";
|
|
@@ -444,8 +414,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
444
414
|
* Creates a new table schema.
|
|
445
415
|
*/
|
|
446
416
|
MysqlQueryRunner.prototype.createSchema = function (schemaPath, ifNotExist) {
|
|
447
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
448
|
-
return tslib_1.__generator(this, function (_a) {
|
|
417
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
418
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
449
419
|
throw new error_1.TypeORMError("Schema create queries are not supported by MySql driver.");
|
|
450
420
|
});
|
|
451
421
|
});
|
|
@@ -454,8 +424,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
454
424
|
* Drops table schema.
|
|
455
425
|
*/
|
|
456
426
|
MysqlQueryRunner.prototype.dropSchema = function (schemaPath, ifExist) {
|
|
457
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
458
|
-
return tslib_1.__generator(this, function (_a) {
|
|
427
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
428
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
459
429
|
throw new error_1.TypeORMError("Schema drop queries are not supported by MySql driver.");
|
|
460
430
|
});
|
|
461
431
|
});
|
|
@@ -466,10 +436,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
466
436
|
MysqlQueryRunner.prototype.createTable = function (table, ifNotExist, createForeignKeys) {
|
|
467
437
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
468
438
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
469
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
439
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
470
440
|
var isTableExist, upQueries, downQueries;
|
|
471
441
|
var _this = this;
|
|
472
|
-
return tslib_1.__generator(this, function (_a) {
|
|
442
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
473
443
|
switch (_a.label) {
|
|
474
444
|
case 0:
|
|
475
445
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -503,10 +473,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
503
473
|
*/
|
|
504
474
|
MysqlQueryRunner.prototype.dropTable = function (target, ifExist, dropForeignKeys) {
|
|
505
475
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
506
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
476
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
507
477
|
var isTableExist, createForeignKeys, tablePath, table, upQueries, downQueries;
|
|
508
478
|
var _this = this;
|
|
509
|
-
return tslib_1.__generator(this, function (_a) {
|
|
479
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
510
480
|
switch (_a.label) {
|
|
511
481
|
case 0:
|
|
512
482
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -541,9 +511,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
541
511
|
* Creates a new view.
|
|
542
512
|
*/
|
|
543
513
|
MysqlQueryRunner.prototype.createView = function (view) {
|
|
544
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
514
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
545
515
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
546
|
-
return tslib_1.__generator(this, function (_e) {
|
|
516
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
547
517
|
switch (_e.label) {
|
|
548
518
|
case 0:
|
|
549
519
|
upQueries = [];
|
|
@@ -570,9 +540,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
570
540
|
* Drops the view.
|
|
571
541
|
*/
|
|
572
542
|
MysqlQueryRunner.prototype.dropView = function (target) {
|
|
573
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
543
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
574
544
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
575
|
-
return tslib_1.__generator(this, function (_e) {
|
|
545
|
+
return (0, tslib_1.__generator)(this, function (_e) {
|
|
576
546
|
switch (_e.label) {
|
|
577
547
|
case 0:
|
|
578
548
|
viewName = target instanceof View_1.View ? target.name : target;
|
|
@@ -603,10 +573,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
603
573
|
* Renames a table.
|
|
604
574
|
*/
|
|
605
575
|
MysqlQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
606
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
576
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
607
577
|
var upQueries, downQueries, oldTable, _a, newTable, database;
|
|
608
578
|
var _this = this;
|
|
609
|
-
return tslib_1.__generator(this, function (_b) {
|
|
579
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
610
580
|
switch (_b.label) {
|
|
611
581
|
case 0:
|
|
612
582
|
upQueries = [];
|
|
@@ -684,9 +654,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
684
654
|
* Creates a new column from the column in the table.
|
|
685
655
|
*/
|
|
686
656
|
MysqlQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
687
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
657
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
688
658
|
var table, _a, clonedTable, upQueries, downQueries, skipColumnLevelPrimary, generatedColumn, nonGeneratedColumn, primaryColumns, columnNames, nonGeneratedColumn, columnIndex, uniqueIndex;
|
|
689
|
-
return tslib_1.__generator(this, function (_b) {
|
|
659
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
690
660
|
switch (_b.label) {
|
|
691
661
|
case 0:
|
|
692
662
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -764,14 +734,14 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
764
734
|
* Creates a new columns from the column in the table.
|
|
765
735
|
*/
|
|
766
736
|
MysqlQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
767
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
737
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
768
738
|
var columns_1, columns_1_1, column, e_1_1;
|
|
769
739
|
var e_1, _a;
|
|
770
|
-
return tslib_1.__generator(this, function (_b) {
|
|
740
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
771
741
|
switch (_b.label) {
|
|
772
742
|
case 0:
|
|
773
743
|
_b.trys.push([0, 5, 6, 7]);
|
|
774
|
-
columns_1 = tslib_1.__values(columns), columns_1_1 = columns_1.next();
|
|
744
|
+
columns_1 = (0, tslib_1.__values)(columns), columns_1_1 = columns_1.next();
|
|
775
745
|
_b.label = 1;
|
|
776
746
|
case 1:
|
|
777
747
|
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -803,9 +773,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
803
773
|
* Renames column in the given table.
|
|
804
774
|
*/
|
|
805
775
|
MysqlQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
806
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
776
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
807
777
|
var table, _a, oldColumn, newColumn;
|
|
808
|
-
return tslib_1.__generator(this, function (_b) {
|
|
778
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
809
779
|
switch (_b.label) {
|
|
810
780
|
case 0:
|
|
811
781
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -840,10 +810,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
840
810
|
* Changes a column in the table.
|
|
841
811
|
*/
|
|
842
812
|
MysqlQueryRunner.prototype.changeColumn = function (tableOrName, oldColumnOrName, newColumn) {
|
|
843
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
813
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
844
814
|
var table, _a, clonedTable, upQueries, downQueries, oldColumn, oldTableColumn, generatedColumn, nonGeneratedColumn, primaryColumns, columnNames, column, columnNames, primaryColumn, column, columnNames, nonGeneratedColumn, uniqueIndex, uniqueIndex_1, tableUnique;
|
|
845
815
|
var _this = this;
|
|
846
|
-
return tslib_1.__generator(this, function (_b) {
|
|
816
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
847
817
|
switch (_b.label) {
|
|
848
818
|
case 0:
|
|
849
819
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1021,14 +991,14 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1021
991
|
* Changes a column in the table.
|
|
1022
992
|
*/
|
|
1023
993
|
MysqlQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
1024
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
994
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1025
995
|
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_2_1;
|
|
1026
996
|
var e_2, _b;
|
|
1027
|
-
return tslib_1.__generator(this, function (_c) {
|
|
997
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
1028
998
|
switch (_c.label) {
|
|
1029
999
|
case 0:
|
|
1030
1000
|
_c.trys.push([0, 5, 6, 7]);
|
|
1031
|
-
changedColumns_1 = tslib_1.__values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1001
|
+
changedColumns_1 = (0, tslib_1.__values)(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1032
1002
|
_c.label = 1;
|
|
1033
1003
|
case 1:
|
|
1034
1004
|
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
@@ -1060,9 +1030,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1060
1030
|
* Drops column in the table.
|
|
1061
1031
|
*/
|
|
1062
1032
|
MysqlQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1063
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1033
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1064
1034
|
var table, _a, column, clonedTable, upQueries, downQueries, generatedColumn, nonGeneratedColumn, columnNames, tableColumn, columnNames_1, nonGeneratedColumn, columnIndex, uniqueName_1, foundUnique, indexName_1, foundIndex;
|
|
1065
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1035
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1066
1036
|
switch (_b.label) {
|
|
1067
1037
|
case 0:
|
|
1068
1038
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1144,14 +1114,14 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1144
1114
|
* Drops the columns in the table.
|
|
1145
1115
|
*/
|
|
1146
1116
|
MysqlQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1147
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1117
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1148
1118
|
var columns_2, columns_2_1, column, e_3_1;
|
|
1149
1119
|
var e_3, _a;
|
|
1150
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1120
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1151
1121
|
switch (_b.label) {
|
|
1152
1122
|
case 0:
|
|
1153
1123
|
_b.trys.push([0, 5, 6, 7]);
|
|
1154
|
-
columns_2 = tslib_1.__values(columns), columns_2_1 = columns_2.next();
|
|
1124
|
+
columns_2 = (0, tslib_1.__values)(columns), columns_2_1 = columns_2.next();
|
|
1155
1125
|
_b.label = 1;
|
|
1156
1126
|
case 1:
|
|
1157
1127
|
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
@@ -1183,9 +1153,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1183
1153
|
* Creates a new primary key.
|
|
1184
1154
|
*/
|
|
1185
1155
|
MysqlQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1186
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1156
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1187
1157
|
var table, _a, clonedTable, up, down;
|
|
1188
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1158
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1189
1159
|
switch (_b.label) {
|
|
1190
1160
|
case 0:
|
|
1191
1161
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1217,9 +1187,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1217
1187
|
* Updates composite primary keys.
|
|
1218
1188
|
*/
|
|
1219
1189
|
MysqlQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1220
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1190
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1221
1191
|
var table, _a, clonedTable, columnNames, upQueries, downQueries, generatedColumn, nonGeneratedColumn, primaryColumns, columnNames_2, columnNamesString, newOrExistGeneratedColumn, nonGeneratedColumn, changedGeneratedColumn;
|
|
1222
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1192
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1223
1193
|
switch (_b.label) {
|
|
1224
1194
|
case 0:
|
|
1225
1195
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1280,9 +1250,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1280
1250
|
* Drops a primary key.
|
|
1281
1251
|
*/
|
|
1282
1252
|
MysqlQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1283
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1253
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1284
1254
|
var table, _a, up, down;
|
|
1285
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1255
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1286
1256
|
switch (_b.label) {
|
|
1287
1257
|
case 0:
|
|
1288
1258
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1311,8 +1281,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1311
1281
|
* Creates a new unique constraint.
|
|
1312
1282
|
*/
|
|
1313
1283
|
MysqlQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1314
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1315
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1284
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1285
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1316
1286
|
throw new error_1.TypeORMError("MySql does not support unique constraints. Use unique index instead.");
|
|
1317
1287
|
});
|
|
1318
1288
|
});
|
|
@@ -1321,8 +1291,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1321
1291
|
* Creates a new unique constraints.
|
|
1322
1292
|
*/
|
|
1323
1293
|
MysqlQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1324
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1325
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1294
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1295
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1326
1296
|
throw new error_1.TypeORMError("MySql does not support unique constraints. Use unique index instead.");
|
|
1327
1297
|
});
|
|
1328
1298
|
});
|
|
@@ -1331,8 +1301,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1331
1301
|
* Drops an unique constraint.
|
|
1332
1302
|
*/
|
|
1333
1303
|
MysqlQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1334
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1335
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1304
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1305
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1336
1306
|
throw new error_1.TypeORMError("MySql does not support unique constraints. Use unique index instead.");
|
|
1337
1307
|
});
|
|
1338
1308
|
});
|
|
@@ -1341,8 +1311,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1341
1311
|
* Drops an unique constraints.
|
|
1342
1312
|
*/
|
|
1343
1313
|
MysqlQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1344
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1345
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1314
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1315
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1346
1316
|
throw new error_1.TypeORMError("MySql does not support unique constraints. Use unique index instead.");
|
|
1347
1317
|
});
|
|
1348
1318
|
});
|
|
@@ -1351,8 +1321,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1351
1321
|
* Creates a new check constraint.
|
|
1352
1322
|
*/
|
|
1353
1323
|
MysqlQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1354
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1355
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1324
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1325
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1356
1326
|
throw new error_1.TypeORMError("MySql does not support check constraints.");
|
|
1357
1327
|
});
|
|
1358
1328
|
});
|
|
@@ -1361,8 +1331,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1361
1331
|
* Creates a new check constraints.
|
|
1362
1332
|
*/
|
|
1363
1333
|
MysqlQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1364
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1365
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1334
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1335
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1366
1336
|
throw new error_1.TypeORMError("MySql does not support check constraints.");
|
|
1367
1337
|
});
|
|
1368
1338
|
});
|
|
@@ -1371,8 +1341,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1371
1341
|
* Drops check constraint.
|
|
1372
1342
|
*/
|
|
1373
1343
|
MysqlQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1374
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1375
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1344
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1345
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1376
1346
|
throw new error_1.TypeORMError("MySql does not support check constraints.");
|
|
1377
1347
|
});
|
|
1378
1348
|
});
|
|
@@ -1381,8 +1351,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1381
1351
|
* Drops check constraints.
|
|
1382
1352
|
*/
|
|
1383
1353
|
MysqlQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1384
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1385
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1354
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1355
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1386
1356
|
throw new error_1.TypeORMError("MySql does not support check constraints.");
|
|
1387
1357
|
});
|
|
1388
1358
|
});
|
|
@@ -1391,8 +1361,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1391
1361
|
* Creates a new exclusion constraint.
|
|
1392
1362
|
*/
|
|
1393
1363
|
MysqlQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1394
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1395
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1364
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1365
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1396
1366
|
throw new error_1.TypeORMError("MySql does not support exclusion constraints.");
|
|
1397
1367
|
});
|
|
1398
1368
|
});
|
|
@@ -1401,8 +1371,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1401
1371
|
* Creates a new exclusion constraints.
|
|
1402
1372
|
*/
|
|
1403
1373
|
MysqlQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1404
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1405
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1374
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1375
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1406
1376
|
throw new error_1.TypeORMError("MySql does not support exclusion constraints.");
|
|
1407
1377
|
});
|
|
1408
1378
|
});
|
|
@@ -1411,8 +1381,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1411
1381
|
* Drops exclusion constraint.
|
|
1412
1382
|
*/
|
|
1413
1383
|
MysqlQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1414
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1415
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1384
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1385
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1416
1386
|
throw new error_1.TypeORMError("MySql does not support exclusion constraints.");
|
|
1417
1387
|
});
|
|
1418
1388
|
});
|
|
@@ -1421,8 +1391,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1421
1391
|
* Drops exclusion constraints.
|
|
1422
1392
|
*/
|
|
1423
1393
|
MysqlQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1424
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1425
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1394
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1395
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1426
1396
|
throw new error_1.TypeORMError("MySql does not support exclusion constraints.");
|
|
1427
1397
|
});
|
|
1428
1398
|
});
|
|
@@ -1431,9 +1401,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1431
1401
|
* Creates a new foreign key.
|
|
1432
1402
|
*/
|
|
1433
1403
|
MysqlQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1434
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1404
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1435
1405
|
var table, _a, up, down;
|
|
1436
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1406
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1437
1407
|
switch (_b.label) {
|
|
1438
1408
|
case 0:
|
|
1439
1409
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1463,10 +1433,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1463
1433
|
* Creates a new foreign keys.
|
|
1464
1434
|
*/
|
|
1465
1435
|
MysqlQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1466
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1436
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1467
1437
|
var promises;
|
|
1468
1438
|
var _this = this;
|
|
1469
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1439
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1470
1440
|
switch (_a.label) {
|
|
1471
1441
|
case 0:
|
|
1472
1442
|
promises = foreignKeys.map(function (foreignKey) { return _this.createForeignKey(tableOrName, foreignKey); });
|
|
@@ -1482,9 +1452,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1482
1452
|
* Drops a foreign key.
|
|
1483
1453
|
*/
|
|
1484
1454
|
MysqlQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1485
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1455
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1486
1456
|
var table, _a, foreignKey, up, down;
|
|
1487
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1457
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1488
1458
|
switch (_b.label) {
|
|
1489
1459
|
case 0:
|
|
1490
1460
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1514,10 +1484,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1514
1484
|
* Drops a foreign keys from the table.
|
|
1515
1485
|
*/
|
|
1516
1486
|
MysqlQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1517
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1487
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1518
1488
|
var promises;
|
|
1519
1489
|
var _this = this;
|
|
1520
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1490
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1521
1491
|
switch (_a.label) {
|
|
1522
1492
|
case 0:
|
|
1523
1493
|
promises = foreignKeys.map(function (foreignKey) { return _this.dropForeignKey(tableOrName, foreignKey); });
|
|
@@ -1533,9 +1503,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1533
1503
|
* Creates a new index.
|
|
1534
1504
|
*/
|
|
1535
1505
|
MysqlQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
1536
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1506
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1537
1507
|
var table, _a, up, down;
|
|
1538
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1508
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1539
1509
|
switch (_b.label) {
|
|
1540
1510
|
case 0:
|
|
1541
1511
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1565,10 +1535,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1565
1535
|
* Creates a new indices
|
|
1566
1536
|
*/
|
|
1567
1537
|
MysqlQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
1568
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1538
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1569
1539
|
var promises;
|
|
1570
1540
|
var _this = this;
|
|
1571
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1541
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1572
1542
|
switch (_a.label) {
|
|
1573
1543
|
case 0:
|
|
1574
1544
|
promises = indices.map(function (index) { return _this.createIndex(tableOrName, index); });
|
|
@@ -1584,9 +1554,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1584
1554
|
* Drops an index.
|
|
1585
1555
|
*/
|
|
1586
1556
|
MysqlQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
1587
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1557
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1588
1558
|
var table, _a, index, up, down;
|
|
1589
|
-
return tslib_1.__generator(this, function (_b) {
|
|
1559
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
1590
1560
|
switch (_b.label) {
|
|
1591
1561
|
case 0:
|
|
1592
1562
|
if (!(tableOrName instanceof Table_1.Table)) return [3 /*break*/, 1];
|
|
@@ -1616,10 +1586,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1616
1586
|
* Drops an indices from the table.
|
|
1617
1587
|
*/
|
|
1618
1588
|
MysqlQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
1619
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1589
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1620
1590
|
var promises;
|
|
1621
1591
|
var _this = this;
|
|
1622
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1592
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1623
1593
|
switch (_a.label) {
|
|
1624
1594
|
case 0:
|
|
1625
1595
|
promises = indices.map(function (index) { return _this.dropIndex(tableOrName, index); });
|
|
@@ -1636,8 +1606,8 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1636
1606
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
1637
1607
|
*/
|
|
1638
1608
|
MysqlQueryRunner.prototype.clearTable = function (tableOrName) {
|
|
1639
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1640
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1609
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1610
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1641
1611
|
switch (_a.label) {
|
|
1642
1612
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tableOrName))];
|
|
1643
1613
|
case 1:
|
|
@@ -1653,10 +1623,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1653
1623
|
* (because it can clear all your database).
|
|
1654
1624
|
*/
|
|
1655
1625
|
MysqlQueryRunner.prototype.clearDatabase = function (database) {
|
|
1656
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1626
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1657
1627
|
var dbName, isDatabaseExist, selectViewDropsQuery, dropViewQueries, disableForeignKeysCheckQuery, dropTablesQuery, enableForeignKeysCheckQuery, dropQueries, error_2, rollbackError_1;
|
|
1658
1628
|
var _this = this;
|
|
1659
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1629
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1660
1630
|
switch (_a.label) {
|
|
1661
1631
|
case 0:
|
|
1662
1632
|
dbName = database ? database : this.driver.database;
|
|
@@ -1722,10 +1692,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1722
1692
|
// Protected Methods
|
|
1723
1693
|
// -------------------------------------------------------------------------
|
|
1724
1694
|
MysqlQueryRunner.prototype.loadViews = function (viewNames) {
|
|
1725
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1695
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1726
1696
|
var hasTable, currentDatabase, viewsCondition, query, dbViews;
|
|
1727
1697
|
var _this = this;
|
|
1728
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1698
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1729
1699
|
switch (_a.label) {
|
|
1730
1700
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
1731
1701
|
case 1:
|
|
@@ -1767,10 +1737,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1767
1737
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
1768
1738
|
*/
|
|
1769
1739
|
MysqlQueryRunner.prototype.loadTables = function (tableNames) {
|
|
1770
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1740
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
1771
1741
|
var currentDatabase, dbTables, tablesSql, _a, _b, _c, _d, tablesSql, _e, _f, _g, _h, statsSubquerySql, kcuSubquerySql, rcSubquerySql, columnsSql, collationsSql, primaryKeySql, indicesSql, foreignKeysSql, _j, dbColumns, dbPrimaryKeys, dbCollations, dbIndices, dbForeignKeys, isMariaDb, dbVersion;
|
|
1772
1742
|
var _this = this;
|
|
1773
|
-
return tslib_1.__generator(this, function (_k) {
|
|
1743
|
+
return (0, tslib_1.__generator)(this, function (_k) {
|
|
1774
1744
|
switch (_k.label) {
|
|
1775
1745
|
case 0:
|
|
1776
1746
|
if (tableNames && tableNames.length === 0) {
|
|
@@ -1787,7 +1757,7 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1787
1757
|
_d = [[]];
|
|
1788
1758
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
1789
1759
|
case 2:
|
|
1790
|
-
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
1760
|
+
_b.apply(_a, _c.concat([tslib_1.__spreadArray.apply(void 0, _d.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
1791
1761
|
return [3 /*break*/, 5];
|
|
1792
1762
|
case 3:
|
|
1793
1763
|
tablesSql = tableNames
|
|
@@ -1804,7 +1774,7 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1804
1774
|
_h = [[]];
|
|
1805
1775
|
return [4 /*yield*/, this.query(tablesSql)];
|
|
1806
1776
|
case 4:
|
|
1807
|
-
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()])]))]));
|
|
1777
|
+
_f.apply(_e, _g.concat([tslib_1.__spreadArray.apply(void 0, _h.concat([tslib_1.__read.apply(void 0, [_k.sent()]), false]))]));
|
|
1808
1778
|
_k.label = 5;
|
|
1809
1779
|
case 5:
|
|
1810
1780
|
// if tables were not found in the db, no need to proceed
|
|
@@ -1844,10 +1814,10 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
1844
1814
|
case 7:
|
|
1845
1815
|
dbVersion = _k.sent();
|
|
1846
1816
|
// create tables for loaded tables
|
|
1847
|
-
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
1817
|
+
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
1848
1818
|
var table, dbCollation, defaultCollation, defaultCharset, db, tableForeignKeyConstraints, tableIndexConstraints;
|
|
1849
1819
|
var _this = this;
|
|
1850
|
-
return tslib_1.__generator(this, function (_a) {
|
|
1820
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
1851
1821
|
table = new Table_1.Table();
|
|
1852
1822
|
dbCollation = dbCollations.find(function (coll) { return coll["SCHEMA_NAME"] === dbTable["TABLE_SCHEMA"]; });
|
|
1853
1823
|
defaultCollation = dbCollation["COLLATION"];
|
|
@@ -2087,15 +2057,15 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
2087
2057
|
}
|
|
2088
2058
|
};
|
|
2089
2059
|
MysqlQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2090
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2060
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2091
2061
|
var currentDatabase, expression, _a, query, parameters;
|
|
2092
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2062
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2093
2063
|
switch (_b.label) {
|
|
2094
2064
|
case 0: return [4 /*yield*/, this.getCurrentDatabase()];
|
|
2095
2065
|
case 1:
|
|
2096
2066
|
currentDatabase = _b.sent();
|
|
2097
2067
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2098
|
-
_a = tslib_1.__read(this.connection.createQueryBuilder()
|
|
2068
|
+
_a = (0, tslib_1.__read)(this.connection.createQueryBuilder()
|
|
2099
2069
|
.insert()
|
|
2100
2070
|
.into(this.getTypeormMetadataTableName())
|
|
2101
2071
|
.values({ type: "VIEW", schema: currentDatabase, name: view.name, value: expression })
|
|
@@ -2115,16 +2085,16 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
2115
2085
|
* Builds remove view sql.
|
|
2116
2086
|
*/
|
|
2117
2087
|
MysqlQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
|
|
2118
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2088
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2119
2089
|
var currentDatabase, viewName, qb, _a, query, parameters;
|
|
2120
|
-
return tslib_1.__generator(this, function (_b) {
|
|
2090
|
+
return (0, tslib_1.__generator)(this, function (_b) {
|
|
2121
2091
|
switch (_b.label) {
|
|
2122
2092
|
case 0: return [4 /*yield*/, this.getCurrentDatabase()];
|
|
2123
2093
|
case 1:
|
|
2124
2094
|
currentDatabase = _b.sent();
|
|
2125
2095
|
viewName = viewOrPath instanceof View_1.View ? viewOrPath.name : viewOrPath;
|
|
2126
2096
|
qb = this.connection.createQueryBuilder();
|
|
2127
|
-
_a = tslib_1.__read(qb.delete()
|
|
2097
|
+
_a = (0, tslib_1.__read)(qb.delete()
|
|
2128
2098
|
.from(this.getTypeormMetadataTableName())
|
|
2129
2099
|
.where(qb.escape("type") + " = 'VIEW'")
|
|
2130
2100
|
.andWhere(qb.escape("schema") + " = :schema", { schema: currentDatabase })
|
|
@@ -2264,9 +2234,9 @@ var MysqlQueryRunner = /** @class */ (function (_super) {
|
|
|
2264
2234
|
return c;
|
|
2265
2235
|
};
|
|
2266
2236
|
MysqlQueryRunner.prototype.getVersion = function () {
|
|
2267
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2237
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
2268
2238
|
var result;
|
|
2269
|
-
return tslib_1.__generator(this, function (_a) {
|
|
2239
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
2270
2240
|
switch (_a.label) {
|
|
2271
2241
|
case 0: return [4 /*yield*/, this.query("SELECT VERSION() AS `version`")];
|
|
2272
2242
|
case 1:
|