typeorm 0.2.42-dev.93bf96e → 0.2.42-dev.9e844d9

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.
Files changed (145) hide show
  1. package/browser/connection/BaseConnectionOptions.js.map +1 -1
  2. package/browser/connection/Connection.js +33 -24
  3. package/browser/connection/Connection.js.map +1 -1
  4. package/browser/connection/ConnectionOptionsReader.js +3 -1
  5. package/browser/connection/ConnectionOptionsReader.js.map +1 -1
  6. package/browser/driver/better-sqlite3/BetterSqlite3Driver.d.ts +14 -1
  7. package/browser/driver/better-sqlite3/BetterSqlite3Driver.js +87 -4
  8. package/browser/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
  9. package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.d.ts +10 -0
  10. package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js +64 -1
  11. package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
  12. package/browser/driver/capacitor/CapacitorQueryRunner.d.ts +8 -0
  13. package/browser/driver/capacitor/CapacitorQueryRunner.js +30 -0
  14. package/browser/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
  15. package/browser/driver/cordova/CordovaQueryRunner.d.ts +8 -0
  16. package/browser/driver/cordova/CordovaQueryRunner.js +30 -0
  17. package/browser/driver/cordova/CordovaQueryRunner.js.map +1 -1
  18. package/browser/driver/expo/ExpoQueryRunner.d.ts +8 -0
  19. package/browser/driver/expo/ExpoQueryRunner.js +30 -0
  20. package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
  21. package/browser/driver/mongodb/MongoQueryRunner.d.ts +8 -0
  22. package/browser/driver/mongodb/MongoQueryRunner.js +20 -0
  23. package/browser/driver/mongodb/MongoQueryRunner.js.map +1 -1
  24. package/browser/driver/nativescript/NativescriptQueryRunner.d.ts +8 -0
  25. package/browser/driver/nativescript/NativescriptQueryRunner.js +30 -0
  26. package/browser/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
  27. package/browser/driver/react-native/ReactNativeQueryRunner.d.ts +8 -0
  28. package/browser/driver/react-native/ReactNativeQueryRunner.js +30 -0
  29. package/browser/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
  30. package/browser/driver/sqlite/SqliteDriver.d.ts +13 -0
  31. package/browser/driver/sqlite/SqliteDriver.js +84 -1
  32. package/browser/driver/sqlite/SqliteDriver.js.map +1 -1
  33. package/browser/driver/sqlite/SqliteQueryRunner.d.ts +8 -0
  34. package/browser/driver/sqlite/SqliteQueryRunner.js +30 -0
  35. package/browser/driver/sqlite/SqliteQueryRunner.js.map +1 -1
  36. package/browser/driver/sqlite-abstract/AbstractSqliteDriver.d.ts +13 -0
  37. package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js +25 -2
  38. package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
  39. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.d.ts +11 -1
  40. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +116 -55
  41. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
  42. package/browser/driver/sqljs/SqljsQueryRunner.d.ts +8 -0
  43. package/browser/driver/sqljs/SqljsQueryRunner.js +30 -0
  44. package/browser/driver/sqljs/SqljsQueryRunner.js.map +1 -1
  45. package/browser/metadata-builder/EntityMetadataValidator.js +1 -1
  46. package/browser/metadata-builder/EntityMetadataValidator.js.map +1 -1
  47. package/browser/migration/MigrationExecutor.js +37 -25
  48. package/browser/migration/MigrationExecutor.js.map +1 -1
  49. package/browser/persistence/SubjectExecutor.d.ts +2 -0
  50. package/browser/persistence/SubjectExecutor.js +99 -7
  51. package/browser/persistence/SubjectExecutor.js.map +1 -1
  52. package/browser/persistence/tree/MaterializedPathSubjectExecutor.js +1 -1
  53. package/browser/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
  54. package/browser/query-builder/InsertQueryBuilder.js +9 -0
  55. package/browser/query-builder/InsertQueryBuilder.js.map +1 -1
  56. package/browser/query-builder/relation-id/RelationIdLoader.js +9 -9
  57. package/browser/query-builder/relation-id/RelationIdLoader.js.map +1 -1
  58. package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.d.ts +13 -0
  59. package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js +94 -50
  60. package/browser/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
  61. package/browser/query-runner/BaseQueryRunner.d.ts +8 -0
  62. package/browser/query-runner/BaseQueryRunner.js +20 -0
  63. package/browser/query-runner/BaseQueryRunner.js.map +1 -1
  64. package/browser/query-runner/QueryRunner.d.ts +8 -0
  65. package/browser/query-runner/QueryRunner.js.map +1 -1
  66. package/browser/schema-builder/RdbmsSchemaBuilder.js +36 -30
  67. package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
  68. package/browser/subscriber/Broadcaster.js +35 -31
  69. package/browser/subscriber/Broadcaster.js.map +1 -1
  70. package/browser/util/PathUtils.d.ts +10 -0
  71. package/browser/util/PathUtils.js +28 -0
  72. package/browser/util/PathUtils.js.map +1 -0
  73. package/connection/BaseConnectionOptions.js.map +1 -1
  74. package/connection/Connection.js +33 -24
  75. package/connection/Connection.js.map +1 -1
  76. package/connection/ConnectionOptionsReader.js +3 -1
  77. package/connection/ConnectionOptionsReader.js.map +1 -1
  78. package/driver/better-sqlite3/BetterSqlite3Driver.d.ts +14 -1
  79. package/driver/better-sqlite3/BetterSqlite3Driver.js +86 -3
  80. package/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
  81. package/driver/better-sqlite3/BetterSqlite3QueryRunner.d.ts +10 -0
  82. package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +63 -0
  83. package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
  84. package/driver/capacitor/CapacitorQueryRunner.d.ts +8 -0
  85. package/driver/capacitor/CapacitorQueryRunner.js +30 -0
  86. package/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
  87. package/driver/cordova/CordovaQueryRunner.d.ts +8 -0
  88. package/driver/cordova/CordovaQueryRunner.js +30 -0
  89. package/driver/cordova/CordovaQueryRunner.js.map +1 -1
  90. package/driver/expo/ExpoQueryRunner.d.ts +8 -0
  91. package/driver/expo/ExpoQueryRunner.js +30 -0
  92. package/driver/expo/ExpoQueryRunner.js.map +1 -1
  93. package/driver/mongodb/MongoQueryRunner.d.ts +8 -0
  94. package/driver/mongodb/MongoQueryRunner.js +20 -0
  95. package/driver/mongodb/MongoQueryRunner.js.map +1 -1
  96. package/driver/nativescript/NativescriptQueryRunner.d.ts +8 -0
  97. package/driver/nativescript/NativescriptQueryRunner.js +30 -0
  98. package/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
  99. package/driver/react-native/ReactNativeQueryRunner.d.ts +8 -0
  100. package/driver/react-native/ReactNativeQueryRunner.js +30 -0
  101. package/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
  102. package/driver/sqlite/SqliteDriver.d.ts +13 -0
  103. package/driver/sqlite/SqliteDriver.js +83 -0
  104. package/driver/sqlite/SqliteDriver.js.map +1 -1
  105. package/driver/sqlite/SqliteQueryRunner.d.ts +8 -0
  106. package/driver/sqlite/SqliteQueryRunner.js +30 -0
  107. package/driver/sqlite/SqliteQueryRunner.js.map +1 -1
  108. package/driver/sqlite-abstract/AbstractSqliteDriver.d.ts +13 -0
  109. package/driver/sqlite-abstract/AbstractSqliteDriver.js +25 -2
  110. package/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
  111. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.d.ts +11 -1
  112. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +116 -55
  113. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
  114. package/driver/sqljs/SqljsQueryRunner.d.ts +8 -0
  115. package/driver/sqljs/SqljsQueryRunner.js +30 -0
  116. package/driver/sqljs/SqljsQueryRunner.js.map +1 -1
  117. package/metadata-builder/EntityMetadataValidator.js +1 -1
  118. package/metadata-builder/EntityMetadataValidator.js.map +1 -1
  119. package/migration/MigrationExecutor.js +37 -25
  120. package/migration/MigrationExecutor.js.map +1 -1
  121. package/package.json +1 -1
  122. package/persistence/SubjectExecutor.d.ts +2 -0
  123. package/persistence/SubjectExecutor.js +99 -7
  124. package/persistence/SubjectExecutor.js.map +1 -1
  125. package/persistence/tree/MaterializedPathSubjectExecutor.js +1 -1
  126. package/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
  127. package/query-builder/InsertQueryBuilder.js +9 -0
  128. package/query-builder/InsertQueryBuilder.js.map +1 -1
  129. package/query-builder/relation-id/RelationIdLoader.js +9 -9
  130. package/query-builder/relation-id/RelationIdLoader.js.map +1 -1
  131. package/query-builder/transformer/RawSqlResultsToEntityTransformer.d.ts +13 -0
  132. package/query-builder/transformer/RawSqlResultsToEntityTransformer.js +94 -50
  133. package/query-builder/transformer/RawSqlResultsToEntityTransformer.js.map +1 -1
  134. package/query-runner/BaseQueryRunner.d.ts +8 -0
  135. package/query-runner/BaseQueryRunner.js +20 -0
  136. package/query-runner/BaseQueryRunner.js.map +1 -1
  137. package/query-runner/QueryRunner.d.ts +8 -0
  138. package/query-runner/QueryRunner.js.map +1 -1
  139. package/schema-builder/RdbmsSchemaBuilder.js +36 -30
  140. package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
  141. package/subscriber/Broadcaster.js +35 -31
  142. package/subscriber/Broadcaster.js.map +1 -1
  143. package/util/PathUtils.d.ts +10 -0
  144. package/util/PathUtils.js +34 -0
  145. package/util/PathUtils.js.map +1 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/query-runner/QueryRunner.ts"],"names":[],"mappings":"","file":"QueryRunner.js","sourcesContent":["import {TableColumn} from \"../schema-builder/table/TableColumn\";\nimport {Table} from \"../schema-builder/table/Table\";\nimport {TableForeignKey} from \"../schema-builder/table/TableForeignKey\";\nimport {TableIndex} from \"../schema-builder/table/TableIndex\";\nimport {Connection} from \"../connection/Connection\";\nimport {ReadStream} from \"../platform/PlatformTools\";\nimport {EntityManager} from \"../entity-manager/EntityManager\";\nimport {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {SqlInMemory} from \"../driver/SqlInMemory\";\nimport {TableUnique} from \"../schema-builder/table/TableUnique\";\nimport {View} from \"../schema-builder/view/View\";\nimport {Broadcaster} from \"../subscriber/Broadcaster\";\nimport {TableCheck} from \"../schema-builder/table/TableCheck\";\nimport {IsolationLevel} from \"../driver/types/IsolationLevel\";\nimport {TableExclusion} from \"../schema-builder/table/TableExclusion\";\nimport {QueryResult} from \"./QueryResult\";\nimport {ReplicationMode} from \"../driver/types/ReplicationMode\";\n\n/**\n * Runs queries on a single database connection.\n */\nexport interface QueryRunner {\n\n /**\n * Connection used by this query runner.\n */\n readonly connection: Connection;\n\n /**\n * Broadcaster used on this query runner to broadcast entity events.\n */\n readonly broadcaster: Broadcaster;\n\n /**\n * Entity manager working only with this query runner.\n */\n readonly manager: EntityManager;\n\n /**\n * Indicates if connection for this query runner is released.\n * Once its released, query runner cannot run queries anymore.\n */\n readonly isReleased: boolean;\n\n /**\n * Indicates if transaction is in progress.\n */\n readonly isTransactionActive: boolean;\n\n /**\n * Stores temporarily user data.\n * Useful for sharing data with subscribers.\n */\n data: ObjectLiteral;\n\n /**\n * All synchronized tables in the database.\n *\n * @deprecated Call `getTables()`\n */\n loadedTables: Table[];\n\n /**\n * All synchronized views in the database.\n *\n * @deprecated Call `getViews()`\n */\n loadedViews: View[];\n\n /**\n * Creates/uses database connection from the connection pool to perform further operations.\n * Returns obtained database connection.\n */\n connect(): Promise<any>;\n\n /**\n * Releases used database connection.\n * You cannot use query runner methods after connection is released.\n */\n release(): Promise<void>;\n\n /**\n * Removes all tables from the currently connected database.\n * Be careful with using this method and avoid using it in production or migrations\n * (because it can clear all your database).\n */\n clearDatabase(database?: string): Promise<void>;\n\n /**\n * Starts transaction.\n */\n startTransaction(isolationLevel?: IsolationLevel): Promise<void>;\n\n /**\n * Commits transaction.\n * Error will be thrown if transaction was not started.\n */\n commitTransaction(): Promise<void>;\n\n /**\n * Rollbacks transaction.\n * Error will be thrown if transaction was not started.\n */\n rollbackTransaction(): Promise<void>;\n\n /**\n * Executes a given SQL query and returns raw database results.\n */\n query(query: string, parameters: any[] | undefined, useStructuredResult: true): Promise<QueryResult>;\n\n /**\n * Executes a given SQL query and returns raw database results.\n */\n query(query: string, parameters?: any[]): Promise<any>;\n\n /**\n * Returns raw data stream.\n */\n stream(query: string, parameters?: any[], onEnd?: Function, onError?: Function): Promise<ReadStream>;\n\n /**\n * Returns all available database names including system databases.\n */\n getDatabases(): Promise<string[]>;\n\n /**\n * Returns all available schema names including system schemas.\n * If database parameter specified, returns schemas of that database.\n * Useful for SQLServer and Postgres only.\n */\n getSchemas(database?: string): Promise<string[]>;\n\n /**\n * Loads a table by a given name from the database.\n */\n getTable(tablePath: string): Promise<Table|undefined>;\n\n /**\n * Loads all tables from the database and returns them.\n */\n getTables(tablePaths?: string[]): Promise<Table[]>;\n\n /**\n * Loads a view by a given name from the database.\n */\n getView(viewPath: string): Promise<View|undefined>;\n\n /**\n * Loads all views from the database and returns them.\n */\n getViews(viewPaths?: string[]): Promise<View[]>;\n\n /**\n * Returns replication mode (ex: `master` or `slave`).\n */\n getReplicationMode(): ReplicationMode;\n\n /**\n * Checks if a database with the given name exist.\n */\n hasDatabase(database: string): Promise<boolean>;\n\n /**\n * Loads currently using database\n */\n getCurrentDatabase(): Promise<string|undefined>;\n\n /**\n * Checks if a schema with the given name exist.\n */\n hasSchema(schema: string): Promise<boolean>;\n\n /**\n * Loads currently using database schema\n */\n getCurrentSchema(): Promise<string|undefined>;\n\n /**\n * Checks if a table with the given name exist.\n */\n hasTable(table: Table|string): Promise<boolean>;\n\n /**\n * Checks if a column exist in the table.\n */\n hasColumn(table: Table|string, columnName: string): Promise<boolean>;\n\n /**\n * Creates a new database.\n */\n createDatabase(database: string, ifNotExist?: boolean): Promise<void>;\n\n /**\n * Drops database.\n */\n dropDatabase(database: string, ifExist?: boolean): Promise<void>;\n\n /**\n * Creates a new table schema.\n */\n createSchema(schemaPath: string, ifNotExist?: boolean): Promise<void>;\n\n /**\n * Drops table schema.\n * For SqlServer can accept schema path (e.g. 'dbName.schemaName') as parameter.\n * If schema path passed, it will drop schema in specified database.\n */\n dropSchema(schemaPath: string, ifExist?: boolean, isCascade?: boolean): Promise<void>;\n\n /**\n * Creates a new table.\n */\n createTable(table: Table, ifNotExist?: boolean, createForeignKeys?: boolean, createIndices?: boolean): Promise<void>;\n\n /**\n * Drops a table.\n */\n dropTable(table: Table|string, ifExist?: boolean, dropForeignKeys?: boolean, dropIndices?: boolean): Promise<void>;\n\n /**\n * Creates a new view.\n */\n createView(view: View, oldView?: View): Promise<void>;\n\n /**\n * Drops a view.\n */\n dropView(view: View|string): Promise<void>;\n\n /**\n * Renames a table.\n */\n renameTable(oldTableOrName: Table|string, newTableName: string): Promise<void>;\n\n /**\n * Adds a new column.\n */\n addColumn(table: Table|string, column: TableColumn): Promise<void>;\n\n /**\n * Adds new columns.\n */\n addColumns(table: Table|string, columns: TableColumn[]): Promise<void>;\n\n /**\n * Renames a column.\n */\n renameColumn(table: Table|string, oldColumnOrName: TableColumn|string, newColumnOrName: TableColumn|string): Promise<void>;\n\n /**\n * Changes a column in the table.\n */\n changeColumn(table: Table|string, oldColumn: TableColumn|string, newColumn: TableColumn): Promise<void>;\n\n /**\n * Changes columns in the table.\n */\n changeColumns(table: Table|string, changedColumns: { oldColumn: TableColumn, newColumn: TableColumn }[]): Promise<void>;\n\n /**\n * Drops a column in the table.\n */\n dropColumn(table: Table|string, column: TableColumn|string): Promise<void>;\n\n /**\n * Drops columns in the table.\n */\n dropColumns(table: Table|string, columns: TableColumn[]|string[]): Promise<void>;\n\n /**\n * Creates a new primary key.\n */\n createPrimaryKey(table: Table|string, columnNames: string[]): Promise<void>;\n\n /**\n * Updates composite primary keys.\n */\n updatePrimaryKeys(table: Table|string, columns: TableColumn[]): Promise<void>;\n\n /**\n * Drops a primary key.\n */\n dropPrimaryKey(table: Table|string): Promise<void>;\n\n /**\n * Creates a new unique constraint.\n */\n createUniqueConstraint(table: Table|string, uniqueConstraint: TableUnique): Promise<void>;\n\n /**\n * Creates new unique constraints.\n */\n createUniqueConstraints(table: Table|string, uniqueConstraints: TableUnique[]): Promise<void>;\n\n /**\n * Drops an unique constraint.\n */\n dropUniqueConstraint(table: Table|string, uniqueOrName: TableUnique|string): Promise<void>;\n\n /**\n * Drops unique constraints.\n */\n dropUniqueConstraints(table: Table|string, uniqueConstraints: TableUnique[]): Promise<void>;\n\n /**\n * Creates a new check constraint.\n */\n createCheckConstraint(table: Table|string, checkConstraint: TableCheck): Promise<void>;\n\n /**\n * Creates new check constraints.\n */\n createCheckConstraints(table: Table|string, checkConstraints: TableCheck[]): Promise<void>;\n\n /**\n * Drops a check constraint.\n */\n dropCheckConstraint(table: Table|string, checkOrName: TableCheck|string): Promise<void>;\n\n /**\n * Drops check constraints.\n */\n dropCheckConstraints(table: Table|string, checkConstraints: TableCheck[]): Promise<void>;\n\n /**\n * Creates a new exclusion constraint.\n */\n createExclusionConstraint(table: Table|string, exclusionConstraint: TableExclusion): Promise<void>;\n\n /**\n * Creates new exclusion constraints.\n */\n createExclusionConstraints(table: Table|string, exclusionConstraints: TableExclusion[]): Promise<void>;\n\n /**\n * Drops a exclusion constraint.\n */\n dropExclusionConstraint(table: Table|string, exclusionOrName: TableExclusion|string): Promise<void>;\n\n /**\n * Drops exclusion constraints.\n */\n dropExclusionConstraints(table: Table|string, exclusionConstraints: TableExclusion[]): Promise<void>;\n\n /**\n * Creates a new foreign key.\n */\n createForeignKey(table: Table|string, foreignKey: TableForeignKey): Promise<void>;\n\n /**\n * Creates new foreign keys.\n */\n createForeignKeys(table: Table|string, foreignKeys: TableForeignKey[]): Promise<void>;\n\n /**\n * Drops a foreign key.\n */\n dropForeignKey(table: Table|string, foreignKeyOrName: TableForeignKey|string): Promise<void>;\n\n /**\n * Drops foreign keys.\n */\n dropForeignKeys(table: Table|string, foreignKeys: TableForeignKey[]): Promise<void>;\n\n /**\n * Creates a new index.\n */\n createIndex(table: Table|string, index: TableIndex): Promise<void>;\n\n /**\n * Creates new indices.\n */\n createIndices(table: Table|string, indices: TableIndex[]): Promise<void>;\n\n /**\n * Drops an index.\n */\n dropIndex(table: Table|string, index: TableIndex|string): Promise<void>;\n\n /**\n * Drops indices.\n */\n dropIndices(table: Table|string, indices: TableIndex[]): Promise<void>;\n\n /**\n * Clears all table contents.\n * Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.\n */\n clearTable(tableName: string): Promise<void>;\n\n /**\n * Enables special query runner mode in which sql queries won't be executed,\n * instead they will be memorized into a special variable inside query runner.\n * You can get memorized sql using getMemorySql() method.\n */\n enableSqlMemory(): void;\n\n /**\n * Disables special query runner mode in which sql queries won't be executed\n * started by calling enableSqlMemory() method.\n *\n * Previously memorized sql will be flushed.\n */\n disableSqlMemory(): void;\n\n /**\n * Flushes all memorized sqls.\n */\n clearSqlMemory(): void;\n\n /**\n * Gets sql stored in the memory. Parameters in the sql are already replaced.\n */\n getMemorySql(): SqlInMemory;\n\n /**\n * Executes up sql queries.\n */\n executeMemoryUpSql(): Promise<void>;\n\n /**\n * Executes down sql queries.\n */\n executeMemoryDownSql(): Promise<void>;\n\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/query-runner/QueryRunner.ts"],"names":[],"mappings":"","file":"QueryRunner.js","sourcesContent":["import {TableColumn} from \"../schema-builder/table/TableColumn\";\nimport {Table} from \"../schema-builder/table/Table\";\nimport {TableForeignKey} from \"../schema-builder/table/TableForeignKey\";\nimport {TableIndex} from \"../schema-builder/table/TableIndex\";\nimport {Connection} from \"../connection/Connection\";\nimport {ReadStream} from \"../platform/PlatformTools\";\nimport {EntityManager} from \"../entity-manager/EntityManager\";\nimport {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {SqlInMemory} from \"../driver/SqlInMemory\";\nimport {TableUnique} from \"../schema-builder/table/TableUnique\";\nimport {View} from \"../schema-builder/view/View\";\nimport {Broadcaster} from \"../subscriber/Broadcaster\";\nimport {TableCheck} from \"../schema-builder/table/TableCheck\";\nimport {IsolationLevel} from \"../driver/types/IsolationLevel\";\nimport {TableExclusion} from \"../schema-builder/table/TableExclusion\";\nimport {QueryResult} from \"./QueryResult\";\nimport {ReplicationMode} from \"../driver/types/ReplicationMode\";\n\n/**\n * Runs queries on a single database connection.\n */\nexport interface QueryRunner {\n\n /**\n * Connection used by this query runner.\n */\n readonly connection: Connection;\n\n /**\n * Broadcaster used on this query runner to broadcast entity events.\n */\n readonly broadcaster: Broadcaster;\n\n /**\n * Entity manager working only with this query runner.\n */\n readonly manager: EntityManager;\n\n /**\n * Indicates if connection for this query runner is released.\n * Once its released, query runner cannot run queries anymore.\n */\n readonly isReleased: boolean;\n\n /**\n * Indicates if transaction is in progress.\n */\n readonly isTransactionActive: boolean;\n\n /**\n * Stores temporarily user data.\n * Useful for sharing data with subscribers.\n */\n data: ObjectLiteral;\n\n /**\n * All synchronized tables in the database.\n *\n * @deprecated Call `getTables()`\n */\n loadedTables: Table[];\n\n /**\n * All synchronized views in the database.\n *\n * @deprecated Call `getViews()`\n */\n loadedViews: View[];\n\n /**\n * Creates/uses database connection from the connection pool to perform further operations.\n * Returns obtained database connection.\n */\n connect(): Promise<any>;\n\n /**\n * Called before migrations are run.\n */\n beforeMigration(): Promise<void>;\n\n /**\n * Called after migrations are run.\n */\n afterMigration(): Promise<void>;\n\n /**\n * Releases used database connection.\n * You cannot use query runner methods after connection is released.\n */\n release(): Promise<void>;\n\n /**\n * Removes all tables from the currently connected database.\n * Be careful with using this method and avoid using it in production or migrations\n * (because it can clear all your database).\n */\n clearDatabase(database?: string): Promise<void>;\n\n /**\n * Starts transaction.\n */\n startTransaction(isolationLevel?: IsolationLevel): Promise<void>;\n\n /**\n * Commits transaction.\n * Error will be thrown if transaction was not started.\n */\n commitTransaction(): Promise<void>;\n\n /**\n * Rollbacks transaction.\n * Error will be thrown if transaction was not started.\n */\n rollbackTransaction(): Promise<void>;\n\n /**\n * Executes a given SQL query and returns raw database results.\n */\n query(query: string, parameters: any[] | undefined, useStructuredResult: true): Promise<QueryResult>;\n\n /**\n * Executes a given SQL query and returns raw database results.\n */\n query(query: string, parameters?: any[]): Promise<any>;\n\n /**\n * Returns raw data stream.\n */\n stream(query: string, parameters?: any[], onEnd?: Function, onError?: Function): Promise<ReadStream>;\n\n /**\n * Returns all available database names including system databases.\n */\n getDatabases(): Promise<string[]>;\n\n /**\n * Returns all available schema names including system schemas.\n * If database parameter specified, returns schemas of that database.\n * Useful for SQLServer and Postgres only.\n */\n getSchemas(database?: string): Promise<string[]>;\n\n /**\n * Loads a table by a given name from the database.\n */\n getTable(tablePath: string): Promise<Table|undefined>;\n\n /**\n * Loads all tables from the database and returns them.\n */\n getTables(tablePaths?: string[]): Promise<Table[]>;\n\n /**\n * Loads a view by a given name from the database.\n */\n getView(viewPath: string): Promise<View|undefined>;\n\n /**\n * Loads all views from the database and returns them.\n */\n getViews(viewPaths?: string[]): Promise<View[]>;\n\n /**\n * Returns replication mode (ex: `master` or `slave`).\n */\n getReplicationMode(): ReplicationMode;\n\n /**\n * Checks if a database with the given name exist.\n */\n hasDatabase(database: string): Promise<boolean>;\n\n /**\n * Loads currently using database\n */\n getCurrentDatabase(): Promise<string|undefined>;\n\n /**\n * Checks if a schema with the given name exist.\n */\n hasSchema(schema: string): Promise<boolean>;\n\n /**\n * Loads currently using database schema\n */\n getCurrentSchema(): Promise<string|undefined>;\n\n /**\n * Checks if a table with the given name exist.\n */\n hasTable(table: Table|string): Promise<boolean>;\n\n /**\n * Checks if a column exist in the table.\n */\n hasColumn(table: Table|string, columnName: string): Promise<boolean>;\n\n /**\n * Creates a new database.\n */\n createDatabase(database: string, ifNotExist?: boolean): Promise<void>;\n\n /**\n * Drops database.\n */\n dropDatabase(database: string, ifExist?: boolean): Promise<void>;\n\n /**\n * Creates a new table schema.\n */\n createSchema(schemaPath: string, ifNotExist?: boolean): Promise<void>;\n\n /**\n * Drops table schema.\n * For SqlServer can accept schema path (e.g. 'dbName.schemaName') as parameter.\n * If schema path passed, it will drop schema in specified database.\n */\n dropSchema(schemaPath: string, ifExist?: boolean, isCascade?: boolean): Promise<void>;\n\n /**\n * Creates a new table.\n */\n createTable(table: Table, ifNotExist?: boolean, createForeignKeys?: boolean, createIndices?: boolean): Promise<void>;\n\n /**\n * Drops a table.\n */\n dropTable(table: Table|string, ifExist?: boolean, dropForeignKeys?: boolean, dropIndices?: boolean): Promise<void>;\n\n /**\n * Creates a new view.\n */\n createView(view: View, oldView?: View): Promise<void>;\n\n /**\n * Drops a view.\n */\n dropView(view: View|string): Promise<void>;\n\n /**\n * Renames a table.\n */\n renameTable(oldTableOrName: Table|string, newTableName: string): Promise<void>;\n\n /**\n * Adds a new column.\n */\n addColumn(table: Table|string, column: TableColumn): Promise<void>;\n\n /**\n * Adds new columns.\n */\n addColumns(table: Table|string, columns: TableColumn[]): Promise<void>;\n\n /**\n * Renames a column.\n */\n renameColumn(table: Table|string, oldColumnOrName: TableColumn|string, newColumnOrName: TableColumn|string): Promise<void>;\n\n /**\n * Changes a column in the table.\n */\n changeColumn(table: Table|string, oldColumn: TableColumn|string, newColumn: TableColumn): Promise<void>;\n\n /**\n * Changes columns in the table.\n */\n changeColumns(table: Table|string, changedColumns: { oldColumn: TableColumn, newColumn: TableColumn }[]): Promise<void>;\n\n /**\n * Drops a column in the table.\n */\n dropColumn(table: Table|string, column: TableColumn|string): Promise<void>;\n\n /**\n * Drops columns in the table.\n */\n dropColumns(table: Table|string, columns: TableColumn[]|string[]): Promise<void>;\n\n /**\n * Creates a new primary key.\n */\n createPrimaryKey(table: Table|string, columnNames: string[]): Promise<void>;\n\n /**\n * Updates composite primary keys.\n */\n updatePrimaryKeys(table: Table|string, columns: TableColumn[]): Promise<void>;\n\n /**\n * Drops a primary key.\n */\n dropPrimaryKey(table: Table|string): Promise<void>;\n\n /**\n * Creates a new unique constraint.\n */\n createUniqueConstraint(table: Table|string, uniqueConstraint: TableUnique): Promise<void>;\n\n /**\n * Creates new unique constraints.\n */\n createUniqueConstraints(table: Table|string, uniqueConstraints: TableUnique[]): Promise<void>;\n\n /**\n * Drops an unique constraint.\n */\n dropUniqueConstraint(table: Table|string, uniqueOrName: TableUnique|string): Promise<void>;\n\n /**\n * Drops unique constraints.\n */\n dropUniqueConstraints(table: Table|string, uniqueConstraints: TableUnique[]): Promise<void>;\n\n /**\n * Creates a new check constraint.\n */\n createCheckConstraint(table: Table|string, checkConstraint: TableCheck): Promise<void>;\n\n /**\n * Creates new check constraints.\n */\n createCheckConstraints(table: Table|string, checkConstraints: TableCheck[]): Promise<void>;\n\n /**\n * Drops a check constraint.\n */\n dropCheckConstraint(table: Table|string, checkOrName: TableCheck|string): Promise<void>;\n\n /**\n * Drops check constraints.\n */\n dropCheckConstraints(table: Table|string, checkConstraints: TableCheck[]): Promise<void>;\n\n /**\n * Creates a new exclusion constraint.\n */\n createExclusionConstraint(table: Table|string, exclusionConstraint: TableExclusion): Promise<void>;\n\n /**\n * Creates new exclusion constraints.\n */\n createExclusionConstraints(table: Table|string, exclusionConstraints: TableExclusion[]): Promise<void>;\n\n /**\n * Drops a exclusion constraint.\n */\n dropExclusionConstraint(table: Table|string, exclusionOrName: TableExclusion|string): Promise<void>;\n\n /**\n * Drops exclusion constraints.\n */\n dropExclusionConstraints(table: Table|string, exclusionConstraints: TableExclusion[]): Promise<void>;\n\n /**\n * Creates a new foreign key.\n */\n createForeignKey(table: Table|string, foreignKey: TableForeignKey): Promise<void>;\n\n /**\n * Creates new foreign keys.\n */\n createForeignKeys(table: Table|string, foreignKeys: TableForeignKey[]): Promise<void>;\n\n /**\n * Drops a foreign key.\n */\n dropForeignKey(table: Table|string, foreignKeyOrName: TableForeignKey|string): Promise<void>;\n\n /**\n * Drops foreign keys.\n */\n dropForeignKeys(table: Table|string, foreignKeys: TableForeignKey[]): Promise<void>;\n\n /**\n * Creates a new index.\n */\n createIndex(table: Table|string, index: TableIndex): Promise<void>;\n\n /**\n * Creates new indices.\n */\n createIndices(table: Table|string, indices: TableIndex[]): Promise<void>;\n\n /**\n * Drops an index.\n */\n dropIndex(table: Table|string, index: TableIndex|string): Promise<void>;\n\n /**\n * Drops indices.\n */\n dropIndices(table: Table|string, indices: TableIndex[]): Promise<void>;\n\n /**\n * Clears all table contents.\n * Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.\n */\n clearTable(tableName: string): Promise<void>;\n\n /**\n * Enables special query runner mode in which sql queries won't be executed,\n * instead they will be memorized into a special variable inside query runner.\n * You can get memorized sql using getMemorySql() method.\n */\n enableSqlMemory(): void;\n\n /**\n * Disables special query runner mode in which sql queries won't be executed\n * started by calling enableSqlMemory() method.\n *\n * Previously memorized sql will be flushed.\n */\n disableSqlMemory(): void;\n\n /**\n * Flushes all memorized sqls.\n */\n clearSqlMemory(): void;\n\n /**\n * Gets sql stored in the memory. Parameters in the sql are already replaced.\n */\n getMemorySql(): SqlInMemory;\n\n /**\n * Executes up sql queries.\n */\n executeMemoryUpSql(): Promise<void>;\n\n /**\n * Executes down sql queries.\n */\n executeMemoryDownSql(): Promise<void>;\n\n}\n"],"sourceRoot":".."}
@@ -56,58 +56,64 @@ var RdbmsSchemaBuilder = /** @class */ (function () {
56
56
  this.currentSchema = this.connection.driver.schema;
57
57
  isUsingTransactions = (!(this.connection.driver instanceof CockroachDriver_1.CockroachDriver) &&
58
58
  this.connection.options.migrationsTransactionMode !== "none");
59
- if (!isUsingTransactions) return [3 /*break*/, 2];
60
- return [4 /*yield*/, this.queryRunner.startTransaction()];
59
+ return [4 /*yield*/, this.queryRunner.beforeMigration()];
61
60
  case 1:
62
61
  _a.sent();
63
- _a.label = 2;
62
+ if (!isUsingTransactions) return [3 /*break*/, 3];
63
+ return [4 /*yield*/, this.queryRunner.startTransaction()];
64
64
  case 2:
65
- _a.trys.push([2, 11, 17, 19]);
66
- return [4 /*yield*/, this.createMetadataTableIfNecessary(this.queryRunner)];
65
+ _a.sent();
66
+ _a.label = 3;
67
67
  case 3:
68
+ _a.trys.push([3, 12, 18, 21]);
69
+ return [4 /*yield*/, this.createMetadataTableIfNecessary(this.queryRunner)];
70
+ case 4:
68
71
  _a.sent();
69
72
  tablePaths = this.entityToSyncMetadatas.map(function (metadata) { return _this.getTablePath(metadata); });
70
73
  return [4 /*yield*/, this.queryRunner.getTables(tablePaths)];
71
- case 4:
72
- _a.sent();
73
- return [4 /*yield*/, this.queryRunner.getViews([])];
74
74
  case 5:
75
75
  _a.sent();
76
- return [4 /*yield*/, this.executeSchemaSyncOperationsInProperOrder()];
76
+ return [4 /*yield*/, this.queryRunner.getViews([])];
77
77
  case 6:
78
78
  _a.sent();
79
- if (!this.connection.queryResultCache) return [3 /*break*/, 8];
80
- return [4 /*yield*/, this.connection.queryResultCache.synchronize(this.queryRunner)];
79
+ return [4 /*yield*/, this.executeSchemaSyncOperationsInProperOrder()];
81
80
  case 7:
82
81
  _a.sent();
83
- _a.label = 8;
82
+ if (!this.connection.queryResultCache) return [3 /*break*/, 9];
83
+ return [4 /*yield*/, this.connection.queryResultCache.synchronize(this.queryRunner)];
84
84
  case 8:
85
- if (!isUsingTransactions) return [3 /*break*/, 10];
86
- return [4 /*yield*/, this.queryRunner.commitTransaction()];
85
+ _a.sent();
86
+ _a.label = 9;
87
87
  case 9:
88
+ if (!isUsingTransactions) return [3 /*break*/, 11];
89
+ return [4 /*yield*/, this.queryRunner.commitTransaction()];
90
+ case 10:
88
91
  _a.sent();
89
- _a.label = 10;
90
- case 10: return [3 /*break*/, 19];
91
- case 11:
92
- error_1 = _a.sent();
93
- _a.label = 12;
92
+ _a.label = 11;
93
+ case 11: return [3 /*break*/, 21];
94
94
  case 12:
95
- _a.trys.push([12, 15, , 16]);
96
- if (!isUsingTransactions) return [3 /*break*/, 14];
97
- return [4 /*yield*/, this.queryRunner.rollbackTransaction()];
95
+ error_1 = _a.sent();
96
+ _a.label = 13;
98
97
  case 13:
98
+ _a.trys.push([13, 16, , 17]);
99
+ if (!isUsingTransactions) return [3 /*break*/, 15];
100
+ return [4 /*yield*/, this.queryRunner.rollbackTransaction()];
101
+ case 14:
99
102
  _a.sent();
100
- _a.label = 14;
101
- case 14: return [3 /*break*/, 16];
102
- case 15:
103
+ _a.label = 15;
104
+ case 15: return [3 /*break*/, 17];
105
+ case 16:
103
106
  rollbackError_1 = _a.sent();
104
- return [3 /*break*/, 16];
105
- case 16: throw error_1;
106
- case 17: return [4 /*yield*/, this.queryRunner.release()];
107
- case 18:
107
+ return [3 /*break*/, 17];
108
+ case 17: throw error_1;
109
+ case 18: return [4 /*yield*/, this.queryRunner.afterMigration()];
110
+ case 19:
111
+ _a.sent();
112
+ return [4 /*yield*/, this.queryRunner.release()];
113
+ case 20:
108
114
  _a.sent();
109
115
  return [7 /*endfinally*/];
110
- case 19: return [2 /*return*/];
116
+ case 21: return [2 /*return*/];
111
117
  }
112
118
  });
113
119
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schema-builder/RdbmsSchemaBuilder.ts"],"names":[],"mappings":";;;;AAAA,yEAAsE;AACtE,uCAAoC;AACpC,mDAAgD;AAChD,2DAAwD;AACxD,iDAA8C;AAO9C,gDAA6C;AAE7C,oEAAiE;AACjE,2DAAwD;AACxD,mDAAgD;AAChD,iDAA8C;AAC9C,yDAAsD;AACtD,oCAAiC;AACjC,8CAA2C;AAC3C,qFAAkF;AAElF;;;;;;;;;;;;;GAaG;AACH;IAUI,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,4BAAsB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAC5C,CAAC;IAED,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACG,kCAAK,GAAX;;;;;;;wBACI,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;wBAEvD,2DAA2D;wBAC3D,IAAI,CAAC,eAAe,GAAG,IA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ACnB;oCACD;wCACI,IAAI,EAAE,MAAM;wCACZ,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,YAAY,EAAC,CAAC;wCACvG,UAAU,EAAE,IAAI;qCACnB;oCACD;wCACI,IAAI,EAAE,OAAO;wCACb,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,aAAa,EAAC,CAAC;wCACxG,UAAU,EAAE,IAAI;qCACnB;iCACJ;6BACJ,CACJ,EAAE,IAAI,CAAC,EAAA;;wBAtCR,SAsCQ,CAAC;;;;;KACZ;IACL,yBAAC;AAAD,CAz0BA,AAy0BC,IAAA;AAz0BY,gDAAkB","file":"RdbmsSchemaBuilder.js","sourcesContent":["import {CockroachDriver} from \"../driver/cockroachdb/CockroachDriver\";\nimport {Table} from \"./table/Table\";\nimport {TableColumn} from \"./table/TableColumn\";\nimport {TableForeignKey} from \"./table/TableForeignKey\";\nimport {TableIndex} from \"./table/TableIndex\";\nimport {QueryRunner} from \"../query-runner/QueryRunner\";\nimport {ColumnMetadata} from \"../metadata/ColumnMetadata\";\nimport {EntityMetadata} from \"../metadata/EntityMetadata\";\nimport {Connection} from \"../connection/Connection\";\nimport {SchemaBuilder} from \"./SchemaBuilder\";\nimport {SqlInMemory} from \"../driver/SqlInMemory\";\nimport {TableUtils} from \"./util/TableUtils\";\nimport {TableColumnOptions} from \"./options/TableColumnOptions\";\nimport {PostgresDriver} from \"../driver/postgres/PostgresDriver\";\nimport {MysqlDriver} from \"../driver/mysql/MysqlDriver\";\nimport {TableUnique} from \"./table/TableUnique\";\nimport {TableCheck} from \"./table/TableCheck\";\nimport {TableExclusion} from \"./table/TableExclusion\";\nimport {View} from \"./view/View\";\nimport {ViewUtils} from \"./util/ViewUtils\";\nimport {AuroraDataApiDriver} from \"../driver/aurora-data-api/AuroraDataApiDriver\";\n\n/**\n * Creates complete tables schemas in the database based on the entity metadatas.\n *\n * Steps how schema is being built:\n * 1. load list of all tables with complete column and keys information from the db\n * 2. drop all (old) foreign keys that exist in the table, but does not exist in the metadata\n * 3. create new tables that does not exist in the db, but exist in the metadata\n * 4. drop all columns exist (left old) in the db table, but does not exist in the metadata\n * 5. add columns from metadata which does not exist in the table\n * 6. update all exist columns which metadata has changed\n * 7. update primary keys - update old and create new primary key from changed columns\n * 8. create foreign keys which does not exist in the table yet\n * 9. create indices which are missing in db yet, and drops indices which exist in the db, but does not exist in the metadata anymore\n */\nexport class RdbmsSchemaBuilder implements SchemaBuilder {\n /**\n * Used to execute schema creation queries in a single connection.\n */\n protected queryRunner: QueryRunner;\n\n private currentDatabase?: string;\n\n private currentSchema?: string;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(protected connection: Connection) {\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates complete schemas for the given entity metadatas.\n */\n async build(): Promise<void> {\n this.queryRunner = this.connection.createQueryRunner();\n\n // this.connection.driver.database || this.currentDatabase;\n this.currentDatabase = this.connection.driver.database;\n this.currentSchema = this.connection.driver.schema;\n\n // CockroachDB implements asynchronous schema sync operations which can not been executed in transaction.\n // E.g. if you try to DROP column and ADD it again in the same transaction, crdb throws error.\n const isUsingTransactions = (\n !(this.connection.driver instanceof CockroachDriver) &&\n this.connection.options.migrationsTransactionMode !== \"none\"\n );\n\n if (isUsingTransactions) {\n await this.queryRunner.startTransaction();\n }\n\n try {\n await this.createMetadataTableIfNecessary(this.queryRunner);\n // Flush the queryrunner table & view cache\n const tablePaths = this.entityToSyncMetadatas.map(metadata => this.getTablePath(metadata));\n\n await this.queryRunner.getTables(tablePaths);\n await this.queryRunner.getViews([]);\n\n await this.executeSchemaSyncOperationsInProperOrder();\n\n // if cache is enabled then perform cache-synchronization as well\n if (this.connection.queryResultCache)\n await this.connection.queryResultCache.synchronize(this.queryRunner);\n\n if (isUsingTransactions) {\n await this.queryRunner.commitTransaction();\n }\n\n } catch (error) {\n\n try { // we throw original error even if rollback thrown an error\n if (isUsingTransactions) {\n await this.queryRunner.rollbackTransaction();\n }\n } catch (rollbackError) { }\n throw error;\n\n } finally {\n await this.queryRunner.release();\n }\n }\n\n /**\n * If the schema contains views, create the typeorm_metadata table if it doesn't exist yet\n */\n async createMetadataTableIfNecessary(queryRunner: QueryRunner): Promise<void> {\n if (this.viewEntityToSyncMetadatas.length > 0 || (this.connection.driver instanceof PostgresDriver && this.connection.driver.isGeneratedColumnsSupported)) {\n await this.createTypeormMetadataTable(queryRunner);\n }\n }\n\n /**\n * Returns sql queries to be executed by schema builder.\n */\n async log(): Promise<SqlInMemory> {\n this.queryRunner = this.connection.createQueryRunner();\n try {\n // Flush the queryrunner table & view cache\n const tablePaths = this.entityToSyncMetadatas.map(metadata => this.getTablePath(metadata));\n await this.queryRunner.getTables(tablePaths);\n await this.queryRunner.getViews([]);\n\n this.queryRunner.enableSqlMemory();\n await this.executeSchemaSyncOperationsInProperOrder();\n\n // if cache is enabled then perform cache-synchronization as well\n if (this.connection.queryResultCache) // todo: check this functionality\n await this.connection.queryResultCache.synchronize(this.queryRunner);\n\n return this.queryRunner.getMemorySql();\n\n } finally {\n // its important to disable this mode despite the fact we are release query builder\n // because there exist drivers which reuse same query runner. Also its important to disable\n // sql memory after call of getMemorySql() method because last one flushes sql memory.\n this.queryRunner.disableSqlMemory();\n await this.queryRunner.release();\n }\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Returns only entities that should be synced in the database.\n */\n protected get entityToSyncMetadatas(): EntityMetadata[] {\n return this.connection.entityMetadatas.filter(metadata => metadata.synchronize && metadata.tableType !== \"entity-child\" && metadata.tableType !== \"view\");\n }\n\n /**\n * Returns only entities that should be synced in the database.\n */\n protected get viewEntityToSyncMetadatas(): EntityMetadata[] {\n return this.connection.entityMetadatas\n .filter(metadata => metadata.tableType === \"view\" && metadata.synchronize)\n // sort views in creation order by dependencies\n .sort(ViewUtils.viewMetadataCmp);\n }\n\n /**\n * Executes schema sync operations in a proper order.\n * Order of operations matter here.\n */\n protected async executeSchemaSyncOperationsInProperOrder(): Promise<void> {\n await this.dropOldViews();\n await this.dropOldForeignKeys();\n await this.dropOldIndices();\n await this.dropOldChecks();\n await this.dropOldExclusions();\n await this.dropCompositeUniqueConstraints();\n // await this.renameTables();\n await this.renameColumns();\n await this.createNewTables();\n await this.dropRemovedColumns();\n await this.addNewColumns();\n await this.updatePrimaryKeys();\n await this.updateExistColumns();\n await this.createNewIndices();\n await this.createNewChecks();\n await this.createNewExclusions();\n await this.createCompositeUniqueConstraints();\n await this.createForeignKeys();\n await this.createViews();\n }\n\n private getTablePath(target: EntityMetadata | Table | View | TableForeignKey | string): string {\n const parsed = this.connection.driver.parseTableName(target);\n\n return this.connection.driver.buildTableName(\n parsed.tableName,\n parsed.schema || this.currentSchema,\n parsed.database || this.currentDatabase\n );\n }\n\n /**\n * Drops all (old) foreign keys that exist in the tables, but do not exist in the entity metadata.\n */\n protected async dropOldForeignKeys(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n // find foreign keys that exist in the schemas but does not exist in the entity metadata\n const tableForeignKeysToDrop = table.foreignKeys.filter(tableForeignKey => {\n const metadataFK = metadata.foreignKeys.find(metadataForeignKey => (\n (tableForeignKey.name === metadataForeignKey.name) &&\n (this.getTablePath(tableForeignKey) === this.getTablePath(metadataForeignKey.referencedEntityMetadata))\n ));\n return !metadataFK\n || (metadataFK.onDelete && metadataFK.onDelete !== tableForeignKey.onDelete)\n || (metadataFK.onUpdate && metadataFK.onUpdate !== tableForeignKey.onUpdate);\n });\n if (tableForeignKeysToDrop.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping old foreign keys of ${table.name}: ${tableForeignKeysToDrop.map(dbForeignKey => dbForeignKey.name).join(\", \")}`);\n\n // drop foreign keys from the database\n await this.queryRunner.dropForeignKeys(table, tableForeignKeysToDrop);\n }\n }\n\n /**\n * Rename tables\n */\n protected async renameTables(): Promise<void> {\n // for (const metadata of this.entityToSyncMetadatas) {\n // const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n // }\n }\n\n /**\n * Renames columns.\n * Works if only one column per table was changed.\n * Changes only column name. If something besides name was changed, these changes will be ignored.\n */\n protected async renameColumns(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n if (metadata.columns.length !== table.columns.length)\n continue;\n\n const renamedMetadataColumns = metadata.columns.filter(column => {\n return !table.columns.find(tableColumn => {\n return tableColumn.name === column.databaseName\n && tableColumn.type === this.connection.driver.normalizeType(column)\n && tableColumn.isNullable === column.isNullable\n && tableColumn.isUnique === this.connection.driver.normalizeIsUnique(column);\n });\n });\n\n if (renamedMetadataColumns.length === 0 || renamedMetadataColumns.length > 1)\n continue;\n\n const renamedTableColumns = table.columns.filter(tableColumn => {\n return !metadata.columns.find(column => {\n return column.databaseName === tableColumn.name\n && this.connection.driver.normalizeType(column) === tableColumn.type\n && column.isNullable === tableColumn.isNullable\n && this.connection.driver.normalizeIsUnique(column) === tableColumn.isUnique;\n });\n });\n\n if (renamedTableColumns.length === 0 || renamedTableColumns.length > 1)\n continue;\n\n const renamedColumn = renamedTableColumns[0].clone();\n renamedColumn.name = renamedMetadataColumns[0].databaseName;\n\n this.connection.logger.logSchemaBuild(`renaming column \"${renamedTableColumns[0].name}\" in to \"${renamedColumn.name}\"`);\n await this.queryRunner.renameColumn(table, renamedTableColumns[0], renamedColumn);\n }\n }\n\n protected async dropOldIndices(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const dropQueries = table.indices\n .filter(tableIndex => {\n const indexMetadata = metadata.indices.find(index => index.name === tableIndex.name);\n if (indexMetadata) {\n if (indexMetadata.synchronize === false)\n return false;\n\n if (indexMetadata.isUnique !== tableIndex.isUnique)\n return true;\n\n if (indexMetadata.isSpatial !== tableIndex.isSpatial)\n return true;\n\n if (this.connection.driver.isFullTextColumnTypeSupported() && indexMetadata.isFulltext !== tableIndex.isFulltext)\n return true;\n\n if (indexMetadata.columns.length !== tableIndex.columnNames.length)\n return true;\n\n return !indexMetadata.columns.every(column => tableIndex.columnNames.indexOf(column.databaseName) !== -1);\n }\n\n return true;\n })\n .map(async tableIndex => {\n this.connection.logger.logSchemaBuild(`dropping an index: \"${tableIndex.name}\" from table ${table.name}`);\n await this.queryRunner.dropIndex(table, tableIndex);\n });\n\n await Promise.all(dropQueries);\n }\n }\n\n protected async dropOldChecks(): Promise<void> {\n // Mysql does not support check constraints\n if (this.connection.driver instanceof MysqlDriver || this.connection.driver instanceof AuroraDataApiDriver)\n return;\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const oldChecks = table.checks.filter(tableCheck => {\n return !metadata.checks.find(checkMetadata => checkMetadata.name === tableCheck.name);\n });\n\n if (oldChecks.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping old check constraint: ${oldChecks.map(check => `\"${check.name}\"`).join(\", \")} from table \"${table.name}\"`);\n await this.queryRunner.dropCheckConstraints(table, oldChecks);\n }\n }\n\n protected async dropCompositeUniqueConstraints(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const compositeUniques = table.uniques.filter(tableUnique => {\n return tableUnique.columnNames.length > 1 && !metadata.uniques.find(uniqueMetadata => uniqueMetadata.name === tableUnique.name);\n });\n\n if (compositeUniques.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping old unique constraint: ${compositeUniques.map(unique => `\"${unique.name}\"`).join(\", \")} from table \"${table.name}\"`);\n await this.queryRunner.dropUniqueConstraints(table, compositeUniques);\n }\n }\n\n protected async dropOldExclusions(): Promise<void> {\n // Only PostgreSQL supports exclusion constraints\n if (!(this.connection.driver instanceof PostgresDriver))\n return;\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const oldExclusions = table.exclusions.filter(tableExclusion => {\n return !metadata.exclusions.find(exclusionMetadata => exclusionMetadata.name === tableExclusion.name);\n });\n\n if (oldExclusions.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping old exclusion constraint: ${oldExclusions.map(exclusion => `\"${exclusion.name}\"`).join(\", \")} from table \"${table.name}\"`);\n await this.queryRunner.dropExclusionConstraints(table, oldExclusions);\n }\n }\n\n /**\n * Creates tables that do not exist in the database yet.\n * New tables are created without foreign and primary keys.\n * Primary key only can be created in conclusion with auto generated column.\n */\n protected async createNewTables(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n // check if table does not exist yet\n const existTable = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (existTable)\n continue;\n\n this.connection.logger.logSchemaBuild(`creating a new table: ${this.getTablePath(metadata)}`);\n\n // create a new table and sync it in the database\n const table = Table.create(metadata, this.connection.driver);\n await this.queryRunner.createTable(table, false, false);\n this.queryRunner.loadedTables.push(table);\n }\n }\n\n protected async createViews(): Promise<void> {\n for (const metadata of this.viewEntityToSyncMetadatas) {\n // check if view does not exist yet\n const existView = this.queryRunner.loadedViews.find(view => {\n const viewExpression = typeof view.expression === \"string\" ? view.expression.trim() : view.expression(this.connection).getQuery();\n const metadataExpression = typeof metadata.expression === \"string\" ? metadata.expression.trim() : metadata.expression!(this.connection).getQuery();\n return this.getTablePath(view) === this.getTablePath(metadata) && viewExpression === metadataExpression;\n });\n if (existView)\n continue;\n\n this.connection.logger.logSchemaBuild(`creating a new view: ${this.getTablePath(metadata)}`);\n\n // create a new view and sync it in the database\n const view = View.create(metadata, this.connection.driver);\n await this.queryRunner.createView(view);\n this.queryRunner.loadedViews.push(view);\n }\n }\n\n protected async dropOldViews(): Promise<void> {\n const droppedViews: Array<View> = [];\n const viewEntityToSyncMetadatas = this.viewEntityToSyncMetadatas;\n // BuIld lookup cache for finding views metadata\n const viewToMetadata = new Map<View, EntityMetadata>();\n for (const view of this.queryRunner.loadedViews) {\n const viewMetadata = viewEntityToSyncMetadatas.find(metadata => {\n return this.getTablePath(view) === this.getTablePath(metadata);\n });\n if(viewMetadata){\n viewToMetadata.set(view, viewMetadata);\n }\n }\n // Gather all changed view, that need a drop\n for (const view of this.queryRunner.loadedViews) {\n const viewMetadata = viewToMetadata.get(view);\n if(!viewMetadata){\n continue;\n }\n const viewExpression = typeof view.expression === \"string\" ? view.expression.trim() : view.expression(this.connection).getQuery();\n const metadataExpression = typeof viewMetadata.expression === \"string\" ? viewMetadata.expression.trim() : viewMetadata.expression!(this.connection).getQuery();\n\n if (viewExpression === metadataExpression)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping an old view: ${view.name}`);\n\n // Collect view to be dropped\n droppedViews.push(view);\n }\n\n // Helper function that for a given view, will recursively return list of the view and all views that depend on it\n const viewDependencyChain = (view: View): View[] => {\n // Get the view metadata\n const viewMetadata = viewToMetadata.get(view);\n let viewWithDependencies = [view];\n // If no metadata is known for the view, simply return the view itself\n if(!viewMetadata){\n return viewWithDependencies;\n }\n // Iterate over all known views\n for(const [currentView, currentMetadata] of viewToMetadata.entries()){\n // Ignore self reference\n if(currentView === view) {\n continue;\n }\n // If the currently iterated view depends on the passed in view\n if(currentMetadata.dependsOn && (\n currentMetadata.dependsOn.has(viewMetadata.target) ||\n currentMetadata.dependsOn.has(viewMetadata.name)\n )){\n // Recursively add currently iterate view and its dependents\n viewWithDependencies = viewWithDependencies.concat(viewDependencyChain(currentView));\n }\n }\n // Return all collected views\n return viewWithDependencies;\n };\n\n // Collect final list of views to be dropped in a Set so there are no duplicates\n const droppedViewsWithDependencies: Set<View> = new Set(\n // Collect all dropped views, and their dependencies\n droppedViews.map(view => viewDependencyChain(view))\n // Flattened to single Array ( can be replaced with flatMap, once supported)\n .reduce((all, segment) => {\n return all.concat(segment);\n }, [])\n // Sort the views to be dropped in creation order\n .sort((a, b)=> {\n return ViewUtils.viewMetadataCmp(viewToMetadata.get(a), viewToMetadata.get(b));\n })\n // reverse order to get drop order\n .reverse()\n );\n\n // Finally emit all drop views\n for(const view of droppedViewsWithDependencies){\n await this.queryRunner.dropView(view);\n }\n this.queryRunner.loadedViews = this.queryRunner.loadedViews.filter(view => !droppedViewsWithDependencies.has(view));\n }\n\n /**\n * Drops all columns that exist in the table, but does not exist in the metadata (left old).\n * We drop their keys too, since it should be safe.\n */\n protected async dropRemovedColumns(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n // find columns that exist in the database but does not exist in the metadata\n const droppedTableColumns = table.columns.filter(tableColumn => {\n return !metadata.columns.find(columnMetadata => columnMetadata.databaseName === tableColumn.name);\n });\n if (droppedTableColumns.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`columns dropped in ${table.name}: ` + droppedTableColumns.map(column => column.name).join(\", \"));\n\n // drop columns from the database\n await this.queryRunner.dropColumns(table, droppedTableColumns);\n }\n }\n\n /**\n * Adds columns from metadata which does not exist in the table.\n * Columns are created without keys.\n */\n protected async addNewColumns(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n // find which columns are new\n const newColumnMetadatas = metadata.columns.filter(columnMetadata => {\n return !table.columns.find(tableColumn => tableColumn.name === columnMetadata.databaseName);\n });\n if (newColumnMetadatas.length === 0)\n continue;\n\n // create columns in the database\n const newTableColumnOptions = this.metadataColumnsToTableColumnOptions(newColumnMetadatas);\n const newTableColumns = newTableColumnOptions.map(option => new TableColumn(option));\n\n if (newTableColumns.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`new columns added: ` + newColumnMetadatas.map(column => column.databaseName).join(\", \"));\n await this.queryRunner.addColumns(table, newTableColumns);\n }\n }\n\n /**\n * Updates composite primary keys.\n */\n protected async updatePrimaryKeys(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const primaryMetadataColumns = metadata.columns.filter(column => column.isPrimary);\n const primaryTableColumns = table.columns.filter(column => column.isPrimary);\n if (primaryTableColumns.length !== primaryMetadataColumns.length && primaryMetadataColumns.length > 1) {\n const changedPrimaryColumns = primaryMetadataColumns.map(primaryMetadataColumn => {\n return new TableColumn(TableUtils.createTableColumnOptions(primaryMetadataColumn, this.connection.driver));\n });\n await this.queryRunner.updatePrimaryKeys(table, changedPrimaryColumns);\n }\n }\n }\n\n /**\n * Update all exist columns which metadata has changed.\n * Still don't create keys. Also we don't touch foreign keys of the changed columns.\n */\n protected async updateExistColumns(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const changedColumns = this.connection.driver.findChangedColumns(table.columns, metadata.columns);\n if (changedColumns.length === 0)\n continue;\n\n // drop all foreign keys that point to this column\n for (const changedColumn of changedColumns) {\n await this.dropColumnReferencedForeignKeys(this.getTablePath(metadata), changedColumn.databaseName);\n }\n\n // drop all composite indices related to this column\n for (const changedColumn of changedColumns) {\n await this.dropColumnCompositeIndices(this.getTablePath(metadata), changedColumn.databaseName);\n }\n\n // drop all composite uniques related to this column\n // Mysql does not support unique constraints.\n if (!(this.connection.driver instanceof MysqlDriver || this.connection.driver instanceof AuroraDataApiDriver)) {\n for (const changedColumn of changedColumns) {\n await this.dropColumnCompositeUniques(this.getTablePath(metadata), changedColumn.databaseName);\n }\n }\n\n // generate a map of new/old columns\n const newAndOldTableColumns = changedColumns.map(changedColumn => {\n const oldTableColumn = table.columns.find(column => column.name === changedColumn.databaseName)!;\n const newTableColumnOptions = TableUtils.createTableColumnOptions(changedColumn, this.connection.driver);\n const newTableColumn = new TableColumn(newTableColumnOptions);\n\n return {\n oldColumn: oldTableColumn,\n newColumn: newTableColumn\n };\n });\n\n if (newAndOldTableColumns.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`columns changed in \"${table.name}\". updating: ` + changedColumns.map(column => column.databaseName).join(\", \"));\n await this.queryRunner.changeColumns(table, newAndOldTableColumns);\n }\n }\n\n /**\n * Creates composite indices which are missing in db yet.\n */\n protected async createNewIndices(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const newIndices = metadata.indices\n .filter(indexMetadata => !table.indices.find(tableIndex => tableIndex.name === indexMetadata.name) && indexMetadata.synchronize === true)\n .map(indexMetadata => TableIndex.create(indexMetadata));\n\n if (newIndices.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`adding new indices ${newIndices.map(index => `\"${index.name}\"`).join(\", \")} in table \"${table.name}\"`);\n await this.queryRunner.createIndices(table, newIndices);\n }\n }\n\n protected async createNewChecks(): Promise<void> {\n // Mysql does not support check constraints\n if (this.connection.driver instanceof MysqlDriver || this.connection.driver instanceof AuroraDataApiDriver)\n return;\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const newChecks = metadata.checks\n .filter(checkMetadata => !table.checks.find(tableCheck => tableCheck.name === checkMetadata.name))\n .map(checkMetadata => TableCheck.create(checkMetadata));\n\n if (newChecks.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`adding new check constraints: ${newChecks.map(index => `\"${index.name}\"`).join(\", \")} in table \"${table.name}\"`);\n await this.queryRunner.createCheckConstraints(table, newChecks);\n }\n }\n\n /**\n * Creates composite uniques which are missing in db yet.\n */\n protected async createCompositeUniqueConstraints(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const compositeUniques = metadata.uniques\n .filter(uniqueMetadata => uniqueMetadata.columns.length > 1 && !table.uniques.find(tableUnique => tableUnique.name === uniqueMetadata.name))\n .map(uniqueMetadata => TableUnique.create(uniqueMetadata));\n\n if (compositeUniques.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`adding new unique constraints: ${compositeUniques.map(unique => `\"${unique.name}\"`).join(\", \")} in table \"${table.name}\"`);\n await this.queryRunner.createUniqueConstraints(table, compositeUniques);\n }\n }\n\n /**\n * Creates exclusions which are missing in db yet.\n */\n protected async createNewExclusions(): Promise<void> {\n // Only PostgreSQL supports exclusion constraints\n if (!(this.connection.driver instanceof PostgresDriver))\n return;\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const newExclusions = metadata.exclusions\n .filter(exclusionMetadata => !table.exclusions.find(tableExclusion => tableExclusion.name === exclusionMetadata.name))\n .map(exclusionMetadata => TableExclusion.create(exclusionMetadata));\n\n if (newExclusions.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`adding new exclusion constraints: ${newExclusions.map(exclusion => `\"${exclusion.name}\"`).join(\", \")} in table \"${table.name}\"`);\n await this.queryRunner.createExclusionConstraints(table, newExclusions);\n }\n }\n\n /**\n * Creates foreign keys which does not exist in the table yet.\n */\n protected async createForeignKeys(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const newKeys = metadata.foreignKeys\n .filter(foreignKey => {\n return !table.foreignKeys.find(dbForeignKey => (\n (dbForeignKey.name === foreignKey.name) &&\n (this.getTablePath(dbForeignKey) === this.getTablePath(foreignKey.referencedEntityMetadata))\n ));\n });\n if (newKeys.length === 0)\n continue;\n\n const dbForeignKeys = newKeys.map(foreignKeyMetadata => TableForeignKey.create(foreignKeyMetadata, this.connection.driver));\n this.connection.logger.logSchemaBuild(`creating a foreign keys: ${newKeys.map(key => key.name).join(\", \")} on table \"${table.name}\"`);\n await this.queryRunner.createForeignKeys(table, dbForeignKeys);\n }\n }\n\n /**\n * Drops all foreign keys where given column of the given table is being used.\n */\n protected async dropColumnReferencedForeignKeys(tablePath: string, columnName: string): Promise<void> {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === tablePath);\n if (!table)\n return;\n\n const tablesWithFK: Table[] = [];\n const columnForeignKey = table.foreignKeys.find(foreignKey => foreignKey.columnNames.indexOf(columnName) !== -1);\n if (columnForeignKey) {\n const clonedTable = table.clone();\n clonedTable.foreignKeys = [columnForeignKey];\n tablesWithFK.push(clonedTable);\n table.removeForeignKey(columnForeignKey);\n }\n\n for (const loadedTable of this.queryRunner.loadedTables) {\n const dependForeignKeys = loadedTable.foreignKeys.filter(foreignKey => {\n return this.getTablePath(foreignKey) === tablePath && foreignKey.referencedColumnNames.indexOf(columnName) !== -1;\n });\n\n if (dependForeignKeys.length > 0) {\n const clonedTable = loadedTable.clone();\n clonedTable.foreignKeys = dependForeignKeys;\n tablesWithFK.push(clonedTable);\n dependForeignKeys.forEach(dependForeignKey => loadedTable.removeForeignKey(dependForeignKey));\n }\n }\n\n if (tablesWithFK.length > 0) {\n for (const tableWithFK of tablesWithFK) {\n this.connection.logger.logSchemaBuild(`dropping related foreign keys of ${tableWithFK.name}: ${tableWithFK.foreignKeys.map(foreignKey => foreignKey.name).join(\", \")}`);\n await this.queryRunner.dropForeignKeys(tableWithFK, tableWithFK.foreignKeys);\n }\n }\n }\n\n /**\n * Drops all composite indices, related to given column.\n */\n protected async dropColumnCompositeIndices(tablePath: string, columnName: string): Promise<void> {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === tablePath);\n if (!table)\n return;\n\n const relatedIndices = table.indices.filter(index => index.columnNames.length > 1 && index.columnNames.indexOf(columnName) !== -1);\n if (relatedIndices.length === 0)\n return;\n\n this.connection.logger.logSchemaBuild(`dropping related indices of \"${tablePath}\".\"${columnName}\": ${relatedIndices.map(index => index.name).join(\", \")}`);\n await this.queryRunner.dropIndices(table, relatedIndices);\n }\n\n /**\n * Drops all composite uniques, related to given column.\n */\n protected async dropColumnCompositeUniques(tablePath: string, columnName: string): Promise<void> {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === tablePath);\n if (!table)\n return;\n\n const relatedUniques = table.uniques.filter(unique => unique.columnNames.length > 1 && unique.columnNames.indexOf(columnName) !== -1);\n if (relatedUniques.length === 0)\n return;\n\n this.connection.logger.logSchemaBuild(`dropping related unique constraints of \"${tablePath}\".\"${columnName}\": ${relatedUniques.map(unique => unique.name).join(\", \")}`);\n await this.queryRunner.dropUniqueConstraints(table, relatedUniques);\n }\n\n /**\n * Creates new columns from the given column metadatas.\n */\n protected metadataColumnsToTableColumnOptions(columns: ColumnMetadata[]): TableColumnOptions[] {\n return columns.map(columnMetadata => TableUtils.createTableColumnOptions(columnMetadata, this.connection.driver));\n }\n\n /**\n * Creates typeorm service table for storing user defined Views.\n */\n protected async createTypeormMetadataTable(queryRunner: QueryRunner) {\n const schema = this.currentSchema;\n const database = this.currentDatabase;\n const typeormMetadataTable = this.connection.driver.buildTableName(this.connection.metadataTableName, schema, database);\n\n await queryRunner.createTable(new Table(\n {\n database: database,\n schema: schema,\n name: typeormMetadataTable,\n columns: [\n {\n name: \"type\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataType}),\n isNullable: false\n },\n {\n name: \"database\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataDatabase}),\n isNullable: true\n },\n {\n name: \"schema\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataSchema}),\n isNullable: true\n },\n {\n name: \"table\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataTable}),\n isNullable: true\n },\n {\n name: \"name\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataName}),\n isNullable: true\n },\n {\n name: \"value\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataValue}),\n isNullable: true\n },\n ]\n },\n ), true);\n }\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/schema-builder/RdbmsSchemaBuilder.ts"],"names":[],"mappings":";;;;AAAA,yEAAsE;AACtE,uCAAoC;AACpC,mDAAgD;AAChD,2DAAwD;AACxD,iDAA8C;AAO9C,gDAA6C;AAE7C,oEAAiE;AACjE,2DAAwD;AACxD,mDAAgD;AAChD,iDAA8C;AAC9C,yDAAsD;AACtD,oCAAiC;AACjC,8CAA2C;AAC3C,qFAAkF;AAElF;;;;;;;;;;;;;GAaG;AACH;IAUI,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAE5E,4BAAsB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAC5C,CAAC;IAED,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACG,kCAAK,GAAX;;;;;;;wBACI,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;wBAEvD,2DAA2D;wBAC3D,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAA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Aa,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,aAAa,EAAC,CAAC;wCACxG,UAAU,EAAE,IAAI;qCACnB;oCACD;wCACI,IAAI,EAAE,MAAM;wCACZ,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,YAAY,EAAC,CAAC;wCACvG,UAAU,EAAE,IAAI;qCACnB;oCACD;wCACI,IAAI,EAAE,OAAO;wCACb,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,aAAa,EAAC,CAAC;wCACxG,UAAU,EAAE,IAAI;qCACnB;iCACJ;6BACJ,CACJ,EAAE,IAAI,CAAC,EAAA;;wBAtCR,SAsCQ,CAAC;;;;;KACZ;IACL,yBAAC;AAAD,CA90BA,AA80BC,IAAA;AA90BY,gDAAkB","file":"RdbmsSchemaBuilder.js","sourcesContent":["import {CockroachDriver} from \"../driver/cockroachdb/CockroachDriver\";\nimport {Table} from \"./table/Table\";\nimport {TableColumn} from \"./table/TableColumn\";\nimport {TableForeignKey} from \"./table/TableForeignKey\";\nimport {TableIndex} from \"./table/TableIndex\";\nimport {QueryRunner} from \"../query-runner/QueryRunner\";\nimport {ColumnMetadata} from \"../metadata/ColumnMetadata\";\nimport {EntityMetadata} from \"../metadata/EntityMetadata\";\nimport {Connection} from \"../connection/Connection\";\nimport {SchemaBuilder} from \"./SchemaBuilder\";\nimport {SqlInMemory} from \"../driver/SqlInMemory\";\nimport {TableUtils} from \"./util/TableUtils\";\nimport {TableColumnOptions} from \"./options/TableColumnOptions\";\nimport {PostgresDriver} from \"../driver/postgres/PostgresDriver\";\nimport {MysqlDriver} from \"../driver/mysql/MysqlDriver\";\nimport {TableUnique} from \"./table/TableUnique\";\nimport {TableCheck} from \"./table/TableCheck\";\nimport {TableExclusion} from \"./table/TableExclusion\";\nimport {View} from \"./view/View\";\nimport {ViewUtils} from \"./util/ViewUtils\";\nimport {AuroraDataApiDriver} from \"../driver/aurora-data-api/AuroraDataApiDriver\";\n\n/**\n * Creates complete tables schemas in the database based on the entity metadatas.\n *\n * Steps how schema is being built:\n * 1. load list of all tables with complete column and keys information from the db\n * 2. drop all (old) foreign keys that exist in the table, but does not exist in the metadata\n * 3. create new tables that does not exist in the db, but exist in the metadata\n * 4. drop all columns exist (left old) in the db table, but does not exist in the metadata\n * 5. add columns from metadata which does not exist in the table\n * 6. update all exist columns which metadata has changed\n * 7. update primary keys - update old and create new primary key from changed columns\n * 8. create foreign keys which does not exist in the table yet\n * 9. create indices which are missing in db yet, and drops indices which exist in the db, but does not exist in the metadata anymore\n */\nexport class RdbmsSchemaBuilder implements SchemaBuilder {\n /**\n * Used to execute schema creation queries in a single connection.\n */\n protected queryRunner: QueryRunner;\n\n private currentDatabase?: string;\n\n private currentSchema?: string;\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(protected connection: Connection) {\n }\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates complete schemas for the given entity metadatas.\n */\n async build(): Promise<void> {\n this.queryRunner = this.connection.createQueryRunner();\n\n // this.connection.driver.database || this.currentDatabase;\n this.currentDatabase = this.connection.driver.database;\n this.currentSchema = this.connection.driver.schema;\n\n // CockroachDB implements asynchronous schema sync operations which can not been executed in transaction.\n // E.g. if you try to DROP column and ADD it again in the same transaction, crdb throws error.\n const isUsingTransactions = (\n !(this.connection.driver instanceof CockroachDriver) &&\n this.connection.options.migrationsTransactionMode !== \"none\"\n );\n\n await this.queryRunner.beforeMigration();\n\n if (isUsingTransactions) {\n await this.queryRunner.startTransaction();\n }\n\n try {\n await this.createMetadataTableIfNecessary(this.queryRunner);\n // Flush the queryrunner table & view cache\n const tablePaths = this.entityToSyncMetadatas.map(metadata => this.getTablePath(metadata));\n\n await this.queryRunner.getTables(tablePaths);\n await this.queryRunner.getViews([]);\n\n await this.executeSchemaSyncOperationsInProperOrder();\n\n // if cache is enabled then perform cache-synchronization as well\n if (this.connection.queryResultCache)\n await this.connection.queryResultCache.synchronize(this.queryRunner);\n\n if (isUsingTransactions) {\n await this.queryRunner.commitTransaction();\n }\n\n } catch (error) {\n\n try { // we throw original error even if rollback thrown an error\n if (isUsingTransactions) {\n await this.queryRunner.rollbackTransaction();\n }\n } catch (rollbackError) { }\n throw error;\n\n } finally {\n\n await this.queryRunner.afterMigration();\n\n await this.queryRunner.release();\n }\n }\n\n /**\n * If the schema contains views, create the typeorm_metadata table if it doesn't exist yet\n */\n async createMetadataTableIfNecessary(queryRunner: QueryRunner): Promise<void> {\n if (this.viewEntityToSyncMetadatas.length > 0 || (this.connection.driver instanceof PostgresDriver && this.connection.driver.isGeneratedColumnsSupported)) {\n await this.createTypeormMetadataTable(queryRunner);\n }\n }\n\n /**\n * Returns sql queries to be executed by schema builder.\n */\n async log(): Promise<SqlInMemory> {\n this.queryRunner = this.connection.createQueryRunner();\n try {\n // Flush the queryrunner table & view cache\n const tablePaths = this.entityToSyncMetadatas.map(metadata => this.getTablePath(metadata));\n await this.queryRunner.getTables(tablePaths);\n await this.queryRunner.getViews([]);\n\n this.queryRunner.enableSqlMemory();\n await this.executeSchemaSyncOperationsInProperOrder();\n\n // if cache is enabled then perform cache-synchronization as well\n if (this.connection.queryResultCache) // todo: check this functionality\n await this.connection.queryResultCache.synchronize(this.queryRunner);\n\n return this.queryRunner.getMemorySql();\n\n } finally {\n // its important to disable this mode despite the fact we are release query builder\n // because there exist drivers which reuse same query runner. Also its important to disable\n // sql memory after call of getMemorySql() method because last one flushes sql memory.\n this.queryRunner.disableSqlMemory();\n await this.queryRunner.release();\n }\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Returns only entities that should be synced in the database.\n */\n protected get entityToSyncMetadatas(): EntityMetadata[] {\n return this.connection.entityMetadatas.filter(metadata => metadata.synchronize && metadata.tableType !== \"entity-child\" && metadata.tableType !== \"view\");\n }\n\n /**\n * Returns only entities that should be synced in the database.\n */\n protected get viewEntityToSyncMetadatas(): EntityMetadata[] {\n return this.connection.entityMetadatas\n .filter(metadata => metadata.tableType === \"view\" && metadata.synchronize)\n // sort views in creation order by dependencies\n .sort(ViewUtils.viewMetadataCmp);\n }\n\n /**\n * Executes schema sync operations in a proper order.\n * Order of operations matter here.\n */\n protected async executeSchemaSyncOperationsInProperOrder(): Promise<void> {\n await this.dropOldViews();\n await this.dropOldForeignKeys();\n await this.dropOldIndices();\n await this.dropOldChecks();\n await this.dropOldExclusions();\n await this.dropCompositeUniqueConstraints();\n // await this.renameTables();\n await this.renameColumns();\n await this.createNewTables();\n await this.dropRemovedColumns();\n await this.addNewColumns();\n await this.updatePrimaryKeys();\n await this.updateExistColumns();\n await this.createNewIndices();\n await this.createNewChecks();\n await this.createNewExclusions();\n await this.createCompositeUniqueConstraints();\n await this.createForeignKeys();\n await this.createViews();\n }\n\n private getTablePath(target: EntityMetadata | Table | View | TableForeignKey | string): string {\n const parsed = this.connection.driver.parseTableName(target);\n\n return this.connection.driver.buildTableName(\n parsed.tableName,\n parsed.schema || this.currentSchema,\n parsed.database || this.currentDatabase\n );\n }\n\n /**\n * Drops all (old) foreign keys that exist in the tables, but do not exist in the entity metadata.\n */\n protected async dropOldForeignKeys(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n // find foreign keys that exist in the schemas but does not exist in the entity metadata\n const tableForeignKeysToDrop = table.foreignKeys.filter(tableForeignKey => {\n const metadataFK = metadata.foreignKeys.find(metadataForeignKey => (\n (tableForeignKey.name === metadataForeignKey.name) &&\n (this.getTablePath(tableForeignKey) === this.getTablePath(metadataForeignKey.referencedEntityMetadata))\n ));\n return !metadataFK\n || (metadataFK.onDelete && metadataFK.onDelete !== tableForeignKey.onDelete)\n || (metadataFK.onUpdate && metadataFK.onUpdate !== tableForeignKey.onUpdate);\n });\n if (tableForeignKeysToDrop.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping old foreign keys of ${table.name}: ${tableForeignKeysToDrop.map(dbForeignKey => dbForeignKey.name).join(\", \")}`);\n\n // drop foreign keys from the database\n await this.queryRunner.dropForeignKeys(table, tableForeignKeysToDrop);\n }\n }\n\n /**\n * Rename tables\n */\n protected async renameTables(): Promise<void> {\n // for (const metadata of this.entityToSyncMetadatas) {\n // const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n // }\n }\n\n /**\n * Renames columns.\n * Works if only one column per table was changed.\n * Changes only column name. If something besides name was changed, these changes will be ignored.\n */\n protected async renameColumns(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n if (metadata.columns.length !== table.columns.length)\n continue;\n\n const renamedMetadataColumns = metadata.columns.filter(column => {\n return !table.columns.find(tableColumn => {\n return tableColumn.name === column.databaseName\n && tableColumn.type === this.connection.driver.normalizeType(column)\n && tableColumn.isNullable === column.isNullable\n && tableColumn.isUnique === this.connection.driver.normalizeIsUnique(column);\n });\n });\n\n if (renamedMetadataColumns.length === 0 || renamedMetadataColumns.length > 1)\n continue;\n\n const renamedTableColumns = table.columns.filter(tableColumn => {\n return !metadata.columns.find(column => {\n return column.databaseName === tableColumn.name\n && this.connection.driver.normalizeType(column) === tableColumn.type\n && column.isNullable === tableColumn.isNullable\n && this.connection.driver.normalizeIsUnique(column) === tableColumn.isUnique;\n });\n });\n\n if (renamedTableColumns.length === 0 || renamedTableColumns.length > 1)\n continue;\n\n const renamedColumn = renamedTableColumns[0].clone();\n renamedColumn.name = renamedMetadataColumns[0].databaseName;\n\n this.connection.logger.logSchemaBuild(`renaming column \"${renamedTableColumns[0].name}\" in to \"${renamedColumn.name}\"`);\n await this.queryRunner.renameColumn(table, renamedTableColumns[0], renamedColumn);\n }\n }\n\n protected async dropOldIndices(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const dropQueries = table.indices\n .filter(tableIndex => {\n const indexMetadata = metadata.indices.find(index => index.name === tableIndex.name);\n if (indexMetadata) {\n if (indexMetadata.synchronize === false)\n return false;\n\n if (indexMetadata.isUnique !== tableIndex.isUnique)\n return true;\n\n if (indexMetadata.isSpatial !== tableIndex.isSpatial)\n return true;\n\n if (this.connection.driver.isFullTextColumnTypeSupported() && indexMetadata.isFulltext !== tableIndex.isFulltext)\n return true;\n\n if (indexMetadata.columns.length !== tableIndex.columnNames.length)\n return true;\n\n return !indexMetadata.columns.every(column => tableIndex.columnNames.indexOf(column.databaseName) !== -1);\n }\n\n return true;\n })\n .map(async tableIndex => {\n this.connection.logger.logSchemaBuild(`dropping an index: \"${tableIndex.name}\" from table ${table.name}`);\n await this.queryRunner.dropIndex(table, tableIndex);\n });\n\n await Promise.all(dropQueries);\n }\n }\n\n protected async dropOldChecks(): Promise<void> {\n // Mysql does not support check constraints\n if (this.connection.driver instanceof MysqlDriver || this.connection.driver instanceof AuroraDataApiDriver)\n return;\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const oldChecks = table.checks.filter(tableCheck => {\n return !metadata.checks.find(checkMetadata => checkMetadata.name === tableCheck.name);\n });\n\n if (oldChecks.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping old check constraint: ${oldChecks.map(check => `\"${check.name}\"`).join(\", \")} from table \"${table.name}\"`);\n await this.queryRunner.dropCheckConstraints(table, oldChecks);\n }\n }\n\n protected async dropCompositeUniqueConstraints(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const compositeUniques = table.uniques.filter(tableUnique => {\n return tableUnique.columnNames.length > 1 && !metadata.uniques.find(uniqueMetadata => uniqueMetadata.name === tableUnique.name);\n });\n\n if (compositeUniques.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping old unique constraint: ${compositeUniques.map(unique => `\"${unique.name}\"`).join(\", \")} from table \"${table.name}\"`);\n await this.queryRunner.dropUniqueConstraints(table, compositeUniques);\n }\n }\n\n protected async dropOldExclusions(): Promise<void> {\n // Only PostgreSQL supports exclusion constraints\n if (!(this.connection.driver instanceof PostgresDriver))\n return;\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const oldExclusions = table.exclusions.filter(tableExclusion => {\n return !metadata.exclusions.find(exclusionMetadata => exclusionMetadata.name === tableExclusion.name);\n });\n\n if (oldExclusions.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping old exclusion constraint: ${oldExclusions.map(exclusion => `\"${exclusion.name}\"`).join(\", \")} from table \"${table.name}\"`);\n await this.queryRunner.dropExclusionConstraints(table, oldExclusions);\n }\n }\n\n /**\n * Creates tables that do not exist in the database yet.\n * New tables are created without foreign and primary keys.\n * Primary key only can be created in conclusion with auto generated column.\n */\n protected async createNewTables(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n // check if table does not exist yet\n const existTable = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (existTable)\n continue;\n\n this.connection.logger.logSchemaBuild(`creating a new table: ${this.getTablePath(metadata)}`);\n\n // create a new table and sync it in the database\n const table = Table.create(metadata, this.connection.driver);\n await this.queryRunner.createTable(table, false, false);\n this.queryRunner.loadedTables.push(table);\n }\n }\n\n protected async createViews(): Promise<void> {\n for (const metadata of this.viewEntityToSyncMetadatas) {\n // check if view does not exist yet\n const existView = this.queryRunner.loadedViews.find(view => {\n const viewExpression = typeof view.expression === \"string\" ? view.expression.trim() : view.expression(this.connection).getQuery();\n const metadataExpression = typeof metadata.expression === \"string\" ? metadata.expression.trim() : metadata.expression!(this.connection).getQuery();\n return this.getTablePath(view) === this.getTablePath(metadata) && viewExpression === metadataExpression;\n });\n if (existView)\n continue;\n\n this.connection.logger.logSchemaBuild(`creating a new view: ${this.getTablePath(metadata)}`);\n\n // create a new view and sync it in the database\n const view = View.create(metadata, this.connection.driver);\n await this.queryRunner.createView(view);\n this.queryRunner.loadedViews.push(view);\n }\n }\n\n protected async dropOldViews(): Promise<void> {\n const droppedViews: Array<View> = [];\n const viewEntityToSyncMetadatas = this.viewEntityToSyncMetadatas;\n // BuIld lookup cache for finding views metadata\n const viewToMetadata = new Map<View, EntityMetadata>();\n for (const view of this.queryRunner.loadedViews) {\n const viewMetadata = viewEntityToSyncMetadatas.find(metadata => {\n return this.getTablePath(view) === this.getTablePath(metadata);\n });\n if(viewMetadata){\n viewToMetadata.set(view, viewMetadata);\n }\n }\n // Gather all changed view, that need a drop\n for (const view of this.queryRunner.loadedViews) {\n const viewMetadata = viewToMetadata.get(view);\n if(!viewMetadata){\n continue;\n }\n const viewExpression = typeof view.expression === \"string\" ? view.expression.trim() : view.expression(this.connection).getQuery();\n const metadataExpression = typeof viewMetadata.expression === \"string\" ? viewMetadata.expression.trim() : viewMetadata.expression!(this.connection).getQuery();\n\n if (viewExpression === metadataExpression)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping an old view: ${view.name}`);\n\n // Collect view to be dropped\n droppedViews.push(view);\n }\n\n // Helper function that for a given view, will recursively return list of the view and all views that depend on it\n const viewDependencyChain = (view: View): View[] => {\n // Get the view metadata\n const viewMetadata = viewToMetadata.get(view);\n let viewWithDependencies = [view];\n // If no metadata is known for the view, simply return the view itself\n if(!viewMetadata){\n return viewWithDependencies;\n }\n // Iterate over all known views\n for(const [currentView, currentMetadata] of viewToMetadata.entries()){\n // Ignore self reference\n if(currentView === view) {\n continue;\n }\n // If the currently iterated view depends on the passed in view\n if(currentMetadata.dependsOn && (\n currentMetadata.dependsOn.has(viewMetadata.target) ||\n currentMetadata.dependsOn.has(viewMetadata.name)\n )){\n // Recursively add currently iterate view and its dependents\n viewWithDependencies = viewWithDependencies.concat(viewDependencyChain(currentView));\n }\n }\n // Return all collected views\n return viewWithDependencies;\n };\n\n // Collect final list of views to be dropped in a Set so there are no duplicates\n const droppedViewsWithDependencies: Set<View> = new Set(\n // Collect all dropped views, and their dependencies\n droppedViews.map(view => viewDependencyChain(view))\n // Flattened to single Array ( can be replaced with flatMap, once supported)\n .reduce((all, segment) => {\n return all.concat(segment);\n }, [])\n // Sort the views to be dropped in creation order\n .sort((a, b)=> {\n return ViewUtils.viewMetadataCmp(viewToMetadata.get(a), viewToMetadata.get(b));\n })\n // reverse order to get drop order\n .reverse()\n );\n\n // Finally emit all drop views\n for(const view of droppedViewsWithDependencies){\n await this.queryRunner.dropView(view);\n }\n this.queryRunner.loadedViews = this.queryRunner.loadedViews.filter(view => !droppedViewsWithDependencies.has(view));\n }\n\n /**\n * Drops all columns that exist in the table, but does not exist in the metadata (left old).\n * We drop their keys too, since it should be safe.\n */\n protected async dropRemovedColumns(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n // find columns that exist in the database but does not exist in the metadata\n const droppedTableColumns = table.columns.filter(tableColumn => {\n return !metadata.columns.find(columnMetadata => columnMetadata.databaseName === tableColumn.name);\n });\n if (droppedTableColumns.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`columns dropped in ${table.name}: ` + droppedTableColumns.map(column => column.name).join(\", \"));\n\n // drop columns from the database\n await this.queryRunner.dropColumns(table, droppedTableColumns);\n }\n }\n\n /**\n * Adds columns from metadata which does not exist in the table.\n * Columns are created without keys.\n */\n protected async addNewColumns(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n // find which columns are new\n const newColumnMetadatas = metadata.columns.filter(columnMetadata => {\n return !table.columns.find(tableColumn => tableColumn.name === columnMetadata.databaseName);\n });\n if (newColumnMetadatas.length === 0)\n continue;\n\n // create columns in the database\n const newTableColumnOptions = this.metadataColumnsToTableColumnOptions(newColumnMetadatas);\n const newTableColumns = newTableColumnOptions.map(option => new TableColumn(option));\n\n if (newTableColumns.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`new columns added: ` + newColumnMetadatas.map(column => column.databaseName).join(\", \"));\n await this.queryRunner.addColumns(table, newTableColumns);\n }\n }\n\n /**\n * Updates composite primary keys.\n */\n protected async updatePrimaryKeys(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const primaryMetadataColumns = metadata.columns.filter(column => column.isPrimary);\n const primaryTableColumns = table.columns.filter(column => column.isPrimary);\n if (primaryTableColumns.length !== primaryMetadataColumns.length && primaryMetadataColumns.length > 1) {\n const changedPrimaryColumns = primaryMetadataColumns.map(primaryMetadataColumn => {\n return new TableColumn(TableUtils.createTableColumnOptions(primaryMetadataColumn, this.connection.driver));\n });\n await this.queryRunner.updatePrimaryKeys(table, changedPrimaryColumns);\n }\n }\n }\n\n /**\n * Update all exist columns which metadata has changed.\n * Still don't create keys. Also we don't touch foreign keys of the changed columns.\n */\n protected async updateExistColumns(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const changedColumns = this.connection.driver.findChangedColumns(table.columns, metadata.columns);\n if (changedColumns.length === 0)\n continue;\n\n // drop all foreign keys that point to this column\n for (const changedColumn of changedColumns) {\n await this.dropColumnReferencedForeignKeys(this.getTablePath(metadata), changedColumn.databaseName);\n }\n\n // drop all composite indices related to this column\n for (const changedColumn of changedColumns) {\n await this.dropColumnCompositeIndices(this.getTablePath(metadata), changedColumn.databaseName);\n }\n\n // drop all composite uniques related to this column\n // Mysql does not support unique constraints.\n if (!(this.connection.driver instanceof MysqlDriver || this.connection.driver instanceof AuroraDataApiDriver)) {\n for (const changedColumn of changedColumns) {\n await this.dropColumnCompositeUniques(this.getTablePath(metadata), changedColumn.databaseName);\n }\n }\n\n // generate a map of new/old columns\n const newAndOldTableColumns = changedColumns.map(changedColumn => {\n const oldTableColumn = table.columns.find(column => column.name === changedColumn.databaseName)!;\n const newTableColumnOptions = TableUtils.createTableColumnOptions(changedColumn, this.connection.driver);\n const newTableColumn = new TableColumn(newTableColumnOptions);\n\n return {\n oldColumn: oldTableColumn,\n newColumn: newTableColumn\n };\n });\n\n if (newAndOldTableColumns.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`columns changed in \"${table.name}\". updating: ` + changedColumns.map(column => column.databaseName).join(\", \"));\n await this.queryRunner.changeColumns(table, newAndOldTableColumns);\n }\n }\n\n /**\n * Creates composite indices which are missing in db yet.\n */\n protected async createNewIndices(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const newIndices = metadata.indices\n .filter(indexMetadata => !table.indices.find(tableIndex => tableIndex.name === indexMetadata.name) && indexMetadata.synchronize === true)\n .map(indexMetadata => TableIndex.create(indexMetadata));\n\n if (newIndices.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`adding new indices ${newIndices.map(index => `\"${index.name}\"`).join(\", \")} in table \"${table.name}\"`);\n await this.queryRunner.createIndices(table, newIndices);\n }\n }\n\n protected async createNewChecks(): Promise<void> {\n // Mysql does not support check constraints\n if (this.connection.driver instanceof MysqlDriver || this.connection.driver instanceof AuroraDataApiDriver)\n return;\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const newChecks = metadata.checks\n .filter(checkMetadata => !table.checks.find(tableCheck => tableCheck.name === checkMetadata.name))\n .map(checkMetadata => TableCheck.create(checkMetadata));\n\n if (newChecks.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`adding new check constraints: ${newChecks.map(index => `\"${index.name}\"`).join(\", \")} in table \"${table.name}\"`);\n await this.queryRunner.createCheckConstraints(table, newChecks);\n }\n }\n\n /**\n * Creates composite uniques which are missing in db yet.\n */\n protected async createCompositeUniqueConstraints(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const compositeUniques = metadata.uniques\n .filter(uniqueMetadata => uniqueMetadata.columns.length > 1 && !table.uniques.find(tableUnique => tableUnique.name === uniqueMetadata.name))\n .map(uniqueMetadata => TableUnique.create(uniqueMetadata));\n\n if (compositeUniques.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`adding new unique constraints: ${compositeUniques.map(unique => `\"${unique.name}\"`).join(\", \")} in table \"${table.name}\"`);\n await this.queryRunner.createUniqueConstraints(table, compositeUniques);\n }\n }\n\n /**\n * Creates exclusions which are missing in db yet.\n */\n protected async createNewExclusions(): Promise<void> {\n // Only PostgreSQL supports exclusion constraints\n if (!(this.connection.driver instanceof PostgresDriver))\n return;\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const newExclusions = metadata.exclusions\n .filter(exclusionMetadata => !table.exclusions.find(tableExclusion => tableExclusion.name === exclusionMetadata.name))\n .map(exclusionMetadata => TableExclusion.create(exclusionMetadata));\n\n if (newExclusions.length === 0)\n continue;\n\n this.connection.logger.logSchemaBuild(`adding new exclusion constraints: ${newExclusions.map(exclusion => `\"${exclusion.name}\"`).join(\", \")} in table \"${table.name}\"`);\n await this.queryRunner.createExclusionConstraints(table, newExclusions);\n }\n }\n\n /**\n * Creates foreign keys which does not exist in the table yet.\n */\n protected async createForeignKeys(): Promise<void> {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n if (!table)\n continue;\n\n const newKeys = metadata.foreignKeys\n .filter(foreignKey => {\n return !table.foreignKeys.find(dbForeignKey => (\n (dbForeignKey.name === foreignKey.name) &&\n (this.getTablePath(dbForeignKey) === this.getTablePath(foreignKey.referencedEntityMetadata))\n ));\n });\n if (newKeys.length === 0)\n continue;\n\n const dbForeignKeys = newKeys.map(foreignKeyMetadata => TableForeignKey.create(foreignKeyMetadata, this.connection.driver));\n this.connection.logger.logSchemaBuild(`creating a foreign keys: ${newKeys.map(key => key.name).join(\", \")} on table \"${table.name}\"`);\n await this.queryRunner.createForeignKeys(table, dbForeignKeys);\n }\n }\n\n /**\n * Drops all foreign keys where given column of the given table is being used.\n */\n protected async dropColumnReferencedForeignKeys(tablePath: string, columnName: string): Promise<void> {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === tablePath);\n if (!table)\n return;\n\n const tablesWithFK: Table[] = [];\n const columnForeignKey = table.foreignKeys.find(foreignKey => foreignKey.columnNames.indexOf(columnName) !== -1);\n if (columnForeignKey) {\n const clonedTable = table.clone();\n clonedTable.foreignKeys = [columnForeignKey];\n tablesWithFK.push(clonedTable);\n table.removeForeignKey(columnForeignKey);\n }\n\n for (const loadedTable of this.queryRunner.loadedTables) {\n const dependForeignKeys = loadedTable.foreignKeys.filter(foreignKey => {\n return this.getTablePath(foreignKey) === tablePath && foreignKey.referencedColumnNames.indexOf(columnName) !== -1;\n });\n\n if (dependForeignKeys.length > 0) {\n const clonedTable = loadedTable.clone();\n clonedTable.foreignKeys = dependForeignKeys;\n tablesWithFK.push(clonedTable);\n dependForeignKeys.forEach(dependForeignKey => loadedTable.removeForeignKey(dependForeignKey));\n }\n }\n\n if (tablesWithFK.length > 0) {\n for (const tableWithFK of tablesWithFK) {\n this.connection.logger.logSchemaBuild(`dropping related foreign keys of ${tableWithFK.name}: ${tableWithFK.foreignKeys.map(foreignKey => foreignKey.name).join(\", \")}`);\n await this.queryRunner.dropForeignKeys(tableWithFK, tableWithFK.foreignKeys);\n }\n }\n }\n\n /**\n * Drops all composite indices, related to given column.\n */\n protected async dropColumnCompositeIndices(tablePath: string, columnName: string): Promise<void> {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === tablePath);\n if (!table)\n return;\n\n const relatedIndices = table.indices.filter(index => index.columnNames.length > 1 && index.columnNames.indexOf(columnName) !== -1);\n if (relatedIndices.length === 0)\n return;\n\n this.connection.logger.logSchemaBuild(`dropping related indices of \"${tablePath}\".\"${columnName}\": ${relatedIndices.map(index => index.name).join(\", \")}`);\n await this.queryRunner.dropIndices(table, relatedIndices);\n }\n\n /**\n * Drops all composite uniques, related to given column.\n */\n protected async dropColumnCompositeUniques(tablePath: string, columnName: string): Promise<void> {\n const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === tablePath);\n if (!table)\n return;\n\n const relatedUniques = table.uniques.filter(unique => unique.columnNames.length > 1 && unique.columnNames.indexOf(columnName) !== -1);\n if (relatedUniques.length === 0)\n return;\n\n this.connection.logger.logSchemaBuild(`dropping related unique constraints of \"${tablePath}\".\"${columnName}\": ${relatedUniques.map(unique => unique.name).join(\", \")}`);\n await this.queryRunner.dropUniqueConstraints(table, relatedUniques);\n }\n\n /**\n * Creates new columns from the given column metadatas.\n */\n protected metadataColumnsToTableColumnOptions(columns: ColumnMetadata[]): TableColumnOptions[] {\n return columns.map(columnMetadata => TableUtils.createTableColumnOptions(columnMetadata, this.connection.driver));\n }\n\n /**\n * Creates typeorm service table for storing user defined Views.\n */\n protected async createTypeormMetadataTable(queryRunner: QueryRunner) {\n const schema = this.currentSchema;\n const database = this.currentDatabase;\n const typeormMetadataTable = this.connection.driver.buildTableName(this.connection.metadataTableName, schema, database);\n\n await queryRunner.createTable(new Table(\n {\n database: database,\n schema: schema,\n name: typeormMetadataTable,\n columns: [\n {\n name: \"type\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataType}),\n isNullable: false\n },\n {\n name: \"database\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataDatabase}),\n isNullable: true\n },\n {\n name: \"schema\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataSchema}),\n isNullable: true\n },\n {\n name: \"table\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataTable}),\n isNullable: true\n },\n {\n name: \"name\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataName}),\n isNullable: true\n },\n {\n name: \"value\",\n type: this.connection.driver.normalizeType({type: this.connection.driver.mappedDataTypes.metadataValue}),\n isNullable: true\n },\n ]\n },\n ), true);\n }\n}\n"],"sourceRoot":".."}
@@ -565,47 +565,51 @@ var Broadcaster = /** @class */ (function () {
565
565
  */
566
566
  Broadcaster.prototype.broadcastLoadEvent = function (result, metadata, entities) {
567
567
  var _this = this;
568
- entities.forEach(function (entity) {
569
- if (entity instanceof Promise) // todo: check why need this?
570
- return;
568
+ // Calculate which subscribers are fitting for the given entity type
569
+ var fittingSubscribers = this.queryRunner.connection.subscribers.filter(function (subscriber) { return _this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterLoad; });
570
+ if (metadata.relations.length || metadata.afterLoadListeners.length || fittingSubscribers.length) {
571
+ // todo: check why need this?
572
+ var nonPromiseEntities_1 = entities.filter(function (entity) { return !(entity instanceof Promise); });
571
573
  // collect load events for all children entities that were loaded with the main entity
572
574
  if (metadata.relations.length) {
573
575
  metadata.relations.forEach(function (relation) {
574
- // in lazy relations we cannot simply access to entity property because it will cause a getter and a database query
575
- if (relation.isLazy && !entity.hasOwnProperty(relation.propertyName))
576
- return;
577
- var value = relation.getEntityValue(entity);
578
- if (value instanceof Object)
579
- _this.broadcastLoadEvent(result, relation.inverseEntityMetadata, Array.isArray(value) ? value : [value]);
576
+ nonPromiseEntities_1.forEach(function (entity) {
577
+ // in lazy relations we cannot simply access to entity property because it will cause a getter and a database query
578
+ if (relation.isLazy && !entity.hasOwnProperty(relation.propertyName))
579
+ return;
580
+ var value = relation.getEntityValue(entity);
581
+ if (value instanceof Object)
582
+ _this.broadcastLoadEvent(result, relation.inverseEntityMetadata, Array.isArray(value) ? value : [value]);
583
+ });
580
584
  });
581
585
  }
582
586
  if (metadata.afterLoadListeners.length) {
583
587
  metadata.afterLoadListeners.forEach(function (listener) {
584
- if (listener.isAllowed(entity)) {
585
- var executionResult = listener.execute(entity);
586
- if (executionResult instanceof Promise)
587
- result.promises.push(executionResult);
588
- result.count++;
589
- }
588
+ nonPromiseEntities_1.forEach(function (entity) {
589
+ if (listener.isAllowed(entity)) {
590
+ var executionResult = listener.execute(entity);
591
+ if (executionResult instanceof Promise)
592
+ result.promises.push(executionResult);
593
+ result.count++;
594
+ }
595
+ });
590
596
  });
591
597
  }
592
- if (_this.queryRunner.connection.subscribers.length) {
593
- _this.queryRunner.connection.subscribers.forEach(function (subscriber) {
594
- if (_this.isAllowedSubscriber(subscriber, metadata.target) && subscriber.afterLoad) {
595
- var executionResult = subscriber.afterLoad(entity, {
596
- connection: _this.queryRunner.connection,
597
- queryRunner: _this.queryRunner,
598
- manager: _this.queryRunner.manager,
599
- entity: entity,
600
- metadata: metadata
601
- });
602
- if (executionResult instanceof Promise)
603
- result.promises.push(executionResult);
604
- result.count++;
605
- }
598
+ fittingSubscribers.forEach(function (subscriber) {
599
+ nonPromiseEntities_1.forEach(function (entity) {
600
+ var executionResult = subscriber.afterLoad(entity, {
601
+ entity: entity,
602
+ metadata: metadata,
603
+ connection: _this.queryRunner.connection,
604
+ queryRunner: _this.queryRunner,
605
+ manager: _this.queryRunner.manager,
606
+ });
607
+ if (executionResult instanceof Promise)
608
+ result.promises.push(executionResult);
609
+ result.count++;
606
610
  });
607
- }
608
- });
611
+ });
612
+ }
609
613
  };
610
614
  // -------------------------------------------------------------------------
611
615
  // Protected Methods