typeorm 0.2.24 → 0.2.28
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 +12 -8
- package/browser/cache/DbQueryResultCache.js +14 -14
- package/browser/cache/DbQueryResultCache.js.map +1 -1
- package/browser/cache/RedisQueryResultCache.js +20 -15
- package/browser/cache/RedisQueryResultCache.js.map +1 -1
- package/browser/common/DeepPartial.d.ts +1 -1
- package/browser/common/DeepPartial.js.map +1 -1
- package/browser/common/EntityTarget.d.ts +9 -0
- package/browser/common/EntityTarget.js +3 -0
- package/browser/common/EntityTarget.js.map +1 -0
- package/browser/connection/Connection.d.ts +11 -10
- package/browser/connection/Connection.js +66 -42
- package/browser/connection/Connection.js.map +1 -1
- package/browser/connection/ConnectionMetadataBuilder.js +8 -8
- package/browser/connection/ConnectionMetadataBuilder.js.map +1 -1
- package/browser/connection/ConnectionOptions.d.ts +3 -1
- package/browser/connection/ConnectionOptions.js.map +1 -1
- package/browser/connection/ConnectionOptionsReader.js +47 -42
- package/browser/connection/ConnectionOptionsReader.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsEnvReader.d.ts +5 -1
- package/browser/connection/options-reader/ConnectionOptionsEnvReader.js +45 -31
- package/browser/connection/options-reader/ConnectionOptionsEnvReader.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsXmlReader.js +4 -4
- package/browser/connection/options-reader/ConnectionOptionsXmlReader.js.map +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.d.ts +1 -1
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js +15 -4
- package/browser/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/browser/decorator/Check.d.ts +2 -2
- package/browser/decorator/Check.js.map +1 -1
- package/browser/decorator/EntityRepository.d.ts +1 -1
- package/browser/decorator/EntityRepository.js.map +1 -1
- package/browser/decorator/Exclusion.d.ts +2 -2
- package/browser/decorator/Exclusion.js.map +1 -1
- package/browser/decorator/Generated.d.ts +1 -1
- package/browser/decorator/Generated.js.map +1 -1
- package/browser/decorator/Index.d.ts +7 -7
- package/browser/decorator/Index.js.map +1 -1
- package/browser/decorator/Unique.d.ts +4 -4
- package/browser/decorator/Unique.js +12 -1
- package/browser/decorator/Unique.js.map +1 -1
- package/browser/decorator/columns/Column.d.ts +12 -12
- package/browser/decorator/columns/Column.js.map +1 -1
- package/browser/decorator/columns/CreateDateColumn.d.ts +1 -1
- package/browser/decorator/columns/CreateDateColumn.js.map +1 -1
- package/browser/decorator/columns/DeleteDateColumn.d.ts +1 -1
- package/browser/decorator/columns/DeleteDateColumn.js.map +1 -1
- package/browser/decorator/columns/ObjectIdColumn.d.ts +1 -1
- package/browser/decorator/columns/ObjectIdColumn.js.map +1 -1
- package/browser/decorator/columns/PrimaryColumn.d.ts +2 -2
- package/browser/decorator/columns/PrimaryColumn.js.map +1 -1
- package/browser/decorator/columns/PrimaryGeneratedColumn.d.ts +5 -5
- package/browser/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/browser/decorator/columns/UpdateDateColumn.d.ts +1 -1
- package/browser/decorator/columns/UpdateDateColumn.js.map +1 -1
- package/browser/decorator/columns/VersionColumn.d.ts +1 -1
- package/browser/decorator/columns/VersionColumn.js.map +1 -1
- package/browser/decorator/columns/ViewColumn.d.ts +2 -1
- package/browser/decorator/columns/ViewColumn.js +2 -2
- package/browser/decorator/columns/ViewColumn.js.map +1 -1
- package/browser/decorator/entity/ChildEntity.d.ts +1 -1
- package/browser/decorator/entity/ChildEntity.js.map +1 -1
- package/browser/decorator/entity/Entity.d.ts +2 -2
- package/browser/decorator/entity/Entity.js.map +1 -1
- package/browser/decorator/entity/TableInheritance.d.ts +1 -1
- package/browser/decorator/entity/TableInheritance.js.map +1 -1
- package/browser/decorator/entity-view/ViewEntity.d.ts +2 -2
- package/browser/decorator/entity-view/ViewEntity.js.map +1 -1
- package/browser/decorator/listeners/AfterInsert.d.ts +1 -1
- package/browser/decorator/listeners/AfterInsert.js.map +1 -1
- package/browser/decorator/listeners/AfterLoad.d.ts +1 -1
- package/browser/decorator/listeners/AfterLoad.js.map +1 -1
- package/browser/decorator/listeners/AfterRemove.d.ts +1 -1
- package/browser/decorator/listeners/AfterRemove.js.map +1 -1
- package/browser/decorator/listeners/AfterUpdate.d.ts +1 -1
- package/browser/decorator/listeners/AfterUpdate.js.map +1 -1
- package/browser/decorator/listeners/BeforeInsert.d.ts +1 -1
- package/browser/decorator/listeners/BeforeInsert.js.map +1 -1
- package/browser/decorator/listeners/BeforeRemove.d.ts +1 -1
- package/browser/decorator/listeners/BeforeRemove.js.map +1 -1
- package/browser/decorator/listeners/BeforeUpdate.d.ts +1 -1
- package/browser/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/browser/decorator/listeners/EventSubscriber.d.ts +1 -1
- package/browser/decorator/listeners/EventSubscriber.js.map +1 -1
- package/browser/decorator/options/ColumnOptions.js.map +1 -1
- package/browser/decorator/options/TransactionOptions.js.map +1 -1
- package/browser/decorator/options/ViewColumnOptions.d.ts +9 -0
- package/browser/decorator/options/ViewColumnOptions.js +3 -0
- package/browser/decorator/options/ViewColumnOptions.js.map +1 -0
- package/browser/decorator/relations/JoinColumn.d.ts +3 -3
- package/browser/decorator/relations/JoinColumn.js.map +1 -1
- package/browser/decorator/relations/JoinTable.d.ts +3 -3
- package/browser/decorator/relations/JoinTable.js.map +1 -1
- package/browser/decorator/relations/ManyToMany.d.ts +2 -2
- package/browser/decorator/relations/ManyToMany.js.map +1 -1
- package/browser/decorator/relations/ManyToOne.d.ts +2 -2
- package/browser/decorator/relations/ManyToOne.js.map +1 -1
- package/browser/decorator/relations/OneToMany.d.ts +3 -3
- package/browser/decorator/relations/OneToMany.js +2 -2
- package/browser/decorator/relations/OneToMany.js.map +1 -1
- package/browser/decorator/relations/OneToOne.d.ts +2 -2
- package/browser/decorator/relations/OneToOne.js.map +1 -1
- package/browser/decorator/relations/RelationCount.d.ts +1 -1
- package/browser/decorator/relations/RelationCount.js.map +1 -1
- package/browser/decorator/relations/RelationId.d.ts +1 -1
- package/browser/decorator/relations/RelationId.js.map +1 -1
- package/browser/decorator/transaction/Transaction.js +4 -4
- package/browser/decorator/transaction/Transaction.js.map +1 -1
- package/browser/decorator/transaction/TransactionManager.d.ts +1 -1
- package/browser/decorator/transaction/TransactionManager.js.map +1 -1
- package/browser/decorator/tree/Tree.d.ts +1 -1
- package/browser/decorator/tree/Tree.js.map +1 -1
- package/browser/decorator/tree/TreeChildren.d.ts +1 -1
- package/browser/decorator/tree/TreeChildren.js.map +1 -1
- package/browser/decorator/tree/TreeLevelColumn.d.ts +1 -1
- package/browser/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/browser/decorator/tree/TreeParent.d.ts +1 -1
- package/browser/decorator/tree/TreeParent.js.map +1 -1
- package/browser/driver/Driver.d.ts +7 -2
- package/browser/driver/Driver.js.map +1 -1
- package/browser/driver/DriverFactory.js +6 -0
- package/browser/driver/DriverFactory.js.map +1 -1
- package/browser/driver/DriverUtils.d.ts +2 -2
- package/browser/driver/DriverUtils.js +8 -4
- package/browser/driver/DriverUtils.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiConnection.d.ts +2 -1
- package/browser/driver/aurora-data-api/AuroraDataApiConnection.js +2 -3
- package/browser/driver/aurora-data-api/AuroraDataApiConnection.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +6 -0
- package/browser/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.d.ts +6 -1
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js +14 -9
- package/browser/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.d.ts +5 -0
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +230 -143
- package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +27 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js +3 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.d.ts +57 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +99 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.d.ts +51 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +142 -0
- package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +50 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js +3 -0
- package/browser/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -0
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.d.ts +46 -0
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js +125 -0
- package/browser/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -0
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.d.ts +22 -0
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js +113 -0
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -0
- package/browser/driver/cockroachdb/CockroachConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachDriver.d.ts +6 -1
- package/browser/driver/cockroachdb/CockroachDriver.js +18 -13
- package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.d.ts +3 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +420 -192
- package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/browser/driver/cordova/CordovaDriver.d.ts +2 -1
- package/browser/driver/cordova/CordovaDriver.js +4 -5
- package/browser/driver/cordova/CordovaDriver.js.map +1 -1
- package/browser/driver/cordova/CordovaQueryRunner.js +4 -4
- package/browser/driver/cordova/CordovaQueryRunner.js.map +1 -1
- package/browser/driver/expo/ExpoDriver.d.ts +2 -1
- package/browser/driver/expo/ExpoDriver.js +5 -5
- package/browser/driver/expo/ExpoDriver.js.map +1 -1
- package/browser/driver/expo/ExpoQueryRunner.js +10 -10
- package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/MongoDriver.d.ts +6 -1
- package/browser/driver/mongodb/MongoDriver.js +9 -4
- package/browser/driver/mongodb/MongoDriver.js.map +1 -1
- package/browser/driver/mongodb/MongoQueryRunner.d.ts +1 -0
- package/browser/driver/mongodb/MongoQueryRunner.js +175 -175
- package/browser/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/typings.d.ts +4 -1
- package/browser/driver/mongodb/typings.js.map +1 -1
- package/browser/driver/mysql/MysqlDriver.d.ts +7 -2
- package/browser/driver/mysql/MysqlDriver.js +16 -9
- package/browser/driver/mysql/MysqlDriver.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.d.ts +7 -1
- package/browser/driver/mysql/MysqlQueryRunner.js +246 -149
- package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/browser/driver/nativescript/NativescriptDriver.d.ts +2 -1
- package/browser/driver/nativescript/NativescriptDriver.js +4 -5
- package/browser/driver/nativescript/NativescriptDriver.js.map +1 -1
- package/browser/driver/nativescript/NativescriptQueryRunner.js +2 -2
- package/browser/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
- package/browser/driver/oracle/OracleDriver.d.ts +6 -1
- package/browser/driver/oracle/OracleDriver.js +17 -12
- package/browser/driver/oracle/OracleDriver.js.map +1 -1
- package/browser/driver/oracle/OracleQueryRunner.d.ts +3 -1
- package/browser/driver/oracle/OracleQueryRunner.js +195 -128
- package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/postgres/PostgresConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresConnectionOptions.d.ts +9 -0
- package/browser/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/browser/driver/postgres/PostgresDriver.d.ts +19 -4
- package/browser/driver/postgres/PostgresDriver.js +194 -124
- package/browser/driver/postgres/PostgresDriver.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.d.ts +3 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +416 -196
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/react-native/ReactNativeDriver.d.ts +2 -1
- package/browser/driver/react-native/ReactNativeDriver.js +6 -6
- package/browser/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/browser/driver/react-native/ReactNativeQueryRunner.js +4 -4
- package/browser/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
- package/browser/driver/sap/SapConnectionCredentialsOptions.d.ts +1 -1
- package/browser/driver/sap/SapConnectionCredentialsOptions.js.map +1 -1
- package/browser/driver/sap/SapDriver.d.ts +6 -1
- package/browser/driver/sap/SapDriver.js +25 -15
- package/browser/driver/sap/SapDriver.js.map +1 -1
- package/browser/driver/sap/SapQueryRunner.d.ts +3 -1
- package/browser/driver/sap/SapQueryRunner.js +224 -156
- package/browser/driver/sap/SapQueryRunner.js.map +1 -1
- package/browser/driver/sqlite/SqliteConnectionOptions.d.ts +18 -0
- package/browser/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/browser/driver/sqlite/SqliteDriver.d.ts +2 -1
- package/browser/driver/sqlite/SqliteDriver.js +30 -18
- package/browser/driver/sqlite/SqliteDriver.js.map +1 -1
- package/browser/driver/sqlite/SqliteQueryRunner.js +33 -18
- package/browser/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteDriver.d.ts +7 -2
- package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js +36 -9
- package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.d.ts +1 -0
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +134 -120
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/browser/driver/sqljs/SqljsDriver.d.ts +2 -1
- package/browser/driver/sqljs/SqljsDriver.js +15 -16
- package/browser/driver/sqljs/SqljsDriver.js.map +1 -1
- package/browser/driver/sqljs/SqljsQueryRunner.js +11 -7
- package/browser/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerDriver.d.ts +6 -1
- package/browser/driver/sqlserver/SqlServerDriver.js +13 -8
- package/browser/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.d.ts +3 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.js +237 -170
- package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/browser/driver/types/ColumnTypes.d.ts +1 -1
- package/browser/driver/types/ColumnTypes.js.map +1 -1
- package/browser/driver/types/DatabaseType.d.ts +1 -1
- package/browser/driver/types/DatabaseType.js.map +1 -1
- package/browser/driver/types/ReplicationMode.d.ts +1 -0
- package/browser/driver/types/ReplicationMode.js +3 -0
- package/browser/driver/types/ReplicationMode.js.map +1 -0
- package/browser/entity-manager/EntityManager.d.ts +42 -257
- package/browser/entity-manager/EntityManager.js +39 -39
- package/browser/entity-manager/EntityManager.js.map +1 -1
- package/browser/entity-manager/MongoEntityManager.d.ts +46 -46
- package/browser/entity-manager/MongoEntityManager.js +17 -17
- package/browser/entity-manager/MongoEntityManager.js.map +1 -1
- package/browser/entity-manager/SqljsEntityManager.js +6 -6
- package/browser/entity-manager/SqljsEntityManager.js.map +1 -1
- package/browser/entity-schema/EntitySchemaColumnOptions.js.map +1 -1
- package/browser/entity-schema/EntitySchemaRelationOptions.d.ts +1 -1
- package/browser/entity-schema/EntitySchemaRelationOptions.js.map +1 -1
- package/browser/entity-schema/EntitySchemaTransformer.js +22 -7
- package/browser/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/browser/error/AlreadyHasActiveConnectionError.js +2 -2
- package/browser/error/AlreadyHasActiveConnectionError.js.map +1 -1
- package/browser/error/CannotAttachTreeChildrenEntityError.js +2 -2
- package/browser/error/CannotAttachTreeChildrenEntityError.js.map +1 -1
- package/browser/error/CannotConnectAlreadyConnectedError.js +2 -2
- package/browser/error/CannotConnectAlreadyConnectedError.js.map +1 -1
- package/browser/error/CannotCreateEntityIdMapError.js +2 -2
- package/browser/error/CannotCreateEntityIdMapError.js.map +1 -1
- package/browser/error/CannotDetermineEntityError.js +2 -2
- package/browser/error/CannotDetermineEntityError.js.map +1 -1
- package/browser/error/CannotExecuteNotConnectedError.js +2 -2
- package/browser/error/CannotExecuteNotConnectedError.js.map +1 -1
- package/browser/error/CannotGetEntityManagerNotConnectedError.js +2 -2
- package/browser/error/CannotGetEntityManagerNotConnectedError.js.map +1 -1
- package/browser/error/CannotReflectMethodParameterTypeError.js +2 -2
- package/browser/error/CannotReflectMethodParameterTypeError.js.map +1 -1
- package/browser/error/CircularRelationsError.js +2 -2
- package/browser/error/CircularRelationsError.js.map +1 -1
- package/browser/error/ColumnTypeUndefinedError.js +2 -2
- package/browser/error/ColumnTypeUndefinedError.js.map +1 -1
- package/browser/error/ConnectionIsNotSetError.js +2 -2
- package/browser/error/ConnectionIsNotSetError.js.map +1 -1
- package/browser/error/ConnectionNotFoundError.js +2 -2
- package/browser/error/ConnectionNotFoundError.js.map +1 -1
- package/browser/error/CustomRepositoryCannotInheritRepositoryError.js +2 -2
- package/browser/error/CustomRepositoryCannotInheritRepositoryError.js.map +1 -1
- package/browser/error/CustomRepositoryDoesNotHaveEntityError.js +2 -2
- package/browser/error/CustomRepositoryDoesNotHaveEntityError.js.map +1 -1
- package/browser/error/CustomRepositoryNotFoundError.js +2 -2
- package/browser/error/CustomRepositoryNotFoundError.js.map +1 -1
- package/browser/error/DataTypeNotSupportedError.js +2 -2
- package/browser/error/DataTypeNotSupportedError.js.map +1 -1
- package/browser/error/DriverOptionNotSetError.js +2 -2
- package/browser/error/DriverOptionNotSetError.js.map +1 -1
- package/browser/error/DriverPackageNotInstalledError.js +2 -2
- package/browser/error/DriverPackageNotInstalledError.js.map +1 -1
- package/browser/error/EntityColumnNotFound.js +2 -2
- package/browser/error/EntityColumnNotFound.js.map +1 -1
- package/browser/error/EntityMetadataNotFoundError.d.ts +2 -2
- package/browser/error/EntityMetadataNotFoundError.js +5 -2
- package/browser/error/EntityMetadataNotFoundError.js.map +1 -1
- package/browser/error/EntityNotFoundError.d.ts +2 -3
- package/browser/error/EntityNotFoundError.js +5 -2
- package/browser/error/EntityNotFoundError.js.map +1 -1
- package/browser/error/FindRelationsNotFoundError.js +4 -4
- package/browser/error/FindRelationsNotFoundError.js.map +1 -1
- package/browser/error/InitializedRelationError.js +2 -2
- package/browser/error/InitializedRelationError.js.map +1 -1
- package/browser/error/InsertValuesMissingError.js +2 -2
- package/browser/error/InsertValuesMissingError.js.map +1 -1
- package/browser/error/LimitOnUpdateNotSupportedError.js +2 -2
- package/browser/error/LimitOnUpdateNotSupportedError.js.map +1 -1
- package/browser/error/LockNotSupportedOnGivenDriverError.js +2 -2
- package/browser/error/LockNotSupportedOnGivenDriverError.js.map +1 -1
- package/browser/error/MetadataAlreadyExistsError.js +2 -2
- package/browser/error/MetadataAlreadyExistsError.js.map +1 -1
- package/browser/error/MetadataWithSuchNameAlreadyExistsError.js +2 -2
- package/browser/error/MetadataWithSuchNameAlreadyExistsError.js.map +1 -1
- package/browser/error/MissingDeleteDateColumnError.js +2 -2
- package/browser/error/MissingDeleteDateColumnError.js.map +1 -1
- package/browser/error/MissingDriverError.js +3 -3
- package/browser/error/MissingDriverError.js.map +1 -1
- package/browser/error/MissingJoinColumnError.js +2 -2
- package/browser/error/MissingJoinColumnError.js.map +1 -1
- package/browser/error/MissingJoinTableError.js +2 -2
- package/browser/error/MissingJoinTableError.js.map +1 -1
- package/browser/error/MissingPrimaryColumnError.js +2 -2
- package/browser/error/MissingPrimaryColumnError.js.map +1 -1
- package/browser/error/MustBeEntityError.js +2 -2
- package/browser/error/MustBeEntityError.js.map +1 -1
- package/browser/error/NamingStrategyNotFoundError.js +2 -2
- package/browser/error/NamingStrategyNotFoundError.js.map +1 -1
- package/browser/error/NoConnectionForRepositoryError.js +2 -2
- package/browser/error/NoConnectionForRepositoryError.js.map +1 -1
- package/browser/error/NoConnectionOptionError.js +2 -2
- package/browser/error/NoConnectionOptionError.js.map +1 -1
- package/browser/error/NoNeedToReleaseEntityManagerError.js +2 -2
- package/browser/error/NoNeedToReleaseEntityManagerError.js.map +1 -1
- package/browser/error/NoVersionOrUpdateDateColumnError.js +2 -2
- package/browser/error/NoVersionOrUpdateDateColumnError.js.map +1 -1
- package/browser/error/OffsetWithoutLimitNotSupportedError.js +2 -2
- package/browser/error/OffsetWithoutLimitNotSupportedError.js.map +1 -1
- package/browser/error/OptimisticLockCanNotBeUsedError.js +2 -2
- package/browser/error/OptimisticLockCanNotBeUsedError.js.map +1 -1
- package/browser/error/OptimisticLockVersionMismatchError.js +2 -2
- package/browser/error/OptimisticLockVersionMismatchError.js.map +1 -1
- package/browser/error/PersistedEntityNotFoundError.js +2 -2
- package/browser/error/PersistedEntityNotFoundError.js.map +1 -1
- package/browser/error/PessimisticLockTransactionRequiredError.js +2 -2
- package/browser/error/PessimisticLockTransactionRequiredError.js.map +1 -1
- package/browser/error/PrimaryColumnCannotBeNullableError.js +2 -2
- package/browser/error/PrimaryColumnCannotBeNullableError.js.map +1 -1
- package/browser/error/QueryFailedError.js +3 -3
- package/browser/error/QueryFailedError.js.map +1 -1
- package/browser/error/QueryRunnerAlreadyReleasedError.js +2 -2
- package/browser/error/QueryRunnerAlreadyReleasedError.js.map +1 -1
- package/browser/error/QueryRunnerProviderAlreadyReleasedError.js +2 -2
- package/browser/error/QueryRunnerProviderAlreadyReleasedError.js.map +1 -1
- package/browser/error/RepositoryNotFoundError.d.ts +2 -2
- package/browser/error/RepositoryNotFoundError.js +5 -2
- package/browser/error/RepositoryNotFoundError.js.map +1 -1
- package/browser/error/RepositoryNotTreeError.d.ts +2 -2
- package/browser/error/RepositoryNotTreeError.js +11 -8
- package/browser/error/RepositoryNotTreeError.js.map +1 -1
- package/browser/error/ReturningStatementNotSupportedError.js +2 -2
- package/browser/error/ReturningStatementNotSupportedError.js.map +1 -1
- package/browser/error/SubjectRemovedAndUpdatedError.js +2 -2
- package/browser/error/SubjectRemovedAndUpdatedError.js.map +1 -1
- package/browser/error/SubjectWithoutIdentifierError.js +2 -2
- package/browser/error/SubjectWithoutIdentifierError.js.map +1 -1
- package/browser/error/TransactionAlreadyStartedError.js +2 -2
- package/browser/error/TransactionAlreadyStartedError.js.map +1 -1
- package/browser/error/TransactionNotStartedError.js +2 -2
- package/browser/error/TransactionNotStartedError.js.map +1 -1
- package/browser/error/TreeRepositoryNotSupportedError.js +2 -2
- package/browser/error/TreeRepositoryNotSupportedError.js.map +1 -1
- package/browser/error/UpdateValuesMissingError.js +2 -2
- package/browser/error/UpdateValuesMissingError.js.map +1 -1
- package/browser/error/UsingJoinColumnIsNotAllowedError.js +2 -2
- package/browser/error/UsingJoinColumnIsNotAllowedError.js.map +1 -1
- package/browser/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +2 -2
- package/browser/error/UsingJoinColumnOnlyOnOneSideAllowedError.js.map +1 -1
- package/browser/error/UsingJoinTableIsNotAllowedError.js +2 -2
- package/browser/error/UsingJoinTableIsNotAllowedError.js.map +1 -1
- package/browser/error/UsingJoinTableOnlyOnOneSideAllowedError.js +2 -2
- package/browser/error/UsingJoinTableOnlyOnOneSideAllowedError.js.map +1 -1
- package/browser/find-options/FindOneOptions.d.ts +2 -2
- package/browser/find-options/FindOneOptions.js.map +1 -1
- package/browser/find-options/FindOperator.d.ts +6 -3
- package/browser/find-options/FindOperator.js +22 -45
- package/browser/find-options/FindOperator.js.map +1 -1
- package/browser/find-options/FindOptionsUtils.d.ts +2 -2
- package/browser/find-options/FindOptionsUtils.js +1 -1
- package/browser/find-options/FindOptionsUtils.js.map +1 -1
- package/browser/find-options/operator/Any.d.ts +1 -1
- package/browser/find-options/operator/Any.js.map +1 -1
- package/browser/find-options/operator/Between.d.ts +1 -1
- package/browser/find-options/operator/Between.js.map +1 -1
- package/browser/find-options/operator/In.d.ts +1 -1
- package/browser/find-options/operator/In.js.map +1 -1
- package/browser/find-options/operator/Raw.d.ts +1 -1
- package/browser/find-options/operator/Raw.js.map +1 -1
- package/browser/index.d.ts +8 -11
- package/browser/index.js +8 -15
- package/browser/index.js.map +1 -1
- package/browser/logger/DebugLogger.d.ts +0 -1
- package/browser/logger/DebugLogger.js +9 -9
- package/browser/logger/DebugLogger.js.map +1 -1
- package/browser/logger/FileLogger.d.ts +3 -1
- package/browser/logger/FileLogger.js +9 -3
- package/browser/logger/FileLogger.js.map +1 -1
- package/browser/logger/LoggerOptions.d.ts +9 -0
- package/browser/logger/LoggerOptions.js.map +1 -1
- package/browser/metadata/ColumnMetadata.js +15 -16
- package/browser/metadata/ColumnMetadata.js.map +1 -1
- package/browser/metadata/EmbeddedMetadata.js +2 -2
- package/browser/metadata/EmbeddedMetadata.js.map +1 -1
- package/browser/metadata/EntityMetadata.d.ts +1 -5
- package/browser/metadata/EntityMetadata.js +15 -16
- package/browser/metadata/EntityMetadata.js.map +1 -1
- package/browser/metadata/RelationMetadata.js +12 -12
- package/browser/metadata/RelationMetadata.js.map +1 -1
- package/browser/metadata-args/EntityRepositoryMetadataArgs.d.ts +2 -2
- package/browser/metadata-args/EntityRepositoryMetadataArgs.js.map +1 -1
- package/browser/metadata-args/RelationCountMetadataArgs.js.map +1 -1
- package/browser/metadata-args/RelationIdMetadataArgs.js.map +1 -1
- package/browser/metadata-builder/EntityMetadataBuilder.js +14 -12
- package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js +3 -2
- package/browser/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/browser/migration/MigrationExecutor.js +132 -103
- package/browser/migration/MigrationExecutor.js.map +1 -1
- package/browser/naming-strategy/DefaultNamingStrategy.d.ts +5 -0
- package/browser/naming-strategy/DefaultNamingStrategy.js +8 -6
- package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/browser/naming-strategy/NamingStrategyInterface.d.ts +11 -0
- package/browser/naming-strategy/NamingStrategyInterface.js.map +1 -1
- package/browser/persistence/EntityPersistExecutor.js +64 -46
- package/browser/persistence/EntityPersistExecutor.js.map +1 -1
- package/browser/persistence/Subject.js +2 -2
- package/browser/persistence/Subject.js.map +1 -1
- package/browser/persistence/SubjectChangedColumnsComputer.js +11 -7
- package/browser/persistence/SubjectChangedColumnsComputer.js.map +1 -1
- package/browser/persistence/SubjectDatabaseEntityLoader.js +9 -8
- package/browser/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/browser/persistence/SubjectExecutor.js +263 -206
- package/browser/persistence/SubjectExecutor.js.map +1 -1
- package/browser/persistence/SubjectTopoligicalSorter.js +6 -6
- package/browser/persistence/SubjectTopoligicalSorter.js.map +1 -1
- package/browser/persistence/subject-builder/CascadesSubjectBuilder.js +2 -2
- package/browser/persistence/subject-builder/CascadesSubjectBuilder.js.map +1 -1
- package/browser/persistence/subject-builder/ManyToManySubjectBuilder.js +2 -3
- package/browser/persistence/subject-builder/ManyToManySubjectBuilder.js.map +1 -1
- package/browser/persistence/subject-builder/OneToManySubjectBuilder.js +1 -1
- package/browser/persistence/subject-builder/OneToManySubjectBuilder.js.map +1 -1
- package/browser/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js +1 -1
- package/browser/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js.map +1 -1
- package/browser/persistence/tree/ClosureSubjectExecutor.js +4 -4
- package/browser/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
- package/browser/persistence/tree/MaterializedPathSubjectExecutor.js +5 -4
- package/browser/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/browser/persistence/tree/NestedSetSubjectExecutor.js +3 -3
- package/browser/platform/BrowserConnectionOptionsReaderDummy.d.ts +38 -0
- package/browser/platform/BrowserConnectionOptionsReaderDummy.js +93 -0
- package/browser/platform/BrowserConnectionOptionsReaderDummy.js.map +1 -0
- package/browser/platform/BrowserDirectoryExportedClassesLoader.d.ts +15 -0
- package/browser/platform/BrowserDirectoryExportedClassesLoader.js +22 -0
- package/browser/platform/BrowserDirectoryExportedClassesLoader.js.map +1 -0
- package/browser/platform/BrowserDisabledDriversDummy.d.ts +32 -2
- package/browser/platform/BrowserDisabledDriversDummy.js +52 -2
- package/browser/platform/BrowserDisabledDriversDummy.js.map +1 -1
- package/browser/platform/BrowserFileLoggerDummy.d.ts +33 -0
- package/browser/platform/BrowserFileLoggerDummy.js +58 -0
- package/browser/platform/BrowserFileLoggerDummy.js.map +1 -0
- package/browser/platform/BrowserPlatformTools.d.ts +74 -0
- package/browser/platform/BrowserPlatformTools.js +157 -0
- package/browser/platform/BrowserPlatformTools.js.map +1 -0
- package/browser/platform/PlatformTools.d.ts +15 -21
- package/browser/platform/PlatformTools.js +142 -81
- package/browser/platform/PlatformTools.js.map +1 -1
- package/browser/query-builder/Alias.js.map +1 -1
- package/browser/query-builder/DeleteQueryBuilder.d.ts +2 -3
- package/browser/query-builder/DeleteQueryBuilder.js +10 -5
- package/browser/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/InsertQueryBuilder.d.ts +2 -3
- package/browser/query-builder/InsertQueryBuilder.js +23 -9
- package/browser/query-builder/InsertQueryBuilder.js.map +1 -1
- package/browser/query-builder/JoinAttribute.js +2 -2
- package/browser/query-builder/JoinAttribute.js.map +1 -1
- package/browser/query-builder/QueryBuilder.d.ts +11 -15
- package/browser/query-builder/QueryBuilder.js +92 -31
- package/browser/query-builder/QueryBuilder.js.map +1 -1
- package/browser/query-builder/QueryBuilderUtils.js +2 -2
- package/browser/query-builder/QueryBuilderUtils.js.map +1 -1
- package/browser/query-builder/QueryExpressionMap.d.ts +1 -1
- package/browser/query-builder/QueryExpressionMap.js +4 -4
- package/browser/query-builder/QueryExpressionMap.js.map +1 -1
- package/browser/query-builder/QueryPartialEntity.d.ts +1 -1
- package/browser/query-builder/QueryPartialEntity.js.map +1 -1
- package/browser/query-builder/RelationIdLoader.js +5 -5
- package/browser/query-builder/RelationLoader.js +3 -3
- package/browser/query-builder/RelationLoader.js.map +1 -1
- package/browser/query-builder/RelationQueryBuilder.js +14 -14
- package/browser/query-builder/RelationQueryBuilder.js.map +1 -1
- package/browser/query-builder/RelationRemover.js +7 -7
- package/browser/query-builder/RelationRemover.js.map +1 -1
- package/browser/query-builder/RelationUpdater.js +3 -3
- package/browser/query-builder/ReturningResultsEntityUpdator.js +30 -31
- package/browser/query-builder/ReturningResultsEntityUpdator.js.map +1 -1
- package/browser/query-builder/SelectQueryBuilder.d.ts +5 -4
- package/browser/query-builder/SelectQueryBuilder.js +77 -41
- package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
- package/browser/query-builder/SoftDeleteQueryBuilder.d.ts +2 -3
- package/browser/query-builder/SoftDeleteQueryBuilder.js +7 -7
- package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/browser/query-builder/UpdateQueryBuilder.js +22 -8
- package/browser/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/browser/query-builder/relation-count/RelationCountAttribute.js +3 -3
- package/browser/query-builder/relation-count/RelationCountAttribute.js.map +1 -1
- package/browser/query-builder/relation-count/RelationCountLoader.js +5 -5
- package/browser/query-builder/relation-id/RelationIdAttribute.js +2 -2
- package/browser/query-builder/relation-id/RelationIdAttribute.js.map +1 -1
- package/browser/query-builder/relation-id/RelationIdLoader.js +6 -6
- package/browser/query-builder/relation-id/RelationIdLoader.js.map +1 -1
- package/browser/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +4 -4
- package/browser/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js.map +1 -1
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js +4 -7
- package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/browser/query-runner/BaseQueryRunner.d.ts +2 -5
- package/browser/query-runner/BaseQueryRunner.js +106 -56
- package/browser/query-runner/BaseQueryRunner.js.map +1 -1
- package/browser/query-runner/QueryRunner.d.ts +1 -0
- package/browser/repository/AbstractRepository.js.map +1 -1
- package/browser/repository/BaseEntity.d.ts +17 -1
- package/browser/repository/BaseEntity.js +24 -6
- package/browser/repository/BaseEntity.js.map +1 -1
- package/browser/repository/MongoRepository.js +2 -2
- package/browser/repository/MongoRepository.js.map +1 -1
- package/browser/repository/Repository.d.ts +1 -1
- package/browser/repository/Repository.js +4 -4
- package/browser/repository/Repository.js.map +1 -1
- package/browser/repository/TreeRepository.js +4 -4
- package/browser/repository/TreeRepository.js.map +1 -1
- package/browser/schema-builder/MongoSchemaBuilder.js +4 -4
- package/browser/schema-builder/MongoSchemaBuilder.js.map +1 -1
- package/browser/schema-builder/RdbmsSchemaBuilder.js +924 -368
- package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/browser/schema-builder/options/TableIndexOptions.d.ts +1 -1
- package/browser/schema-builder/options/TableIndexOptions.js.map +1 -1
- package/browser/schema-builder/table/TableCheck.js +2 -2
- package/browser/schema-builder/table/TableCheck.js.map +1 -1
- package/browser/schema-builder/table/TableForeignKey.js +3 -3
- package/browser/schema-builder/table/TableForeignKey.js.map +1 -1
- package/browser/schema-builder/table/TableIndex.js +2 -2
- package/browser/schema-builder/table/TableIndex.js.map +1 -1
- package/browser/schema-builder/table/TableUnique.js +2 -2
- package/browser/schema-builder/table/TableUnique.js.map +1 -1
- package/browser/schema-builder/view/View.d.ts +1 -2
- package/browser/schema-builder/view/View.js.map +1 -1
- package/browser/util/ApplyValueTransformers.js.map +1 -1
- package/browser/util/DateUtils.js +3 -3
- package/browser/util/DateUtils.js.map +1 -1
- package/browser/util/DirectoryExportedClassesLoader.js +6 -5
- package/browser/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/browser/util/ObjectUtils.js +4 -4
- package/browser/util/ObjectUtils.js.map +1 -1
- package/browser/util/OrmUtils.d.ts +4 -0
- package/browser/util/OrmUtils.js +19 -4
- package/browser/util/OrmUtils.js.map +1 -1
- package/browser/util/StringUtils.js +1 -1
- package/browser/util/StringUtils.js.map +1 -1
- package/cache/DbQueryResultCache.js +1 -1
- package/cache/DbQueryResultCache.js.map +1 -1
- package/cache/RedisQueryResultCache.js +7 -2
- package/cache/RedisQueryResultCache.js.map +1 -1
- package/cli.js +2 -1
- package/cli.js.map +1 -1
- package/commands/CacheClearCommand.js +4 -4
- package/commands/CacheClearCommand.js.map +1 -1
- package/commands/CommandUtils.d.ts +1 -1
- package/commands/CommandUtils.js +4 -4
- package/commands/CommandUtils.js.map +1 -1
- package/commands/EntityCreateCommand.js +4 -4
- package/commands/EntityCreateCommand.js.map +1 -1
- package/commands/InitCommand.js +15 -5
- package/commands/InitCommand.js.map +1 -1
- package/commands/MigrationCreateCommand.js +6 -6
- package/commands/MigrationCreateCommand.js.map +1 -1
- package/commands/MigrationGenerateCommand.d.ts +11 -1
- package/commands/MigrationGenerateCommand.js +42 -10
- package/commands/MigrationGenerateCommand.js.map +1 -1
- package/commands/MigrationRevertCommand.js +2 -2
- package/commands/MigrationRevertCommand.js.map +1 -1
- package/commands/MigrationRunCommand.js +3 -3
- package/commands/MigrationRunCommand.js.map +1 -1
- package/commands/MigrationShowCommand.js +3 -3
- package/commands/MigrationShowCommand.js.map +1 -1
- package/commands/QueryCommand.js +5 -5
- package/commands/QueryCommand.js.map +1 -1
- package/commands/SchemaDropCommand.js +3 -3
- package/commands/SchemaDropCommand.js.map +1 -1
- package/commands/SchemaLogCommand.js +6 -6
- package/commands/SchemaLogCommand.js.map +1 -1
- package/commands/SchemaSyncCommand.js +3 -3
- package/commands/SchemaSyncCommand.js.map +1 -1
- package/commands/SubscriberCreateCommand.js +3 -3
- package/commands/SubscriberCreateCommand.js.map +1 -1
- package/commands/VersionCommand.js +2 -2
- package/commands/VersionCommand.js.map +1 -1
- package/common/DeepPartial.d.ts +1 -1
- package/common/DeepPartial.js.map +1 -1
- package/common/EntityTarget.d.ts +9 -0
- package/common/EntityTarget.js +4 -0
- package/common/EntityTarget.js.map +1 -0
- package/connection/Connection.d.ts +11 -10
- package/connection/Connection.js +48 -24
- package/connection/Connection.js.map +1 -1
- package/connection/ConnectionOptions.d.ts +3 -1
- package/connection/ConnectionOptions.js.map +1 -1
- package/connection/ConnectionOptionsReader.js +38 -33
- package/connection/ConnectionOptionsReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsEnvReader.d.ts +5 -1
- package/connection/options-reader/ConnectionOptionsEnvReader.js +45 -31
- package/connection/options-reader/ConnectionOptionsEnvReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsXmlReader.js +2 -2
- package/connection/options-reader/ConnectionOptionsXmlReader.js.map +1 -1
- package/connection/options-reader/ConnectionOptionsYmlReader.d.ts +1 -1
- package/connection/options-reader/ConnectionOptionsYmlReader.js +15 -4
- package/connection/options-reader/ConnectionOptionsYmlReader.js.map +1 -1
- package/decorator/Check.d.ts +2 -2
- package/decorator/Check.js.map +1 -1
- package/decorator/EntityRepository.d.ts +1 -1
- package/decorator/EntityRepository.js.map +1 -1
- package/decorator/Exclusion.d.ts +2 -2
- package/decorator/Exclusion.js.map +1 -1
- package/decorator/Generated.d.ts +1 -1
- package/decorator/Generated.js.map +1 -1
- package/decorator/Index.d.ts +7 -7
- package/decorator/Index.js.map +1 -1
- package/decorator/Unique.d.ts +4 -4
- package/decorator/Unique.js +12 -1
- package/decorator/Unique.js.map +1 -1
- package/decorator/columns/Column.d.ts +12 -12
- package/decorator/columns/Column.js.map +1 -1
- package/decorator/columns/CreateDateColumn.d.ts +1 -1
- package/decorator/columns/CreateDateColumn.js.map +1 -1
- package/decorator/columns/DeleteDateColumn.d.ts +1 -1
- package/decorator/columns/DeleteDateColumn.js.map +1 -1
- package/decorator/columns/ObjectIdColumn.d.ts +1 -1
- package/decorator/columns/ObjectIdColumn.js.map +1 -1
- package/decorator/columns/PrimaryColumn.d.ts +2 -2
- package/decorator/columns/PrimaryColumn.js.map +1 -1
- package/decorator/columns/PrimaryGeneratedColumn.d.ts +5 -5
- package/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/decorator/columns/UpdateDateColumn.d.ts +1 -1
- package/decorator/columns/UpdateDateColumn.js.map +1 -1
- package/decorator/columns/VersionColumn.d.ts +1 -1
- package/decorator/columns/VersionColumn.js.map +1 -1
- package/decorator/columns/ViewColumn.d.ts +2 -1
- package/decorator/columns/ViewColumn.js +2 -2
- package/decorator/columns/ViewColumn.js.map +1 -1
- package/decorator/entity/ChildEntity.d.ts +1 -1
- package/decorator/entity/ChildEntity.js.map +1 -1
- package/decorator/entity/Entity.d.ts +2 -2
- package/decorator/entity/Entity.js.map +1 -1
- package/decorator/entity/TableInheritance.d.ts +1 -1
- package/decorator/entity/TableInheritance.js.map +1 -1
- package/decorator/entity-view/ViewEntity.d.ts +2 -2
- package/decorator/entity-view/ViewEntity.js.map +1 -1
- package/decorator/listeners/AfterInsert.d.ts +1 -1
- package/decorator/listeners/AfterInsert.js.map +1 -1
- package/decorator/listeners/AfterLoad.d.ts +1 -1
- package/decorator/listeners/AfterLoad.js.map +1 -1
- package/decorator/listeners/AfterRemove.d.ts +1 -1
- package/decorator/listeners/AfterRemove.js.map +1 -1
- package/decorator/listeners/AfterUpdate.d.ts +1 -1
- package/decorator/listeners/AfterUpdate.js.map +1 -1
- package/decorator/listeners/BeforeInsert.d.ts +1 -1
- package/decorator/listeners/BeforeInsert.js.map +1 -1
- package/decorator/listeners/BeforeRemove.d.ts +1 -1
- package/decorator/listeners/BeforeRemove.js.map +1 -1
- package/decorator/listeners/BeforeUpdate.d.ts +1 -1
- package/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/decorator/listeners/EventSubscriber.d.ts +1 -1
- package/decorator/listeners/EventSubscriber.js.map +1 -1
- package/decorator/options/ColumnOptions.js.map +1 -1
- package/decorator/options/TransactionOptions.js.map +1 -1
- package/decorator/options/ViewColumnOptions.d.ts +9 -0
- package/decorator/options/ViewColumnOptions.js +4 -0
- package/decorator/options/ViewColumnOptions.js.map +1 -0
- package/decorator/relations/JoinColumn.d.ts +3 -3
- package/decorator/relations/JoinColumn.js.map +1 -1
- package/decorator/relations/JoinTable.d.ts +3 -3
- package/decorator/relations/JoinTable.js.map +1 -1
- package/decorator/relations/ManyToMany.d.ts +2 -2
- package/decorator/relations/ManyToMany.js.map +1 -1
- package/decorator/relations/ManyToOne.d.ts +2 -2
- package/decorator/relations/ManyToOne.js.map +1 -1
- package/decorator/relations/OneToMany.d.ts +3 -3
- package/decorator/relations/OneToMany.js +2 -2
- package/decorator/relations/OneToMany.js.map +1 -1
- package/decorator/relations/OneToOne.d.ts +2 -2
- package/decorator/relations/OneToOne.js.map +1 -1
- package/decorator/relations/RelationCount.d.ts +1 -1
- package/decorator/relations/RelationCount.js.map +1 -1
- package/decorator/relations/RelationId.d.ts +1 -1
- package/decorator/relations/RelationId.js.map +1 -1
- package/decorator/transaction/TransactionManager.d.ts +1 -1
- package/decorator/transaction/TransactionManager.js.map +1 -1
- package/decorator/tree/Tree.d.ts +1 -1
- package/decorator/tree/Tree.js.map +1 -1
- package/decorator/tree/TreeChildren.d.ts +1 -1
- package/decorator/tree/TreeChildren.js.map +1 -1
- package/decorator/tree/TreeLevelColumn.d.ts +1 -1
- package/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/decorator/tree/TreeParent.d.ts +1 -1
- package/decorator/tree/TreeParent.js.map +1 -1
- package/driver/Driver.d.ts +7 -2
- package/driver/Driver.js.map +1 -1
- package/driver/DriverFactory.js +6 -0
- package/driver/DriverFactory.js.map +1 -1
- package/driver/DriverUtils.d.ts +2 -2
- package/driver/DriverUtils.js +6 -2
- package/driver/DriverUtils.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.d.ts +2 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js +0 -1
- package/driver/aurora-data-api/AuroraDataApiConnection.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.d.ts +6 -0
- package/driver/aurora-data-api/AuroraDataApiConnectionOptions.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiDriver.d.ts +6 -1
- package/driver/aurora-data-api/AuroraDataApiDriver.js +7 -2
- package/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.d.ts +4 -0
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +106 -19
- package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.d.ts +27 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js +4 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresConnectionOptions.js.map +1 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.d.ts +57 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js +101 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresDriver.js.map +1 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.d.ts +51 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +144 -0
- package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.d.ts +50 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js +4 -0
- package/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js.map +1 -0
- package/driver/better-sqlite3/BetterSqlite3Driver.d.ts +46 -0
- package/driver/better-sqlite3/BetterSqlite3Driver.js +127 -0
- package/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -0
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.d.ts +22 -0
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +115 -0
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -0
- package/driver/cockroachdb/CockroachConnectionCredentialsOptions.js.map +1 -1
- package/driver/cockroachdb/CockroachDriver.d.ts +6 -1
- package/driver/cockroachdb/CockroachDriver.js +6 -1
- package/driver/cockroachdb/CockroachDriver.js.map +1 -1
- package/driver/cockroachdb/CockroachQueryRunner.d.ts +2 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +303 -75
- package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/driver/cordova/CordovaDriver.d.ts +2 -1
- package/driver/cordova/CordovaDriver.js +0 -1
- package/driver/cordova/CordovaDriver.js.map +1 -1
- package/driver/expo/ExpoDriver.d.ts +2 -1
- package/driver/expo/ExpoDriver.js +1 -1
- package/driver/expo/ExpoDriver.js.map +1 -1
- package/driver/mongodb/MongoDriver.d.ts +6 -1
- package/driver/mongodb/MongoDriver.js +6 -1
- package/driver/mongodb/MongoDriver.js.map +1 -1
- package/driver/mongodb/MongoQueryRunner.js.map +1 -1
- package/driver/mongodb/typings.d.ts +4 -1
- package/driver/mongodb/typings.js.map +1 -1
- package/driver/mysql/MysqlDriver.d.ts +7 -2
- package/driver/mysql/MysqlDriver.js +10 -3
- package/driver/mysql/MysqlDriver.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.d.ts +6 -1
- package/driver/mysql/MysqlQueryRunner.js +122 -25
- package/driver/mysql/MysqlQueryRunner.js.map +1 -1
- package/driver/nativescript/NativescriptDriver.d.ts +2 -1
- package/driver/nativescript/NativescriptDriver.js +0 -1
- package/driver/nativescript/NativescriptDriver.js.map +1 -1
- package/driver/oracle/OracleDriver.d.ts +6 -1
- package/driver/oracle/OracleDriver.js +8 -3
- package/driver/oracle/OracleDriver.js.map +1 -1
- package/driver/oracle/OracleQueryRunner.d.ts +2 -1
- package/driver/oracle/OracleQueryRunner.js +87 -20
- package/driver/oracle/OracleQueryRunner.js.map +1 -1
- package/driver/postgres/PostgresConnectionCredentialsOptions.d.ts +1 -1
- package/driver/postgres/PostgresConnectionCredentialsOptions.js.map +1 -1
- package/driver/postgres/PostgresConnectionOptions.d.ts +9 -0
- package/driver/postgres/PostgresConnectionOptions.js.map +1 -1
- package/driver/postgres/PostgresDriver.d.ts +19 -4
- package/driver/postgres/PostgresDriver.js +179 -109
- package/driver/postgres/PostgresDriver.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.d.ts +2 -1
- package/driver/postgres/PostgresQueryRunner.js +288 -68
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/react-native/ReactNativeDriver.d.ts +2 -1
- package/driver/react-native/ReactNativeDriver.js +2 -2
- package/driver/react-native/ReactNativeDriver.js.map +1 -1
- package/driver/sap/SapConnectionCredentialsOptions.d.ts +1 -1
- package/driver/sap/SapConnectionCredentialsOptions.js.map +1 -1
- package/driver/sap/SapDriver.d.ts +6 -1
- package/driver/sap/SapDriver.js +19 -9
- package/driver/sap/SapDriver.js.map +1 -1
- package/driver/sap/SapQueryRunner.d.ts +2 -1
- package/driver/sap/SapQueryRunner.js +91 -23
- package/driver/sap/SapQueryRunner.js.map +1 -1
- package/driver/sqlite/SqliteConnectionOptions.d.ts +18 -0
- package/driver/sqlite/SqliteConnectionOptions.js.map +1 -1
- package/driver/sqlite/SqliteDriver.d.ts +2 -1
- package/driver/sqlite/SqliteDriver.js +24 -12
- package/driver/sqlite/SqliteDriver.js.map +1 -1
- package/driver/sqlite/SqliteQueryRunner.js +29 -14
- package/driver/sqlite/SqliteQueryRunner.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteDriver.d.ts +7 -2
- package/driver/sqlite-abstract/AbstractSqliteDriver.js +31 -4
- package/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +17 -3
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
- package/driver/sqljs/SqljsDriver.d.ts +2 -1
- package/driver/sqljs/SqljsDriver.js +1 -2
- package/driver/sqljs/SqljsDriver.js.map +1 -1
- package/driver/sqljs/SqljsQueryRunner.js +5 -1
- package/driver/sqljs/SqljsQueryRunner.js.map +1 -1
- package/driver/sqlserver/SqlServerDriver.d.ts +6 -1
- package/driver/sqlserver/SqlServerDriver.js +6 -1
- package/driver/sqlserver/SqlServerDriver.js.map +1 -1
- package/driver/sqlserver/SqlServerQueryRunner.d.ts +2 -1
- package/driver/sqlserver/SqlServerQueryRunner.js +91 -24
- package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
- package/driver/types/ColumnTypes.d.ts +1 -1
- package/driver/types/ColumnTypes.js.map +1 -1
- package/driver/types/DatabaseType.d.ts +1 -1
- package/driver/types/DatabaseType.js.map +1 -1
- package/driver/types/ReplicationMode.d.ts +1 -0
- package/driver/types/ReplicationMode.js +4 -0
- package/driver/types/ReplicationMode.js.map +1 -0
- package/entity-manager/EntityManager.d.ts +42 -257
- package/entity-manager/EntityManager.js +10 -10
- package/entity-manager/EntityManager.js.map +1 -1
- package/entity-manager/MongoEntityManager.d.ts +46 -46
- package/entity-manager/MongoEntityManager.js.map +1 -1
- package/entity-schema/EntitySchemaColumnOptions.js.map +1 -1
- package/entity-schema/EntitySchemaRelationOptions.d.ts +1 -1
- package/entity-schema/EntitySchemaRelationOptions.js.map +1 -1
- package/entity-schema/EntitySchemaTransformer.js +22 -7
- package/entity-schema/EntitySchemaTransformer.js.map +1 -1
- package/error/EntityMetadataNotFoundError.d.ts +2 -2
- package/error/EntityMetadataNotFoundError.js +3 -0
- package/error/EntityMetadataNotFoundError.js.map +1 -1
- package/error/EntityNotFoundError.d.ts +2 -3
- package/error/EntityNotFoundError.js +3 -0
- package/error/EntityNotFoundError.js.map +1 -1
- package/error/FindRelationsNotFoundError.js +2 -2
- package/error/FindRelationsNotFoundError.js.map +1 -1
- package/error/MissingDriverError.js +1 -1
- package/error/MissingDriverError.js.map +1 -1
- package/error/QueryFailedError.js +1 -1
- package/error/QueryFailedError.js.map +1 -1
- package/error/RepositoryNotFoundError.d.ts +2 -2
- package/error/RepositoryNotFoundError.js +3 -0
- package/error/RepositoryNotFoundError.js.map +1 -1
- package/error/RepositoryNotTreeError.d.ts +2 -2
- package/error/RepositoryNotTreeError.js +9 -6
- package/error/RepositoryNotTreeError.js.map +1 -1
- package/find-options/FindOneOptions.d.ts +2 -2
- package/find-options/FindOneOptions.js.map +1 -1
- package/find-options/FindOperator.d.ts +6 -3
- package/find-options/FindOperator.js +22 -45
- package/find-options/FindOperator.js.map +1 -1
- package/find-options/FindOptionsUtils.d.ts +2 -2
- package/find-options/FindOptionsUtils.js +1 -1
- package/find-options/FindOptionsUtils.js.map +1 -1
- package/find-options/operator/Any.d.ts +1 -1
- package/find-options/operator/Any.js.map +1 -1
- package/find-options/operator/Between.d.ts +1 -1
- package/find-options/operator/Between.js.map +1 -1
- package/find-options/operator/In.d.ts +1 -1
- package/find-options/operator/In.js.map +1 -1
- package/find-options/operator/Raw.d.ts +1 -1
- package/find-options/operator/Raw.js.map +1 -1
- package/index.d.ts +8 -11
- package/index.js +1 -14
- package/index.js.map +1 -1
- package/logger/DebugLogger.d.ts +0 -1
- package/logger/DebugLogger.js +10 -9
- package/logger/DebugLogger.js.map +1 -1
- package/logger/FileLogger.d.ts +3 -1
- package/logger/FileLogger.js +10 -3
- package/logger/FileLogger.js.map +1 -1
- package/logger/LoggerOptions.d.ts +9 -0
- package/logger/LoggerOptions.js.map +1 -1
- package/metadata/ColumnMetadata.js +10 -11
- package/metadata/ColumnMetadata.js.map +1 -1
- package/metadata/EntityMetadata.d.ts +1 -5
- package/metadata/EntityMetadata.js +13 -14
- package/metadata/EntityMetadata.js.map +1 -1
- package/metadata/RelationMetadata.js +7 -7
- package/metadata/RelationMetadata.js.map +1 -1
- package/metadata-args/EntityRepositoryMetadataArgs.d.ts +2 -2
- package/metadata-args/EntityRepositoryMetadataArgs.js.map +1 -1
- package/metadata-args/RelationCountMetadataArgs.js.map +1 -1
- package/metadata-args/RelationIdMetadataArgs.js.map +1 -1
- package/metadata-builder/EntityMetadataBuilder.js +8 -6
- package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
- package/metadata-builder/JunctionEntityMetadataBuilder.js +1 -0
- package/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
- package/migration/MigrationExecutor.js +103 -74
- package/migration/MigrationExecutor.js.map +1 -1
- package/naming-strategy/DefaultNamingStrategy.d.ts +5 -0
- package/naming-strategy/DefaultNamingStrategy.js +2 -0
- package/naming-strategy/DefaultNamingStrategy.js.map +1 -1
- package/naming-strategy/NamingStrategyInterface.d.ts +11 -0
- package/naming-strategy/NamingStrategyInterface.js.map +1 -1
- package/package.json +72 -51
- package/persistence/EntityPersistExecutor.js +60 -42
- package/persistence/EntityPersistExecutor.js.map +1 -1
- package/persistence/SubjectChangedColumnsComputer.js +11 -7
- package/persistence/SubjectChangedColumnsComputer.js.map +1 -1
- package/persistence/SubjectDatabaseEntityLoader.js +2 -1
- package/persistence/SubjectDatabaseEntityLoader.js.map +1 -1
- package/persistence/SubjectExecutor.js +244 -187
- package/persistence/SubjectExecutor.js.map +1 -1
- package/persistence/subject-builder/ManyToManySubjectBuilder.js +2 -3
- package/persistence/subject-builder/ManyToManySubjectBuilder.js.map +1 -1
- package/persistence/subject-builder/OneToManySubjectBuilder.js +1 -1
- package/persistence/subject-builder/OneToManySubjectBuilder.js.map +1 -1
- package/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js +1 -1
- package/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js.map +1 -1
- package/persistence/tree/MaterializedPathSubjectExecutor.js +2 -1
- package/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
- package/platform/PlatformTools.d.ts +7 -1
- package/platform/PlatformTools.js +44 -43
- package/platform/PlatformTools.js.map +1 -1
- package/query-builder/Alias.js.map +1 -1
- package/query-builder/DeleteQueryBuilder.d.ts +2 -3
- package/query-builder/DeleteQueryBuilder.js +5 -0
- package/query-builder/DeleteQueryBuilder.js.map +1 -1
- package/query-builder/InsertQueryBuilder.d.ts +2 -3
- package/query-builder/InsertQueryBuilder.js +18 -4
- package/query-builder/InsertQueryBuilder.js.map +1 -1
- package/query-builder/QueryBuilder.d.ts +11 -15
- package/query-builder/QueryBuilder.js +84 -23
- package/query-builder/QueryBuilder.js.map +1 -1
- package/query-builder/QueryExpressionMap.d.ts +1 -1
- package/query-builder/QueryExpressionMap.js.map +1 -1
- package/query-builder/QueryPartialEntity.d.ts +1 -1
- package/query-builder/QueryPartialEntity.js.map +1 -1
- package/query-builder/ReturningResultsEntityUpdator.js +23 -24
- package/query-builder/ReturningResultsEntityUpdator.js.map +1 -1
- package/query-builder/SelectQueryBuilder.d.ts +4 -4
- package/query-builder/SelectQueryBuilder.js +41 -5
- package/query-builder/SelectQueryBuilder.js.map +1 -1
- package/query-builder/SoftDeleteQueryBuilder.d.ts +2 -3
- package/query-builder/SoftDeleteQueryBuilder.js +2 -2
- package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
- package/query-builder/UpdateQueryBuilder.js +17 -3
- package/query-builder/UpdateQueryBuilder.js.map +1 -1
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js +1 -4
- package/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
- package/query-runner/BaseQueryRunner.d.ts +2 -5
- package/query-runner/BaseQueryRunner.js +90 -40
- package/query-runner/BaseQueryRunner.js.map +1 -1
- package/repository/AbstractRepository.js.map +1 -1
- package/repository/BaseEntity.d.ts +17 -1
- package/repository/BaseEntity.js +20 -2
- package/repository/BaseEntity.js.map +1 -1
- package/repository/MongoRepository.js.map +1 -1
- package/repository/Repository.d.ts +1 -1
- package/repository/Repository.js +2 -2
- package/repository/Repository.js.map +1 -1
- package/schema-builder/MongoSchemaBuilder.js +1 -1
- package/schema-builder/MongoSchemaBuilder.js.map +1 -1
- package/schema-builder/RdbmsSchemaBuilder.js +875 -319
- package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
- package/schema-builder/options/TableIndexOptions.d.ts +1 -1
- package/schema-builder/options/TableIndexOptions.js.map +1 -1
- package/schema-builder/view/View.d.ts +1 -2
- package/schema-builder/view/View.js.map +1 -1
- package/typeorm-class-transformer-shim.js +16 -2
- package/typeorm-model-shim.js +18 -0
- package/util/ApplyValueTransformers.js.map +1 -1
- package/util/DateUtils.js +1 -1
- package/util/DateUtils.js.map +1 -1
- package/util/DirectoryExportedClassesLoader.js +7 -5
- package/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/util/ObjectUtils.js +2 -2
- package/util/ObjectUtils.js.map +1 -1
- package/util/OrmUtils.d.ts +4 -0
- package/util/OrmUtils.js +17 -2
- package/util/OrmUtils.js.map +1 -1
- package/util/StringUtils.js +3 -2
- package/util/StringUtils.js.map +1 -1
- package/browser/util/PromiseUtils.d.ts +0 -24
- package/browser/util/PromiseUtils.js +0 -62
- package/browser/util/PromiseUtils.js.map +0 -1
- package/util/PromiseUtils.d.ts +0 -24
- package/util/PromiseUtils.js +0 -64
- package/util/PromiseUtils.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { __awaiter, __extends, __generator, __read, __spread, __values } from "tslib";
|
|
2
2
|
import { QueryRunnerAlreadyReleasedError } from "../../error/QueryRunnerAlreadyReleasedError";
|
|
3
3
|
import { TransactionAlreadyStartedError } from "../../error/TransactionAlreadyStartedError";
|
|
4
4
|
import { TransactionNotStartedError } from "../../error/TransactionNotStartedError";
|
|
5
|
-
import {
|
|
5
|
+
import { QueryFailedError } from "../../index";
|
|
6
6
|
import { BaseQueryRunner } from "../../query-runner/BaseQueryRunner";
|
|
7
7
|
import { Table } from "../../schema-builder/table/Table";
|
|
8
8
|
import { TableCheck } from "../../schema-builder/table/TableCheck";
|
|
@@ -18,12 +18,11 @@ import { Query } from "../Query";
|
|
|
18
18
|
* Runs queries on a single SQL Server database connection.
|
|
19
19
|
*/
|
|
20
20
|
var SapQueryRunner = /** @class */ (function (_super) {
|
|
21
|
-
|
|
21
|
+
__extends(SapQueryRunner, _super);
|
|
22
22
|
// -------------------------------------------------------------------------
|
|
23
23
|
// Constructor
|
|
24
24
|
// -------------------------------------------------------------------------
|
|
25
25
|
function SapQueryRunner(driver, mode) {
|
|
26
|
-
if (mode === void 0) { mode = "master"; }
|
|
27
26
|
var _this = _super.call(this) || this;
|
|
28
27
|
// -------------------------------------------------------------------------
|
|
29
28
|
// Protected Properties
|
|
@@ -48,9 +47,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
48
47
|
* Returns obtained database connection.
|
|
49
48
|
*/
|
|
50
49
|
SapQueryRunner.prototype.connect = function () {
|
|
51
|
-
return
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
52
51
|
var _a;
|
|
53
|
-
return
|
|
52
|
+
return __generator(this, function (_b) {
|
|
54
53
|
switch (_b.label) {
|
|
55
54
|
case 0:
|
|
56
55
|
if (this.databaseConnection)
|
|
@@ -79,8 +78,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
79
78
|
* Starts transaction.
|
|
80
79
|
*/
|
|
81
80
|
SapQueryRunner.prototype.startTransaction = function (isolationLevel) {
|
|
82
|
-
return
|
|
83
|
-
return
|
|
81
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
+
return __generator(this, function (_a) {
|
|
84
83
|
switch (_a.label) {
|
|
85
84
|
case 0:
|
|
86
85
|
if (this.isReleased)
|
|
@@ -103,8 +102,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
103
102
|
* Error will be thrown if transaction was not started.
|
|
104
103
|
*/
|
|
105
104
|
SapQueryRunner.prototype.commitTransaction = function () {
|
|
106
|
-
return
|
|
107
|
-
return
|
|
105
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
+
return __generator(this, function (_a) {
|
|
108
107
|
switch (_a.label) {
|
|
109
108
|
case 0:
|
|
110
109
|
if (this.isReleased)
|
|
@@ -125,8 +124,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
125
124
|
* Error will be thrown if transaction was not started.
|
|
126
125
|
*/
|
|
127
126
|
SapQueryRunner.prototype.rollbackTransaction = function () {
|
|
128
|
-
return
|
|
129
|
-
return
|
|
127
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
128
|
+
return __generator(this, function (_a) {
|
|
130
129
|
switch (_a.label) {
|
|
131
130
|
case 0:
|
|
132
131
|
if (this.isReleased)
|
|
@@ -146,27 +145,27 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
146
145
|
* Executes a given SQL query.
|
|
147
146
|
*/
|
|
148
147
|
SapQueryRunner.prototype.query = function (query, parameters) {
|
|
149
|
-
return
|
|
148
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
150
149
|
var waitingOkay, waitingPromise, otherWaitingPromises, promise;
|
|
151
150
|
var _this = this;
|
|
152
|
-
return
|
|
151
|
+
return __generator(this, function (_a) {
|
|
153
152
|
switch (_a.label) {
|
|
154
153
|
case 0:
|
|
155
154
|
if (this.isReleased)
|
|
156
155
|
throw new QueryRunnerAlreadyReleasedError();
|
|
157
156
|
waitingPromise = new Promise(function (ok) { return waitingOkay = ok; });
|
|
158
157
|
if (!this.queryResponsibilityChain.length) return [3 /*break*/, 2];
|
|
159
|
-
otherWaitingPromises =
|
|
158
|
+
otherWaitingPromises = __spread(this.queryResponsibilityChain);
|
|
160
159
|
this.queryResponsibilityChain.push(waitingPromise);
|
|
161
160
|
return [4 /*yield*/, Promise.all(otherWaitingPromises)];
|
|
162
161
|
case 1:
|
|
163
162
|
_a.sent();
|
|
164
163
|
_a.label = 2;
|
|
165
164
|
case 2:
|
|
166
|
-
promise = new Promise(function (ok, fail) { return
|
|
165
|
+
promise = new Promise(function (ok, fail) { return __awaiter(_this, void 0, void 0, function () {
|
|
167
166
|
var databaseConnection_1, queryStartTime_1, isInsertQuery_1, statement, err_1;
|
|
168
167
|
var _this = this;
|
|
169
|
-
return
|
|
168
|
+
return __generator(this, function (_a) {
|
|
170
169
|
switch (_a.label) {
|
|
171
170
|
case 0:
|
|
172
171
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -242,8 +241,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
242
241
|
* Returns raw data stream.
|
|
243
242
|
*/
|
|
244
243
|
SapQueryRunner.prototype.stream = function (query, parameters, onEnd, onError) {
|
|
245
|
-
return
|
|
246
|
-
return
|
|
244
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
245
|
+
return __generator(this, function (_a) {
|
|
247
246
|
throw new Error("Stream is not supported by SAP driver.");
|
|
248
247
|
});
|
|
249
248
|
});
|
|
@@ -252,9 +251,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
252
251
|
* Returns all available database names including system databases.
|
|
253
252
|
*/
|
|
254
253
|
SapQueryRunner.prototype.getDatabases = function () {
|
|
255
|
-
return
|
|
254
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
256
255
|
var results;
|
|
257
|
-
return
|
|
256
|
+
return __generator(this, function (_a) {
|
|
258
257
|
switch (_a.label) {
|
|
259
258
|
case 0: return [4 /*yield*/, this.query("SELECT DATABASE_NAME FROM \"SYS\".\"M_DATABASES\"")];
|
|
260
259
|
case 1:
|
|
@@ -269,9 +268,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
269
268
|
* If database parameter specified, returns schemas of that database.
|
|
270
269
|
*/
|
|
271
270
|
SapQueryRunner.prototype.getSchemas = function (database) {
|
|
272
|
-
return
|
|
271
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
273
272
|
var query, results;
|
|
274
|
-
return
|
|
273
|
+
return __generator(this, function (_a) {
|
|
275
274
|
switch (_a.label) {
|
|
276
275
|
case 0:
|
|
277
276
|
query = database ? "SELECT * FROM \"" + database + "\".\"SYS\".\"SCHEMAS\"" : "SELECT * FROM \"SYS\".\"SCHEMAS\"";
|
|
@@ -287,9 +286,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
287
286
|
* Checks if database with the given name exist.
|
|
288
287
|
*/
|
|
289
288
|
SapQueryRunner.prototype.hasDatabase = function (database) {
|
|
290
|
-
return
|
|
289
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
291
290
|
var databases;
|
|
292
|
-
return
|
|
291
|
+
return __generator(this, function (_a) {
|
|
293
292
|
switch (_a.label) {
|
|
294
293
|
case 0: return [4 /*yield*/, this.getDatabases()];
|
|
295
294
|
case 1:
|
|
@@ -303,9 +302,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
303
302
|
* Checks if schema with the given name exist.
|
|
304
303
|
*/
|
|
305
304
|
SapQueryRunner.prototype.hasSchema = function (schema) {
|
|
306
|
-
return
|
|
305
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
307
306
|
var schemas;
|
|
308
|
-
return
|
|
307
|
+
return __generator(this, function (_a) {
|
|
309
308
|
switch (_a.label) {
|
|
310
309
|
case 0: return [4 /*yield*/, this.getSchemas()];
|
|
311
310
|
case 1:
|
|
@@ -319,9 +318,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
319
318
|
* Checks if table with the given name exist in the database.
|
|
320
319
|
*/
|
|
321
320
|
SapQueryRunner.prototype.hasTable = function (tableOrName) {
|
|
322
|
-
return
|
|
321
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
323
322
|
var parsedTableName, sql, result;
|
|
324
|
-
return
|
|
323
|
+
return __generator(this, function (_a) {
|
|
325
324
|
switch (_a.label) {
|
|
326
325
|
case 0:
|
|
327
326
|
parsedTableName = this.parseTableName(tableOrName);
|
|
@@ -338,9 +337,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
338
337
|
* Checks if column with the given name exist in the given table.
|
|
339
338
|
*/
|
|
340
339
|
SapQueryRunner.prototype.hasColumn = function (tableOrName, columnName) {
|
|
341
|
-
return
|
|
340
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
342
341
|
var parsedTableName, sql, result;
|
|
343
|
-
return
|
|
342
|
+
return __generator(this, function (_a) {
|
|
344
343
|
switch (_a.label) {
|
|
345
344
|
case 0:
|
|
346
345
|
parsedTableName = this.parseTableName(tableOrName);
|
|
@@ -357,8 +356,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
357
356
|
* Creates a new database.
|
|
358
357
|
*/
|
|
359
358
|
SapQueryRunner.prototype.createDatabase = function (database, ifNotExist) {
|
|
360
|
-
return
|
|
361
|
-
return
|
|
359
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
360
|
+
return __generator(this, function (_a) {
|
|
362
361
|
return [2 /*return*/, Promise.resolve()];
|
|
363
362
|
});
|
|
364
363
|
});
|
|
@@ -367,8 +366,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
367
366
|
* Drops database.
|
|
368
367
|
*/
|
|
369
368
|
SapQueryRunner.prototype.dropDatabase = function (database, ifExist) {
|
|
370
|
-
return
|
|
371
|
-
return
|
|
369
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
370
|
+
return __generator(this, function (_a) {
|
|
372
371
|
return [2 /*return*/, Promise.resolve()];
|
|
373
372
|
});
|
|
374
373
|
});
|
|
@@ -377,9 +376,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
377
376
|
* Creates a new table schema.
|
|
378
377
|
*/
|
|
379
378
|
SapQueryRunner.prototype.createSchema = function (schema, ifNotExist) {
|
|
380
|
-
return
|
|
379
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
381
380
|
var exist, result, up, down;
|
|
382
|
-
return
|
|
381
|
+
return __generator(this, function (_a) {
|
|
383
382
|
switch (_a.label) {
|
|
384
383
|
case 0:
|
|
385
384
|
exist = false;
|
|
@@ -406,9 +405,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
406
405
|
* Drops table schema
|
|
407
406
|
*/
|
|
408
407
|
SapQueryRunner.prototype.dropSchema = function (schemaPath, ifExist, isCascade) {
|
|
409
|
-
return
|
|
408
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
410
409
|
var schema, exist, result, up, down;
|
|
411
|
-
return
|
|
410
|
+
return __generator(this, function (_a) {
|
|
412
411
|
switch (_a.label) {
|
|
413
412
|
case 0:
|
|
414
413
|
schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[0];
|
|
@@ -439,10 +438,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
439
438
|
if (ifNotExist === void 0) { ifNotExist = false; }
|
|
440
439
|
if (createForeignKeys === void 0) { createForeignKeys = true; }
|
|
441
440
|
if (createIndices === void 0) { createIndices = true; }
|
|
442
|
-
return
|
|
441
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
443
442
|
var isTableExist, upQueries, downQueries;
|
|
444
443
|
var _this = this;
|
|
445
|
-
return
|
|
444
|
+
return __generator(this, function (_a) {
|
|
446
445
|
switch (_a.label) {
|
|
447
446
|
case 0:
|
|
448
447
|
if (!ifNotExist) return [3 /*break*/, 2];
|
|
@@ -484,10 +483,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
484
483
|
SapQueryRunner.prototype.dropTable = function (tableOrName, ifExist, dropForeignKeys, dropIndices) {
|
|
485
484
|
if (dropForeignKeys === void 0) { dropForeignKeys = true; }
|
|
486
485
|
if (dropIndices === void 0) { dropIndices = true; }
|
|
487
|
-
return
|
|
486
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
488
487
|
var isTableExist, createForeignKeys, table, _a, upQueries, downQueries;
|
|
489
488
|
var _this = this;
|
|
490
|
-
return
|
|
489
|
+
return __generator(this, function (_b) {
|
|
491
490
|
switch (_b.label) {
|
|
492
491
|
case 0:
|
|
493
492
|
if (!ifExist) return [3 /*break*/, 2];
|
|
@@ -536,9 +535,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
536
535
|
* Creates a new view.
|
|
537
536
|
*/
|
|
538
537
|
SapQueryRunner.prototype.createView = function (view) {
|
|
539
|
-
return
|
|
538
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
540
539
|
var upQueries, downQueries, _a, _b, _c, _d;
|
|
541
|
-
return
|
|
540
|
+
return __generator(this, function (_e) {
|
|
542
541
|
switch (_e.label) {
|
|
543
542
|
case 0:
|
|
544
543
|
upQueries = [];
|
|
@@ -565,9 +564,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
565
564
|
* Drops the view.
|
|
566
565
|
*/
|
|
567
566
|
SapQueryRunner.prototype.dropView = function (target) {
|
|
568
|
-
return
|
|
567
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
569
568
|
var viewName, view, upQueries, downQueries, _a, _b, _c, _d;
|
|
570
|
-
return
|
|
569
|
+
return __generator(this, function (_e) {
|
|
571
570
|
switch (_e.label) {
|
|
572
571
|
case 0:
|
|
573
572
|
viewName = target instanceof View ? target.name : target;
|
|
@@ -598,10 +597,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
598
597
|
* Renames a table.
|
|
599
598
|
*/
|
|
600
599
|
SapQueryRunner.prototype.renameTable = function (oldTableOrName, newTableName) {
|
|
601
|
-
return
|
|
600
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
602
601
|
var upQueries, downQueries, oldTable, _a, newTable, oldTableName, schemaName, referencedForeignKeySql, dbForeignKeys, referencedForeignKeys, referencedForeignKeyTableMapping, columnNames, columnNamesString, oldPkName, newPkName;
|
|
603
602
|
var _this = this;
|
|
604
|
-
return
|
|
603
|
+
return __generator(this, function (_b) {
|
|
605
604
|
switch (_b.label) {
|
|
606
605
|
case 0:
|
|
607
606
|
upQueries = [];
|
|
@@ -708,10 +707,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
708
707
|
* Creates a new column from the column in the table.
|
|
709
708
|
*/
|
|
710
709
|
SapQueryRunner.prototype.addColumn = function (tableOrName, column) {
|
|
711
|
-
return
|
|
710
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
712
711
|
var table, _a, parsedTableName, clonedTable, upQueries, downQueries, primaryColumns, referencedForeignKeySql, dbForeignKeys_1, referencedForeignKeys, referencedForeignKeyTableMapping_1, pkName_1, columnNames_1, pkName, columnNames, columnIndex, uniqueIndex;
|
|
713
712
|
var _this = this;
|
|
714
|
-
return
|
|
713
|
+
return __generator(this, function (_b) {
|
|
715
714
|
switch (_b.label) {
|
|
716
715
|
case 0:
|
|
717
716
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -810,14 +809,37 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
810
809
|
* Creates a new columns from the column in the table.
|
|
811
810
|
*/
|
|
812
811
|
SapQueryRunner.prototype.addColumns = function (tableOrName, columns) {
|
|
813
|
-
return
|
|
814
|
-
var
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
812
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
813
|
+
var columns_1, columns_1_1, column, e_1_1;
|
|
814
|
+
var e_1, _a;
|
|
815
|
+
return __generator(this, function (_b) {
|
|
816
|
+
switch (_b.label) {
|
|
817
|
+
case 0:
|
|
818
|
+
_b.trys.push([0, 5, 6, 7]);
|
|
819
|
+
columns_1 = __values(columns), columns_1_1 = columns_1.next();
|
|
820
|
+
_b.label = 1;
|
|
818
821
|
case 1:
|
|
819
|
-
|
|
820
|
-
|
|
822
|
+
if (!!columns_1_1.done) return [3 /*break*/, 4];
|
|
823
|
+
column = columns_1_1.value;
|
|
824
|
+
return [4 /*yield*/, this.addColumn(tableOrName, column)];
|
|
825
|
+
case 2:
|
|
826
|
+
_b.sent();
|
|
827
|
+
_b.label = 3;
|
|
828
|
+
case 3:
|
|
829
|
+
columns_1_1 = columns_1.next();
|
|
830
|
+
return [3 /*break*/, 1];
|
|
831
|
+
case 4: return [3 /*break*/, 7];
|
|
832
|
+
case 5:
|
|
833
|
+
e_1_1 = _b.sent();
|
|
834
|
+
e_1 = { error: e_1_1 };
|
|
835
|
+
return [3 /*break*/, 7];
|
|
836
|
+
case 6:
|
|
837
|
+
try {
|
|
838
|
+
if (columns_1_1 && !columns_1_1.done && (_a = columns_1.return)) _a.call(columns_1);
|
|
839
|
+
}
|
|
840
|
+
finally { if (e_1) throw e_1.error; }
|
|
841
|
+
return [7 /*endfinally*/];
|
|
842
|
+
case 7: return [2 /*return*/];
|
|
821
843
|
}
|
|
822
844
|
});
|
|
823
845
|
});
|
|
@@ -826,9 +848,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
826
848
|
* Renames column in the given table.
|
|
827
849
|
*/
|
|
828
850
|
SapQueryRunner.prototype.renameColumn = function (tableOrName, oldTableColumnOrName, newTableColumnOrName) {
|
|
829
|
-
return
|
|
851
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
830
852
|
var table, _a, oldColumn, newColumn;
|
|
831
|
-
return
|
|
853
|
+
return __generator(this, function (_b) {
|
|
832
854
|
switch (_b.label) {
|
|
833
855
|
case 0:
|
|
834
856
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -863,10 +885,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
863
885
|
* Changes a column in the table.
|
|
864
886
|
*/
|
|
865
887
|
SapQueryRunner.prototype.changeColumn = function (tableOrName, oldTableColumnOrName, newColumn) {
|
|
866
|
-
return
|
|
888
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
867
889
|
var table, _a, clonedTable, upQueries, downQueries, oldColumn, primaryColumns, columnNames, oldPkName, columnNamesString, newPkName, oldTableColumn, primaryColumns, pkName, columnNames, column, pkName, columnNames, primaryColumn, column, pkName, columnNames, uniqueIndex, uniqueIndex_1, tableUnique;
|
|
868
890
|
var _this = this;
|
|
869
|
-
return
|
|
891
|
+
return __generator(this, function (_b) {
|
|
870
892
|
switch (_b.label) {
|
|
871
893
|
case 0:
|
|
872
894
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1058,14 +1080,37 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1058
1080
|
* Changes a column in the table.
|
|
1059
1081
|
*/
|
|
1060
1082
|
SapQueryRunner.prototype.changeColumns = function (tableOrName, changedColumns) {
|
|
1061
|
-
return
|
|
1062
|
-
var
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1083
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1084
|
+
var changedColumns_1, changedColumns_1_1, _a, oldColumn, newColumn, e_2_1;
|
|
1085
|
+
var e_2, _b;
|
|
1086
|
+
return __generator(this, function (_c) {
|
|
1087
|
+
switch (_c.label) {
|
|
1088
|
+
case 0:
|
|
1089
|
+
_c.trys.push([0, 5, 6, 7]);
|
|
1090
|
+
changedColumns_1 = __values(changedColumns), changedColumns_1_1 = changedColumns_1.next();
|
|
1091
|
+
_c.label = 1;
|
|
1066
1092
|
case 1:
|
|
1067
|
-
|
|
1068
|
-
|
|
1093
|
+
if (!!changedColumns_1_1.done) return [3 /*break*/, 4];
|
|
1094
|
+
_a = changedColumns_1_1.value, oldColumn = _a.oldColumn, newColumn = _a.newColumn;
|
|
1095
|
+
return [4 /*yield*/, this.changeColumn(tableOrName, oldColumn, newColumn)];
|
|
1096
|
+
case 2:
|
|
1097
|
+
_c.sent();
|
|
1098
|
+
_c.label = 3;
|
|
1099
|
+
case 3:
|
|
1100
|
+
changedColumns_1_1 = changedColumns_1.next();
|
|
1101
|
+
return [3 /*break*/, 1];
|
|
1102
|
+
case 4: return [3 /*break*/, 7];
|
|
1103
|
+
case 5:
|
|
1104
|
+
e_2_1 = _c.sent();
|
|
1105
|
+
e_2 = { error: e_2_1 };
|
|
1106
|
+
return [3 /*break*/, 7];
|
|
1107
|
+
case 6:
|
|
1108
|
+
try {
|
|
1109
|
+
if (changedColumns_1_1 && !changedColumns_1_1.done && (_b = changedColumns_1.return)) _b.call(changedColumns_1);
|
|
1110
|
+
}
|
|
1111
|
+
finally { if (e_2) throw e_2.error; }
|
|
1112
|
+
return [7 /*endfinally*/];
|
|
1113
|
+
case 7: return [2 /*return*/];
|
|
1069
1114
|
}
|
|
1070
1115
|
});
|
|
1071
1116
|
});
|
|
@@ -1074,10 +1119,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1074
1119
|
* Drops column in the table.
|
|
1075
1120
|
*/
|
|
1076
1121
|
SapQueryRunner.prototype.dropColumn = function (tableOrName, columnOrName) {
|
|
1077
|
-
return
|
|
1122
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1078
1123
|
var table, _a, parsedTableName, column, clonedTable, upQueries, downQueries, referencedForeignKeySql, dbForeignKeys_2, referencedForeignKeys, referencedForeignKeyTableMapping_2, pkName, columnNames, tableColumn, pkName_2, columnNames_2, columnIndex, uniqueName_1, foundUnique, indexName_1, foundIndex, columnCheck;
|
|
1079
1124
|
var _this = this;
|
|
1080
|
-
return
|
|
1125
|
+
return __generator(this, function (_b) {
|
|
1081
1126
|
switch (_b.label) {
|
|
1082
1127
|
case 0:
|
|
1083
1128
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1188,14 +1233,37 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1188
1233
|
* Drops the columns in the table.
|
|
1189
1234
|
*/
|
|
1190
1235
|
SapQueryRunner.prototype.dropColumns = function (tableOrName, columns) {
|
|
1191
|
-
return
|
|
1192
|
-
var
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1236
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1237
|
+
var columns_2, columns_2_1, column, e_3_1;
|
|
1238
|
+
var e_3, _a;
|
|
1239
|
+
return __generator(this, function (_b) {
|
|
1240
|
+
switch (_b.label) {
|
|
1241
|
+
case 0:
|
|
1242
|
+
_b.trys.push([0, 5, 6, 7]);
|
|
1243
|
+
columns_2 = __values(columns), columns_2_1 = columns_2.next();
|
|
1244
|
+
_b.label = 1;
|
|
1196
1245
|
case 1:
|
|
1197
|
-
|
|
1198
|
-
|
|
1246
|
+
if (!!columns_2_1.done) return [3 /*break*/, 4];
|
|
1247
|
+
column = columns_2_1.value;
|
|
1248
|
+
return [4 /*yield*/, this.dropColumn(tableOrName, column)];
|
|
1249
|
+
case 2:
|
|
1250
|
+
_b.sent();
|
|
1251
|
+
_b.label = 3;
|
|
1252
|
+
case 3:
|
|
1253
|
+
columns_2_1 = columns_2.next();
|
|
1254
|
+
return [3 /*break*/, 1];
|
|
1255
|
+
case 4: return [3 /*break*/, 7];
|
|
1256
|
+
case 5:
|
|
1257
|
+
e_3_1 = _b.sent();
|
|
1258
|
+
e_3 = { error: e_3_1 };
|
|
1259
|
+
return [3 /*break*/, 7];
|
|
1260
|
+
case 6:
|
|
1261
|
+
try {
|
|
1262
|
+
if (columns_2_1 && !columns_2_1.done && (_a = columns_2.return)) _a.call(columns_2);
|
|
1263
|
+
}
|
|
1264
|
+
finally { if (e_3) throw e_3.error; }
|
|
1265
|
+
return [7 /*endfinally*/];
|
|
1266
|
+
case 7: return [2 /*return*/];
|
|
1199
1267
|
}
|
|
1200
1268
|
});
|
|
1201
1269
|
});
|
|
@@ -1204,9 +1272,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1204
1272
|
* Creates a new primary key.
|
|
1205
1273
|
*/
|
|
1206
1274
|
SapQueryRunner.prototype.createPrimaryKey = function (tableOrName, columnNames) {
|
|
1207
|
-
return
|
|
1275
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1208
1276
|
var table, _a, clonedTable, up, down;
|
|
1209
|
-
return
|
|
1277
|
+
return __generator(this, function (_b) {
|
|
1210
1278
|
switch (_b.label) {
|
|
1211
1279
|
case 0:
|
|
1212
1280
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1239,10 +1307,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1239
1307
|
* Updates composite primary keys.
|
|
1240
1308
|
*/
|
|
1241
1309
|
SapQueryRunner.prototype.updatePrimaryKeys = function (tableOrName, columns) {
|
|
1242
|
-
return
|
|
1310
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1243
1311
|
var table, _a, parsedTableName, clonedTable, columnNames, upQueries, downQueries, referencedForeignKeySql, dbForeignKeys, referencedForeignKeys, referencedForeignKeyTableMapping, primaryColumns, pkName_3, columnNamesString_1, pkName, columnNamesString;
|
|
1244
1312
|
var _this = this;
|
|
1245
|
-
return
|
|
1313
|
+
return __generator(this, function (_b) {
|
|
1246
1314
|
switch (_b.label) {
|
|
1247
1315
|
case 0:
|
|
1248
1316
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1319,10 +1387,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1319
1387
|
* Drops a primary key.
|
|
1320
1388
|
*/
|
|
1321
1389
|
SapQueryRunner.prototype.dropPrimaryKey = function (tableOrName) {
|
|
1322
|
-
return
|
|
1390
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1323
1391
|
var table, _a, parsedTableName, upQueries, downQueries, referencedForeignKeySql, dbForeignKeys, referencedForeignKeys, referencedForeignKeyTableMapping;
|
|
1324
1392
|
var _this = this;
|
|
1325
|
-
return
|
|
1393
|
+
return __generator(this, function (_b) {
|
|
1326
1394
|
switch (_b.label) {
|
|
1327
1395
|
case 0:
|
|
1328
1396
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1386,8 +1454,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1386
1454
|
* Creates a new unique constraint.
|
|
1387
1455
|
*/
|
|
1388
1456
|
SapQueryRunner.prototype.createUniqueConstraint = function (tableOrName, uniqueConstraint) {
|
|
1389
|
-
return
|
|
1390
|
-
return
|
|
1457
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1458
|
+
return __generator(this, function (_a) {
|
|
1391
1459
|
throw new Error("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1392
1460
|
});
|
|
1393
1461
|
});
|
|
@@ -1396,8 +1464,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1396
1464
|
* Creates a new unique constraints.
|
|
1397
1465
|
*/
|
|
1398
1466
|
SapQueryRunner.prototype.createUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1399
|
-
return
|
|
1400
|
-
return
|
|
1467
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1468
|
+
return __generator(this, function (_a) {
|
|
1401
1469
|
throw new Error("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1402
1470
|
});
|
|
1403
1471
|
});
|
|
@@ -1406,8 +1474,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1406
1474
|
* Drops unique constraint.
|
|
1407
1475
|
*/
|
|
1408
1476
|
SapQueryRunner.prototype.dropUniqueConstraint = function (tableOrName, uniqueOrName) {
|
|
1409
|
-
return
|
|
1410
|
-
return
|
|
1477
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1478
|
+
return __generator(this, function (_a) {
|
|
1411
1479
|
throw new Error("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1412
1480
|
});
|
|
1413
1481
|
});
|
|
@@ -1416,8 +1484,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1416
1484
|
* Drops an unique constraints.
|
|
1417
1485
|
*/
|
|
1418
1486
|
SapQueryRunner.prototype.dropUniqueConstraints = function (tableOrName, uniqueConstraints) {
|
|
1419
|
-
return
|
|
1420
|
-
return
|
|
1487
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1488
|
+
return __generator(this, function (_a) {
|
|
1421
1489
|
throw new Error("SAP HANA does not support unique constraints. Use unique index instead.");
|
|
1422
1490
|
});
|
|
1423
1491
|
});
|
|
@@ -1426,9 +1494,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1426
1494
|
* Creates a new check constraint.
|
|
1427
1495
|
*/
|
|
1428
1496
|
SapQueryRunner.prototype.createCheckConstraint = function (tableOrName, checkConstraint) {
|
|
1429
|
-
return
|
|
1497
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1430
1498
|
var table, _a, up, down;
|
|
1431
|
-
return
|
|
1499
|
+
return __generator(this, function (_b) {
|
|
1432
1500
|
switch (_b.label) {
|
|
1433
1501
|
case 0:
|
|
1434
1502
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1458,10 +1526,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1458
1526
|
* Creates a new check constraints.
|
|
1459
1527
|
*/
|
|
1460
1528
|
SapQueryRunner.prototype.createCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1461
|
-
return
|
|
1529
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1462
1530
|
var promises;
|
|
1463
1531
|
var _this = this;
|
|
1464
|
-
return
|
|
1532
|
+
return __generator(this, function (_a) {
|
|
1465
1533
|
switch (_a.label) {
|
|
1466
1534
|
case 0:
|
|
1467
1535
|
promises = checkConstraints.map(function (checkConstraint) { return _this.createCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1477,9 +1545,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1477
1545
|
* Drops check constraint.
|
|
1478
1546
|
*/
|
|
1479
1547
|
SapQueryRunner.prototype.dropCheckConstraint = function (tableOrName, checkOrName) {
|
|
1480
|
-
return
|
|
1548
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1481
1549
|
var table, _a, checkConstraint, up, down;
|
|
1482
|
-
return
|
|
1550
|
+
return __generator(this, function (_b) {
|
|
1483
1551
|
switch (_b.label) {
|
|
1484
1552
|
case 0:
|
|
1485
1553
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1509,10 +1577,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1509
1577
|
* Drops check constraints.
|
|
1510
1578
|
*/
|
|
1511
1579
|
SapQueryRunner.prototype.dropCheckConstraints = function (tableOrName, checkConstraints) {
|
|
1512
|
-
return
|
|
1580
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1513
1581
|
var promises;
|
|
1514
1582
|
var _this = this;
|
|
1515
|
-
return
|
|
1583
|
+
return __generator(this, function (_a) {
|
|
1516
1584
|
switch (_a.label) {
|
|
1517
1585
|
case 0:
|
|
1518
1586
|
promises = checkConstraints.map(function (checkConstraint) { return _this.dropCheckConstraint(tableOrName, checkConstraint); });
|
|
@@ -1528,8 +1596,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1528
1596
|
* Creates a new exclusion constraint.
|
|
1529
1597
|
*/
|
|
1530
1598
|
SapQueryRunner.prototype.createExclusionConstraint = function (tableOrName, exclusionConstraint) {
|
|
1531
|
-
return
|
|
1532
|
-
return
|
|
1599
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1600
|
+
return __generator(this, function (_a) {
|
|
1533
1601
|
throw new Error("SAP HANA does not support exclusion constraints.");
|
|
1534
1602
|
});
|
|
1535
1603
|
});
|
|
@@ -1538,8 +1606,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1538
1606
|
* Creates a new exclusion constraints.
|
|
1539
1607
|
*/
|
|
1540
1608
|
SapQueryRunner.prototype.createExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1541
|
-
return
|
|
1542
|
-
return
|
|
1609
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1610
|
+
return __generator(this, function (_a) {
|
|
1543
1611
|
throw new Error("SAP HANA does not support exclusion constraints.");
|
|
1544
1612
|
});
|
|
1545
1613
|
});
|
|
@@ -1548,8 +1616,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1548
1616
|
* Drops exclusion constraint.
|
|
1549
1617
|
*/
|
|
1550
1618
|
SapQueryRunner.prototype.dropExclusionConstraint = function (tableOrName, exclusionOrName) {
|
|
1551
|
-
return
|
|
1552
|
-
return
|
|
1619
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1620
|
+
return __generator(this, function (_a) {
|
|
1553
1621
|
throw new Error("SAP HANA does not support exclusion constraints.");
|
|
1554
1622
|
});
|
|
1555
1623
|
});
|
|
@@ -1558,8 +1626,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1558
1626
|
* Drops exclusion constraints.
|
|
1559
1627
|
*/
|
|
1560
1628
|
SapQueryRunner.prototype.dropExclusionConstraints = function (tableOrName, exclusionConstraints) {
|
|
1561
|
-
return
|
|
1562
|
-
return
|
|
1629
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1630
|
+
return __generator(this, function (_a) {
|
|
1563
1631
|
throw new Error("SAP HANA does not support exclusion constraints.");
|
|
1564
1632
|
});
|
|
1565
1633
|
});
|
|
@@ -1568,9 +1636,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1568
1636
|
* Creates a new foreign key.
|
|
1569
1637
|
*/
|
|
1570
1638
|
SapQueryRunner.prototype.createForeignKey = function (tableOrName, foreignKey) {
|
|
1571
|
-
return
|
|
1639
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1572
1640
|
var table, _a, up, down;
|
|
1573
|
-
return
|
|
1641
|
+
return __generator(this, function (_b) {
|
|
1574
1642
|
switch (_b.label) {
|
|
1575
1643
|
case 0:
|
|
1576
1644
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1600,10 +1668,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1600
1668
|
* Creates a new foreign keys.
|
|
1601
1669
|
*/
|
|
1602
1670
|
SapQueryRunner.prototype.createForeignKeys = function (tableOrName, foreignKeys) {
|
|
1603
|
-
return
|
|
1671
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1604
1672
|
var promises;
|
|
1605
1673
|
var _this = this;
|
|
1606
|
-
return
|
|
1674
|
+
return __generator(this, function (_a) {
|
|
1607
1675
|
switch (_a.label) {
|
|
1608
1676
|
case 0:
|
|
1609
1677
|
promises = foreignKeys.map(function (foreignKey) { return _this.createForeignKey(tableOrName, foreignKey); });
|
|
@@ -1619,9 +1687,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1619
1687
|
* Drops a foreign key from the table.
|
|
1620
1688
|
*/
|
|
1621
1689
|
SapQueryRunner.prototype.dropForeignKey = function (tableOrName, foreignKeyOrName) {
|
|
1622
|
-
return
|
|
1690
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1623
1691
|
var table, _a, foreignKey, up, down;
|
|
1624
|
-
return
|
|
1692
|
+
return __generator(this, function (_b) {
|
|
1625
1693
|
switch (_b.label) {
|
|
1626
1694
|
case 0:
|
|
1627
1695
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1651,10 +1719,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1651
1719
|
* Drops a foreign keys from the table.
|
|
1652
1720
|
*/
|
|
1653
1721
|
SapQueryRunner.prototype.dropForeignKeys = function (tableOrName, foreignKeys) {
|
|
1654
|
-
return
|
|
1722
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1655
1723
|
var promises;
|
|
1656
1724
|
var _this = this;
|
|
1657
|
-
return
|
|
1725
|
+
return __generator(this, function (_a) {
|
|
1658
1726
|
switch (_a.label) {
|
|
1659
1727
|
case 0:
|
|
1660
1728
|
promises = foreignKeys.map(function (foreignKey) { return _this.dropForeignKey(tableOrName, foreignKey); });
|
|
@@ -1670,9 +1738,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1670
1738
|
* Creates a new index.
|
|
1671
1739
|
*/
|
|
1672
1740
|
SapQueryRunner.prototype.createIndex = function (tableOrName, index) {
|
|
1673
|
-
return
|
|
1741
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1674
1742
|
var table, _a, up, down;
|
|
1675
|
-
return
|
|
1743
|
+
return __generator(this, function (_b) {
|
|
1676
1744
|
switch (_b.label) {
|
|
1677
1745
|
case 0:
|
|
1678
1746
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1702,10 +1770,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1702
1770
|
* Creates a new indices
|
|
1703
1771
|
*/
|
|
1704
1772
|
SapQueryRunner.prototype.createIndices = function (tableOrName, indices) {
|
|
1705
|
-
return
|
|
1773
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1706
1774
|
var promises;
|
|
1707
1775
|
var _this = this;
|
|
1708
|
-
return
|
|
1776
|
+
return __generator(this, function (_a) {
|
|
1709
1777
|
switch (_a.label) {
|
|
1710
1778
|
case 0:
|
|
1711
1779
|
promises = indices.map(function (index) { return _this.createIndex(tableOrName, index); });
|
|
@@ -1721,9 +1789,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1721
1789
|
* Drops an index.
|
|
1722
1790
|
*/
|
|
1723
1791
|
SapQueryRunner.prototype.dropIndex = function (tableOrName, indexOrName) {
|
|
1724
|
-
return
|
|
1792
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1725
1793
|
var table, _a, index, up, down;
|
|
1726
|
-
return
|
|
1794
|
+
return __generator(this, function (_b) {
|
|
1727
1795
|
switch (_b.label) {
|
|
1728
1796
|
case 0:
|
|
1729
1797
|
if (!(tableOrName instanceof Table)) return [3 /*break*/, 1];
|
|
@@ -1753,10 +1821,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1753
1821
|
* Drops an indices from the table.
|
|
1754
1822
|
*/
|
|
1755
1823
|
SapQueryRunner.prototype.dropIndices = function (tableOrName, indices) {
|
|
1756
|
-
return
|
|
1824
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1757
1825
|
var promises;
|
|
1758
1826
|
var _this = this;
|
|
1759
|
-
return
|
|
1827
|
+
return __generator(this, function (_a) {
|
|
1760
1828
|
switch (_a.label) {
|
|
1761
1829
|
case 0:
|
|
1762
1830
|
promises = indices.map(function (index) { return _this.dropIndex(tableOrName, index); });
|
|
@@ -1773,8 +1841,8 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1773
1841
|
* Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
|
|
1774
1842
|
*/
|
|
1775
1843
|
SapQueryRunner.prototype.clearTable = function (tablePath) {
|
|
1776
|
-
return
|
|
1777
|
-
return
|
|
1844
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1845
|
+
return __generator(this, function (_a) {
|
|
1778
1846
|
switch (_a.label) {
|
|
1779
1847
|
case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tablePath))];
|
|
1780
1848
|
case 1:
|
|
@@ -1788,10 +1856,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1788
1856
|
* Removes all tables from the currently connected database.
|
|
1789
1857
|
*/
|
|
1790
1858
|
SapQueryRunner.prototype.clearDatabase = function () {
|
|
1791
|
-
return
|
|
1859
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1792
1860
|
var schemas, schemaNamesString, selectTableDropsQuery, dropTableQueries, error_1, rollbackError_1;
|
|
1793
1861
|
var _this = this;
|
|
1794
|
-
return
|
|
1862
|
+
return __generator(this, function (_a) {
|
|
1795
1863
|
switch (_a.label) {
|
|
1796
1864
|
case 0:
|
|
1797
1865
|
schemas = [];
|
|
@@ -1848,9 +1916,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1848
1916
|
* Return current database.
|
|
1849
1917
|
*/
|
|
1850
1918
|
SapQueryRunner.prototype.getCurrentDatabase = function () {
|
|
1851
|
-
return
|
|
1919
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1852
1920
|
var currentDBQuery;
|
|
1853
|
-
return
|
|
1921
|
+
return __generator(this, function (_a) {
|
|
1854
1922
|
switch (_a.label) {
|
|
1855
1923
|
case 0: return [4 /*yield*/, this.query("SELECT \"VALUE\" AS \"db_name\" FROM \"SYS\".\"M_SYSTEM_OVERVIEW\" WHERE \"SECTION\" = 'System' and \"NAME\" = 'Instance ID'")];
|
|
1856
1924
|
case 1:
|
|
@@ -1864,9 +1932,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1864
1932
|
* Return current schema.
|
|
1865
1933
|
*/
|
|
1866
1934
|
SapQueryRunner.prototype.getCurrentSchema = function () {
|
|
1867
|
-
return
|
|
1935
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1868
1936
|
var currentSchemaQuery;
|
|
1869
|
-
return
|
|
1937
|
+
return __generator(this, function (_a) {
|
|
1870
1938
|
switch (_a.label) {
|
|
1871
1939
|
case 0: return [4 /*yield*/, this.query("SELECT CURRENT_SCHEMA AS \"schema_name\" FROM \"SYS\".\"DUMMY\"")];
|
|
1872
1940
|
case 1:
|
|
@@ -1877,10 +1945,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1877
1945
|
});
|
|
1878
1946
|
};
|
|
1879
1947
|
SapQueryRunner.prototype.loadViews = function (viewNames) {
|
|
1880
|
-
return
|
|
1948
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1881
1949
|
var hasTable, currentSchema, viewsCondition, query, dbViews;
|
|
1882
1950
|
var _this = this;
|
|
1883
|
-
return
|
|
1951
|
+
return __generator(this, function (_a) {
|
|
1884
1952
|
switch (_a.label) {
|
|
1885
1953
|
case 0: return [4 /*yield*/, this.hasTable(this.getTypeormMetadataTableName())];
|
|
1886
1954
|
case 1:
|
|
@@ -1891,7 +1959,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1891
1959
|
case 2:
|
|
1892
1960
|
currentSchema = _a.sent();
|
|
1893
1961
|
viewsCondition = viewNames.map(function (viewName) {
|
|
1894
|
-
var _a =
|
|
1962
|
+
var _a = __read(viewName.split("."), 2), schema = _a[0], name = _a[1];
|
|
1895
1963
|
if (!name) {
|
|
1896
1964
|
name = schema;
|
|
1897
1965
|
schema = _this.driver.options.schema || currentSchema;
|
|
@@ -1917,10 +1985,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1917
1985
|
* Loads all tables (with given names) from the database and creates a Table from them.
|
|
1918
1986
|
*/
|
|
1919
1987
|
SapQueryRunner.prototype.loadTables = function (tableNames) {
|
|
1920
|
-
return
|
|
1988
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1921
1989
|
var currentSchema, tablesCondition, tablesSql, columnsSql, constraintsCondition, constraintsSql, indicesCondition, indicesSql, foreignKeysCondition, foreignKeysSql, _a, dbTables, dbColumns, dbConstraints, dbIndices, dbForeignKeys;
|
|
1922
1990
|
var _this = this;
|
|
1923
|
-
return
|
|
1991
|
+
return __generator(this, function (_b) {
|
|
1924
1992
|
switch (_b.label) {
|
|
1925
1993
|
case 0:
|
|
1926
1994
|
// if no tables given then no need to proceed
|
|
@@ -1930,7 +1998,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1930
1998
|
case 1:
|
|
1931
1999
|
currentSchema = _b.sent();
|
|
1932
2000
|
tablesCondition = tableNames.map(function (tableName) {
|
|
1933
|
-
var _a =
|
|
2001
|
+
var _a = __read(tableName.split("."), 2), schema = _a[0], name = _a[1];
|
|
1934
2002
|
if (!name) {
|
|
1935
2003
|
name = schema;
|
|
1936
2004
|
schema = _this.driver.options.schema || currentSchema;
|
|
@@ -1938,18 +2006,18 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1938
2006
|
return "(\"SCHEMA_NAME\" = '" + schema + "' AND \"TABLE_NAME\" = '" + name + "')";
|
|
1939
2007
|
}).join(" OR ");
|
|
1940
2008
|
tablesSql = "SELECT * FROM \"SYS\".\"TABLES\" WHERE " + tablesCondition;
|
|
1941
|
-
columnsSql = "SELECT * FROM \"SYS\".\"TABLE_COLUMNS\" WHERE " + tablesCondition;
|
|
2009
|
+
columnsSql = "SELECT * FROM \"SYS\".\"TABLE_COLUMNS\" WHERE " + tablesCondition + " ORDER BY \"POSITION\"";
|
|
1942
2010
|
constraintsCondition = tableNames.map(function (tableName) {
|
|
1943
|
-
var _a =
|
|
2011
|
+
var _a = __read(tableName.split("."), 2), schema = _a[0], name = _a[1];
|
|
1944
2012
|
if (!name) {
|
|
1945
2013
|
name = schema;
|
|
1946
2014
|
schema = _this.driver.options.schema || currentSchema;
|
|
1947
2015
|
}
|
|
1948
2016
|
return "(\"SCHEMA_NAME\" = '" + schema + "' AND \"TABLE_NAME\" = '" + name + "')";
|
|
1949
2017
|
}).join(" OR ");
|
|
1950
|
-
constraintsSql = "SELECT * FROM \"SYS\".\"CONSTRAINTS\" WHERE (" + constraintsCondition + ")";
|
|
2018
|
+
constraintsSql = "SELECT * FROM \"SYS\".\"CONSTRAINTS\" WHERE (" + constraintsCondition + ") ORDER BY \"POSITION\"";
|
|
1951
2019
|
indicesCondition = tableNames.map(function (tableName) {
|
|
1952
|
-
var _a =
|
|
2020
|
+
var _a = __read(tableName.split("."), 2), schema = _a[0], name = _a[1];
|
|
1953
2021
|
if (!name) {
|
|
1954
2022
|
name = schema;
|
|
1955
2023
|
schema = _this.driver.options.schema || currentSchema;
|
|
@@ -1958,16 +2026,16 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1958
2026
|
}).join(" OR ");
|
|
1959
2027
|
indicesSql = "SELECT \"I\".\"INDEX_TYPE\", \"I\".\"SCHEMA_NAME\", \"I\".\"TABLE_NAME\", \"I\".\"INDEX_NAME\", \"IC\".\"COLUMN_NAME\", \"I\".\"CONSTRAINT\" " +
|
|
1960
2028
|
"FROM \"SYS\".\"INDEXES\" \"I\" INNER JOIN \"SYS\".\"INDEX_COLUMNS\" \"IC\" ON \"IC\".\"INDEX_OID\" = \"I\".\"INDEX_OID\" " +
|
|
1961
|
-
("WHERE (" + indicesCondition + ") AND (\"I\".\"CONSTRAINT\" IS NULL OR \"I\".\"CONSTRAINT\" != 'PRIMARY KEY') AND \"I\".\"INDEX_NAME\" NOT LIKE '%_SYS_FULLTEXT_%'");
|
|
2029
|
+
("WHERE (" + indicesCondition + ") AND (\"I\".\"CONSTRAINT\" IS NULL OR \"I\".\"CONSTRAINT\" != 'PRIMARY KEY') AND \"I\".\"INDEX_NAME\" NOT LIKE '%_SYS_FULLTEXT_%' ORDER BY \"IC\".\"POSITION\"");
|
|
1962
2030
|
foreignKeysCondition = tableNames.map(function (tableName) {
|
|
1963
|
-
var _a =
|
|
2031
|
+
var _a = __read(tableName.split("."), 2), schema = _a[0], name = _a[1];
|
|
1964
2032
|
if (!name) {
|
|
1965
2033
|
name = schema;
|
|
1966
2034
|
schema = _this.driver.options.schema || currentSchema;
|
|
1967
2035
|
}
|
|
1968
2036
|
return "(\"SCHEMA_NAME\" = '" + schema + "' AND \"TABLE_NAME\" = '" + name + "')";
|
|
1969
2037
|
}).join(" OR ");
|
|
1970
|
-
foreignKeysSql = "SELECT * FROM \"SYS\".\"REFERENTIAL_CONSTRAINTS\" WHERE (" + foreignKeysCondition + ")";
|
|
2038
|
+
foreignKeysSql = "SELECT * FROM \"SYS\".\"REFERENTIAL_CONSTRAINTS\" WHERE (" + foreignKeysCondition + ") ORDER BY \"POSITION\"";
|
|
1971
2039
|
return [4 /*yield*/, Promise.all([
|
|
1972
2040
|
this.query(tablesSql),
|
|
1973
2041
|
this.query(columnsSql),
|
|
@@ -1976,15 +2044,15 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1976
2044
|
this.query(foreignKeysSql),
|
|
1977
2045
|
])];
|
|
1978
2046
|
case 2:
|
|
1979
|
-
_a =
|
|
2047
|
+
_a = __read.apply(void 0, [_b.sent(), 5]), dbTables = _a[0], dbColumns = _a[1], dbConstraints = _a[2], dbIndices = _a[3], dbForeignKeys = _a[4];
|
|
1980
2048
|
// if tables were not found in the db, no need to proceed
|
|
1981
2049
|
if (!dbTables.length)
|
|
1982
2050
|
return [2 /*return*/, []];
|
|
1983
2051
|
// create tables for loaded tables
|
|
1984
|
-
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return
|
|
2052
|
+
return [2 /*return*/, Promise.all(dbTables.map(function (dbTable) { return __awaiter(_this, void 0, void 0, function () {
|
|
1985
2053
|
var table, schema, tableFullName, _a, tableCheckConstraints, tableForeignKeyConstraints, tableIndexConstraints;
|
|
1986
2054
|
var _this = this;
|
|
1987
|
-
return
|
|
2055
|
+
return __generator(this, function (_b) {
|
|
1988
2056
|
switch (_b.label) {
|
|
1989
2057
|
case 0:
|
|
1990
2058
|
table = new Table();
|
|
@@ -1995,10 +2063,10 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
1995
2063
|
_a = table;
|
|
1996
2064
|
return [4 /*yield*/, Promise.all(dbColumns
|
|
1997
2065
|
.filter(function (dbColumn) { return _this.driver.buildTableName(dbColumn["TABLE_NAME"], dbColumn["SCHEMA_NAME"]) === tableFullName; })
|
|
1998
|
-
.map(function (dbColumn) { return
|
|
2066
|
+
.map(function (dbColumn) { return __awaiter(_this, void 0, void 0, function () {
|
|
1999
2067
|
var columnConstraints, columnUniqueIndex, tableMetadata, hasIgnoredIndex, isConstraintComposite, tableColumn, length_1;
|
|
2000
2068
|
var _this = this;
|
|
2001
|
-
return
|
|
2069
|
+
return __generator(this, function (_a) {
|
|
2002
2070
|
columnConstraints = dbConstraints.filter(function (dbConstraint) {
|
|
2003
2071
|
return _this.driver.buildTableName(dbConstraint["TABLE_NAME"], dbConstraint["SCHEMA_NAME"]) === tableFullName && dbConstraint["COLUMN_NAME"] === dbColumn["COLUMN_NAME"];
|
|
2004
2072
|
});
|
|
@@ -2224,9 +2292,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2224
2292
|
}
|
|
2225
2293
|
};
|
|
2226
2294
|
SapQueryRunner.prototype.insertViewDefinitionSql = function (view) {
|
|
2227
|
-
return
|
|
2295
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2228
2296
|
var currentSchema, splittedName, schema, name, expression, _a, query, parameters;
|
|
2229
|
-
return
|
|
2297
|
+
return __generator(this, function (_b) {
|
|
2230
2298
|
switch (_b.label) {
|
|
2231
2299
|
case 0: return [4 /*yield*/, this.getCurrentSchema()];
|
|
2232
2300
|
case 1:
|
|
@@ -2239,7 +2307,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2239
2307
|
name = splittedName[1];
|
|
2240
2308
|
}
|
|
2241
2309
|
expression = typeof view.expression === "string" ? view.expression.trim() : view.expression(this.connection).getQuery();
|
|
2242
|
-
_a =
|
|
2310
|
+
_a = __read(this.connection.createQueryBuilder()
|
|
2243
2311
|
.insert()
|
|
2244
2312
|
.into(this.getTypeormMetadataTableName())
|
|
2245
2313
|
.values({ type: "VIEW", schema: schema, name: name, value: expression })
|
|
@@ -2259,9 +2327,9 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2259
2327
|
* Builds remove view sql.
|
|
2260
2328
|
*/
|
|
2261
2329
|
SapQueryRunner.prototype.deleteViewDefinitionSql = function (viewOrPath) {
|
|
2262
|
-
return
|
|
2330
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2263
2331
|
var currentSchema, viewName, splittedName, schema, name, qb, _a, query, parameters;
|
|
2264
|
-
return
|
|
2332
|
+
return __generator(this, function (_b) {
|
|
2265
2333
|
switch (_b.label) {
|
|
2266
2334
|
case 0: return [4 /*yield*/, this.getCurrentSchema()];
|
|
2267
2335
|
case 1:
|
|
@@ -2275,7 +2343,7 @@ var SapQueryRunner = /** @class */ (function (_super) {
|
|
|
2275
2343
|
name = splittedName[1];
|
|
2276
2344
|
}
|
|
2277
2345
|
qb = this.connection.createQueryBuilder();
|
|
2278
|
-
_a =
|
|
2346
|
+
_a = __read(qb.delete()
|
|
2279
2347
|
.from(this.getTypeormMetadataTableName())
|
|
2280
2348
|
.where(qb.escape("type") + " = 'VIEW'")
|
|
2281
2349
|
.andWhere(qb.escape("schema") + " = :schema", { schema: schema })
|