typeorm 0.2.38-dev.b858f84 → 0.2.38

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 (95) hide show
  1. package/README.md +1 -1
  2. package/browser/driver/Driver.d.ts +5 -1
  3. package/browser/driver/Driver.js.map +1 -1
  4. package/browser/driver/aurora-data-api/AuroraDataApiDriver.d.ts +5 -1
  5. package/browser/driver/aurora-data-api/AuroraDataApiDriver.js +18 -2
  6. package/browser/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
  7. package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +1 -1
  8. package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
  9. package/browser/driver/cockroachdb/CockroachDriver.d.ts +14 -1
  10. package/browser/driver/cockroachdb/CockroachDriver.js +36 -10
  11. package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
  12. package/browser/driver/cockroachdb/CockroachQueryRunner.js +1 -1
  13. package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
  14. package/browser/driver/mysql/MysqlDriver.js +19 -6
  15. package/browser/driver/mysql/MysqlDriver.js.map +1 -1
  16. package/browser/driver/mysql/MysqlQueryRunner.js +1 -1
  17. package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
  18. package/browser/driver/oracle/OracleDriver.d.ts +5 -1
  19. package/browser/driver/oracle/OracleDriver.js +32 -10
  20. package/browser/driver/oracle/OracleDriver.js.map +1 -1
  21. package/browser/driver/oracle/OracleQueryRunner.js +1 -1
  22. package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
  23. package/browser/driver/postgres/PostgresDriver.d.ts +14 -1
  24. package/browser/driver/postgres/PostgresDriver.js +36 -10
  25. package/browser/driver/postgres/PostgresDriver.js.map +1 -1
  26. package/browser/driver/postgres/PostgresQueryRunner.js +1 -1
  27. package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
  28. package/browser/driver/sap/SapDriver.d.ts +5 -1
  29. package/browser/driver/sap/SapDriver.js +59 -35
  30. package/browser/driver/sap/SapDriver.js.map +1 -1
  31. package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js +0 -1
  32. package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
  33. package/browser/driver/sqlserver/SqlServerDriver.d.ts +14 -1
  34. package/browser/driver/sqlserver/SqlServerDriver.js +36 -10
  35. package/browser/driver/sqlserver/SqlServerDriver.js.map +1 -1
  36. package/browser/driver/sqlserver/SqlServerQueryRunner.js +10 -10
  37. package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  38. package/browser/query-runner/BaseQueryRunner.d.ts +2 -1
  39. package/browser/query-runner/BaseQueryRunner.js +47 -25
  40. package/browser/query-runner/BaseQueryRunner.js.map +1 -1
  41. package/browser/schema-builder/RdbmsSchemaBuilder.d.ts +2 -0
  42. package/browser/schema-builder/RdbmsSchemaBuilder.js +26 -43
  43. package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
  44. package/browser/util/StringUtils.js +1 -1
  45. package/browser/util/StringUtils.js.map +1 -1
  46. package/cli.js +0 -0
  47. package/commands/SchemaLogCommand.js +2 -2
  48. package/commands/SchemaLogCommand.js.map +1 -1
  49. package/commands/SchemaSyncCommand.js +1 -1
  50. package/commands/SchemaSyncCommand.js.map +1 -1
  51. package/driver/Driver.d.ts +5 -1
  52. package/driver/Driver.js.map +1 -1
  53. package/driver/aurora-data-api/AuroraDataApiDriver.d.ts +5 -1
  54. package/driver/aurora-data-api/AuroraDataApiDriver.js +18 -2
  55. package/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
  56. package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +1 -1
  57. package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
  58. package/driver/cockroachdb/CockroachDriver.d.ts +14 -1
  59. package/driver/cockroachdb/CockroachDriver.js +36 -10
  60. package/driver/cockroachdb/CockroachDriver.js.map +1 -1
  61. package/driver/cockroachdb/CockroachQueryRunner.js +1 -1
  62. package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
  63. package/driver/mysql/MysqlDriver.js +19 -6
  64. package/driver/mysql/MysqlDriver.js.map +1 -1
  65. package/driver/mysql/MysqlQueryRunner.js +1 -1
  66. package/driver/mysql/MysqlQueryRunner.js.map +1 -1
  67. package/driver/oracle/OracleDriver.d.ts +5 -1
  68. package/driver/oracle/OracleDriver.js +32 -10
  69. package/driver/oracle/OracleDriver.js.map +1 -1
  70. package/driver/oracle/OracleQueryRunner.js +1 -1
  71. package/driver/oracle/OracleQueryRunner.js.map +1 -1
  72. package/driver/postgres/PostgresDriver.d.ts +14 -1
  73. package/driver/postgres/PostgresDriver.js +36 -10
  74. package/driver/postgres/PostgresDriver.js.map +1 -1
  75. package/driver/postgres/PostgresQueryRunner.js +1 -1
  76. package/driver/postgres/PostgresQueryRunner.js.map +1 -1
  77. package/driver/sap/SapDriver.d.ts +5 -1
  78. package/driver/sap/SapDriver.js +59 -35
  79. package/driver/sap/SapDriver.js.map +1 -1
  80. package/driver/sqlite-abstract/AbstractSqliteDriver.js +0 -1
  81. package/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
  82. package/driver/sqlserver/SqlServerDriver.d.ts +14 -1
  83. package/driver/sqlserver/SqlServerDriver.js +36 -10
  84. package/driver/sqlserver/SqlServerDriver.js.map +1 -1
  85. package/driver/sqlserver/SqlServerQueryRunner.js +10 -10
  86. package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  87. package/package.json +239 -1
  88. package/query-runner/BaseQueryRunner.d.ts +2 -1
  89. package/query-runner/BaseQueryRunner.js +47 -25
  90. package/query-runner/BaseQueryRunner.js.map +1 -1
  91. package/schema-builder/RdbmsSchemaBuilder.d.ts +2 -0
  92. package/schema-builder/RdbmsSchemaBuilder.js +26 -43
  93. package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
  94. package/util/StringUtils.js +1 -1
  95. package/util/StringUtils.js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AAC,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;IAEL,yBAAC;AAAD,CAvxBA,AAuxBC,IAAA","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 {SqlServerDriver} from \"../driver/sqlserver/SqlServerDriver\";\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 {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 // -------------------------------------------------------------------------\n // Protected Properties\n // -------------------------------------------------------------------------\n\n /**\n * Used to execute schema creation queries in a single connection.\n */\n protected queryRunner: QueryRunner;\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 // 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 if (this.viewEntityToSyncMetadatas.length > 0) {\n await this.createTypeormMetadataTable();\n }\n\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 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 * Returns sql queries to be executed by schema builder.\n */\n async log(): Promise<SqlInMemory> {\n this.queryRunner = this.connection.createQueryRunner();\n try {\n\n // TODO: typeorm_metadata table needs only for Views for now.\n // Remove condition or add new conditions if necessary (for CHECK constraints for example).\n if (this.viewEntityToSyncMetadatas.length > 0) {\n await this.createTypeormMetadataTable();\n }\n\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.filter(metadata => metadata.tableType === \"view\" && metadata.synchronize);\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 | TableForeignKey): string {\n if (target instanceof Table) {\n return target.name;\n }\n\n if (target instanceof TableForeignKey) {\n return target.referencedTableName;\n }\n\n return target.tablePath;\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 const currentSchema = await this.queryRunner.getCurrentSchema();\n for (const metadata of this.entityToSyncMetadatas) {\n // check if table does not exist yet\n const existTable = this.queryRunner.loadedTables.find(table => {\n const database = metadata.database && metadata.database !== this.connection.driver.database ? metadata.database : undefined;\n let schema = metadata.schema || (this.connection.driver.options as any).schema;\n // if schema is default db schema (e.g. \"public\" in PostgreSQL), skip it.\n schema = schema === currentSchema ? undefined : schema;\n const fullTableName = this.connection.driver.buildTableName(metadata.tableName, schema, database);\n\n return table.name === fullTableName;\n });\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 database = metadata.database && metadata.database !== this.connection.driver.database ? metadata.database : undefined;\n const schema = metadata.schema || (<SqlServerDriver|PostgresDriver>this.connection.driver).options.schema;\n const fullViewName = this.connection.driver.buildTableName(metadata.tableName, schema, database);\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 view.name === fullViewName && 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: Set<View> = new Set();\n for (const view of this.queryRunner.loadedViews) {\n const existViewMetadata = this.viewEntityToSyncMetadatas.find(metadata => {\n const database = metadata.database && metadata.database !== this.connection.driver.database ? metadata.database : undefined;\n const schema = metadata.schema || (<SqlServerDriver|PostgresDriver>this.connection.driver).options.schema;\n const fullViewName = this.connection.driver.buildTableName(metadata.tableName, schema, database);\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 view.name === fullViewName && viewExpression === metadataExpression;\n });\n\n if (existViewMetadata)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping an old view: ${view.name}`);\n\n // drop an old view\n await this.queryRunner.dropView(view);\n droppedViews.add(view);\n }\n this.queryRunner.loadedViews = this.queryRunner.loadedViews.filter(view => !droppedViews.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() {\n const { schema } = this.connection.driver.options as any;\n const database = this.connection.driver.database;\n const typeormMetadataTable = this.connection.driver.buildTableName(\"typeorm_metadata\", schema, database);\n\n await this.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}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../browser/src/schema-builder/RdbmsSchemaBuilder.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,uCAAuC,CAAC;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C,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;IAEL,yBAAC;AAAD,CA1wBA,AA0wBC,IAAA","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 {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 if (this.viewEntityToSyncMetadatas.length > 0) {\n await this.createTypeormMetadataTable();\n }\n\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 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 * Returns sql queries to be executed by schema builder.\n */\n async log(): Promise<SqlInMemory> {\n this.queryRunner = this.connection.createQueryRunner();\n try {\n\n // TODO: typeorm_metadata table needs only for Views for now.\n // Remove condition or add new conditions if necessary (for CHECK constraints for example).\n if (this.viewEntityToSyncMetadatas.length > 0) {\n await this.createTypeormMetadataTable();\n }\n\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.filter(metadata => metadata.tableType === \"view\" && metadata.synchronize);\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: Set<View> = new Set();\n for (const view of this.queryRunner.loadedViews) {\n const existViewMetadata = this.viewEntityToSyncMetadatas.find(metadata => {\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\n if (existViewMetadata)\n continue;\n\n this.connection.logger.logSchemaBuild(`dropping an old view: ${view.name}`);\n\n // drop an old view\n await this.queryRunner.dropView(view);\n droppedViews.add(view);\n }\n this.queryRunner.loadedViews = this.queryRunner.loadedViews.filter(view => !droppedViews.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() {\n const schema = this.currentSchema;\n const database = this.currentDatabase;\n const typeormMetadataTable = this.connection.driver.buildTableName(\"typeorm_metadata\", schema, database);\n\n await this.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}\n"],"sourceRoot":".."}
@@ -23,7 +23,7 @@ export function snakeCase(str) {
23
23
  // ABc -> a_bc
24
24
  .replace(/([A-Z])([A-Z])([a-z])/g, "$1_$2$3")
25
25
  // aC -> a_c
26
- .replace(/([a-z])([A-Z])/g, "$1_$2")
26
+ .replace(/([a-z0-9])([A-Z])/g, "$1_$2")
27
27
  .toLowerCase();
28
28
  }
29
29
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../browser/src/util/StringUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,QAAQ,CAAC;AAE3B;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,YAA6B;IAA7B,6BAAA,EAAA,oBAA6B;IAChE,OAAO,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE,UAAS,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM;QACrE,IAAI,YAAY,KAAK,IAAI,IAAI,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACrD,IAAI,EAAE;YAA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O,WAAW,CAAC;AACrB,CAAC","file":"StringUtils.js","sourcesContent":["import shajs from \"sha.js\";\n\n/**\n * Converts string into camelCase.\n *\n * @see http://stackoverflow.com/questions/2970525/converting-any-string-into-camel-case\n */\nexport function camelCase(str: string, firstCapital: boolean = false): string {\n return str.replace(/^([A-Z])|[\\s-_](\\w)/g, function(match, p1, p2, offset) {\n if (firstCapital === true && offset === 0) return p1;\n if (p2) return p2.toUpperCase();\n return p1.toLowerCase();\n });\n}\n\n/**\n * Converts string into snake_case.\n *\n */\nexport function snakeCase(str: string): string{\n return str\n // ABc -> a_bc\n .replace(/([A-Z])([A-Z])([a-z])/g, \"$1_$2$3\")\n // aC -> a_c\n .replace(/([a-z])([A-Z])/g, \"$1_$2\")\n .toLowerCase();\n}\n\n/**\n * Converts string into Title Case.\n *\n * @see http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript\n */\nexport function titleCase(str: string): string {\n return str.replace(/\\w\\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());\n}\n\n/**\n * Builds abbreviated string from given string;\n */\nexport function abbreviate(str: string, abbrLettersCount: number = 1): string {\n const words = str.replace(/([a-z\\xE0-\\xFF])([A-Z\\xC0\\xDF])/g, \"$1 $2\").split(\" \");\n return words.reduce((res, word) => {\n res += word.substr(0, abbrLettersCount);\n return res;\n }, \"\");\n}\n\nexport interface IShortenOptions {\n /** String used to split \"segments\" of the alias/column name */\n separator?: string;\n /** Maximum length of any \"segment\" */\n segmentLength?: number;\n /** Length of any \"term\" in a \"segment\"; \"OrderItem\" is a segment, \"Order\" and \"Items\" are terms */\n termLength?: number;\n }\n\n /**\n * Shorten a given `input`. Useful for RDBMS imposing a limit on the\n * maximum length of aliases and column names in SQL queries.\n *\n * @param input String to be shortened.\n * @param options Default to `4` for segments length, `2` for terms length, `'__'` as a separator.\n *\n * @return Shortened `input`.\n *\n * @example\n * // returns: \"UsShCa__orde__mark__dire\"\n * shorten('UserShoppingCart__order__market__director')\n *\n * // returns: \"cat_wit_ver_lon_nam_pos_wit_ver_lon_nam_pos_wit_ver_lon_nam\"\n * shorten(\n * 'category_with_very_long_name_posts_with_very_long_name_post_with_very_long_name',\n * { separator: '_', segmentLength: 3 }\n * )\n *\n * // equals: UsShCa__orde__mark_market_id\n * `${shorten('UserShoppingCart__order__market')}_market_id`\n */\n export function shorten(input: string, options: IShortenOptions = {}): string {\n const { segmentLength = 4, separator = \"__\", termLength = 2 } = options;\n\n const segments = input.split(separator);\n const shortSegments = segments.reduce((acc: string[], val: string) => {\n // split the given segment into many terms based on an eventual camel cased name\n const segmentTerms = val.replace(/([a-z\\xE0-\\xFF])([A-Z\\xC0-\\xDF])/g, \"$1 $2\").split(\" \");\n // \"OrderItemList\" becomes \"OrItLi\", while \"company\" becomes \"comp\"\n const length = segmentTerms.length > 1 ? termLength : segmentLength;\n const shortSegment = segmentTerms.map(term => term.substr(0, length)).join(\"\");\n\n acc.push(shortSegment);\n return acc;\n }, []);\n\n return shortSegments.join(separator);\n }\n\ninterface IHashOptions {\n length?: number;\n}\n\n/**\n * Returns a hashed input.\n *\n * @param input String to be hashed.\n * @param options.length Optionally, shorten the output to desired length.\n */\nexport function hash(input: string, options: IHashOptions = {}): string {\n const hashFunction = shajs(\"sha256\");\n\n hashFunction.update(input, \"utf8\");\n\n const hashedInput = hashFunction.digest(\"hex\");\n\n if (options.length) {\n return hashedInput.slice(0, options.length);\n }\n\n return hashedInput;\n }\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../browser/src/util/StringUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,QAAQ,CAAC;AAE3B;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,YAA6B;IAA7B,6BAAA,EAAA,oBAA6B;IAChE,OAAO,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE,UAAS,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM;QACrE,IAAI,YAAY,KAAK,IAAI,IAAI,M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AAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;KAC/C;IAED,OAAO,WAAW,CAAC;AACrB,CAAC","file":"StringUtils.js","sourcesContent":["import shajs from \"sha.js\";\n\n/**\n * Converts string into camelCase.\n *\n * @see http://stackoverflow.com/questions/2970525/converting-any-string-into-camel-case\n */\nexport function camelCase(str: string, firstCapital: boolean = false): string {\n return str.replace(/^([A-Z])|[\\s-_](\\w)/g, function(match, p1, p2, offset) {\n if (firstCapital === true && offset === 0) return p1;\n if (p2) return p2.toUpperCase();\n return p1.toLowerCase();\n });\n}\n\n/**\n * Converts string into snake_case.\n *\n */\nexport function snakeCase(str: string): string{\n return str\n // ABc -> a_bc\n .replace(/([A-Z])([A-Z])([a-z])/g, \"$1_$2$3\")\n // aC -> a_c\n .replace(/([a-z0-9])([A-Z])/g, \"$1_$2\")\n .toLowerCase();\n}\n\n/**\n * Converts string into Title Case.\n *\n * @see http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript\n */\nexport function titleCase(str: string): string {\n return str.replace(/\\w\\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());\n}\n\n/**\n * Builds abbreviated string from given string;\n */\nexport function abbreviate(str: string, abbrLettersCount: number = 1): string {\n const words = str.replace(/([a-z\\xE0-\\xFF])([A-Z\\xC0\\xDF])/g, \"$1 $2\").split(\" \");\n return words.reduce((res, word) => {\n res += word.substr(0, abbrLettersCount);\n return res;\n }, \"\");\n}\n\nexport interface IShortenOptions {\n /** String used to split \"segments\" of the alias/column name */\n separator?: string;\n /** Maximum length of any \"segment\" */\n segmentLength?: number;\n /** Length of any \"term\" in a \"segment\"; \"OrderItem\" is a segment, \"Order\" and \"Items\" are terms */\n termLength?: number;\n }\n\n /**\n * Shorten a given `input`. Useful for RDBMS imposing a limit on the\n * maximum length of aliases and column names in SQL queries.\n *\n * @param input String to be shortened.\n * @param options Default to `4` for segments length, `2` for terms length, `'__'` as a separator.\n *\n * @return Shortened `input`.\n *\n * @example\n * // returns: \"UsShCa__orde__mark__dire\"\n * shorten('UserShoppingCart__order__market__director')\n *\n * // returns: \"cat_wit_ver_lon_nam_pos_wit_ver_lon_nam_pos_wit_ver_lon_nam\"\n * shorten(\n * 'category_with_very_long_name_posts_with_very_long_name_post_with_very_long_name',\n * { separator: '_', segmentLength: 3 }\n * )\n *\n * // equals: UsShCa__orde__mark_market_id\n * `${shorten('UserShoppingCart__order__market')}_market_id`\n */\n export function shorten(input: string, options: IShortenOptions = {}): string {\n const { segmentLength = 4, separator = \"__\", termLength = 2 } = options;\n\n const segments = input.split(separator);\n const shortSegments = segments.reduce((acc: string[], val: string) => {\n // split the given segment into many terms based on an eventual camel cased name\n const segmentTerms = val.replace(/([a-z\\xE0-\\xFF])([A-Z\\xC0-\\xDF])/g, \"$1 $2\").split(\" \");\n // \"OrderItemList\" becomes \"OrItLi\", while \"company\" becomes \"comp\"\n const length = segmentTerms.length > 1 ? termLength : segmentLength;\n const shortSegment = segmentTerms.map(term => term.substr(0, length)).join(\"\");\n\n acc.push(shortSegment);\n return acc;\n }, []);\n\n return shortSegments.join(separator);\n }\n\ninterface IHashOptions {\n length?: number;\n}\n\n/**\n * Returns a hashed input.\n *\n * @param input String to be hashed.\n * @param options.length Optionally, shorten the output to desired length.\n */\nexport function hash(input: string, options: IHashOptions = {}): string {\n const hashFunction = shajs(\"sha256\");\n\n hashFunction.update(input, \"utf8\");\n\n const hashedInput = hashFunction.digest(\"hex\");\n\n if (options.length) {\n return hashedInput.slice(0, options.length);\n }\n\n return hashedInput;\n }\n"],"sourceRoot":".."}
package/cli.js CHANGED
File without changes
@@ -58,12 +58,12 @@ var SchemaLogCommand = /** @class */ (function () {
58
58
  case 4:
59
59
  sqlInMemory = _a.sent();
60
60
  if (sqlInMemory.upQueries.length === 0) {
61
- console.log(chalk_1.default.yellow("Your schema is up to date - there are no queries to be executed by schema syncronization."));
61
+ console.log(chalk_1.default.yellow("Your schema is up to date - there are no queries to be executed by schema synchronization."));
62
62
  }
63
63
  else {
64
64
  lengthSeparators = String(sqlInMemory.upQueries.length).split("").map(function (char) { return "-"; }).join("");
65
65
  console.log(chalk_1.default.yellow("---------------------------------------------------------------" + lengthSeparators));
66
- console.log(chalk_1.default.yellow.bold("-- Schema syncronization will execute following sql queries (" + chalk_1.default.white(sqlInMemory.upQueries.length.toString()) + "):"));
66
+ console.log(chalk_1.default.yellow.bold("-- Schema synchronization will execute following sql queries (" + chalk_1.default.white(sqlInMemory.upQueries.length.toString()) + "):"));
67
67
  console.log(chalk_1.default.yellow("---------------------------------------------------------------" + lengthSeparators));
68
68
  sqlInMemory.upQueries.forEach(function (upQuery) {
69
69
  var sqlString = upQuery.query;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/commands/SchemaLogCommand.ts"],"names":[],"mappings":";;;;AAAA,sCAA4C;AAE5C,iFAA8E;AAC9E,+CAAwC;AAExC,wDAA0B;AAE1B;;GAEG;AACH;IAAA;QAEI,YAAO,GAAG,YAAY,CAAC;QACvB,aAAQ,GAAG,sGAAsG;YAC7G,+DAA+D,CAAC;IA4DxE,CAAC;IA1DG,kCAAO,GAAP,UAAQ,IAAgB;QACpB,OAAO,IAAI;aACN,MAAM,CAAC,GAAG,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,kEAAkE;SAC/E,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACT,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,WAAW;YACpB,QAAQ,EAAE,iDAAiD;SAC9D,CAAC,CAAC;IACX,CAAC;IAEK,kCAAO,GAAb,UAAc,IAAqB;;;;;;wBAE3B,UAAU,GAAyB,SAAS,CAAC;;;;wBAGvC,uBAAuB,GAAG,IAAI,iDAAuB,CAAC;4BACxD,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE;4BACnB,UAAU,EAAE,IAAI,CAAC,MAAa;yBACjC,CAAC,CAAC;wBACuB,qBAAM,uBAAuB,CAAC,GAA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AS,GAAG,OAAO,CAAC,KAAK,CAAC;gCAC9B,SAAS,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;gCAC7B,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC;gCACvE,OAAO,CAAC,GAAG,CAAC,yBAAS,CAAC,SAAS,CAAC,CAAC,CAAC;4BACtC,CAAC,CAAC,CAAC;yBACN;wBACD,qBAAM,UAAU,CAAC,KAAK,EAAE,EAAA;;wBAAxB,SAAwB,CAAC;;;;wBAGzB,IAAI,UAAU;4BAEd,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC,CAAC;wBACvE,OAAO,CAAC,KAAK,CAAC,KAAG,CAAC,CAAC;wBACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;;;KAEvB;IACL,uBAAC;AAAD,CAhEA,AAgEC,IAAA;AAhEY,4CAAgB","file":"SchemaLogCommand.js","sourcesContent":["import {createConnection} from \"../globals\";\nimport {Connection} from \"../connection/Connection\";\nimport {ConnectionOptionsReader} from \"../connection/ConnectionOptionsReader\";\nimport {highlight} from \"cli-highlight\";\nimport * as yargs from \"yargs\";\nimport chalk from \"chalk\";\n\n/**\n * Shows sql to be executed by schema:sync command.\n */\nexport class SchemaLogCommand implements yargs.CommandModule {\n\n command = \"schema:log\";\n describe = \"Shows sql to be executed by schema:sync command. It shows sql log only for your default connection. \" +\n \"To run update queries on a concrete connection use -c option.\";\n\n builder(args: yargs.Argv) {\n return args\n .option(\"c\", {\n alias: \"connection\",\n default: \"default\",\n describe: \"Name of the connection of which schema sync log should be shown.\"\n })\n .option(\"f\", {\n alias: \"config\",\n default: \"ormconfig\",\n describe: \"Name of the file with connection configuration.\"\n });\n }\n\n async handler(args: yargs.Arguments) {\n\n let connection: Connection|undefined = undefined;\n try {\n\n const connectionOptionsReader = new ConnectionOptionsReader({\n root: process.cwd(),\n configName: args.config as any\n });\n const connectionOptions = await connectionOptionsReader.get(args.connection as any);\n Object.assign(connectionOptions, {\n synchronize: false,\n migrationsRun: false,\n dropSchema: false,\n logging: false\n });\n connection = await createConnection(connectionOptions);\n const sqlInMemory = await connection.driver.createSchemaBuilder().log();\n if (sqlInMemory.upQueries.length === 0) {\n console.log(chalk.yellow(\"Your schema is up to date - there are no queries to be executed by schema syncronization.\"));\n\n } else {\n const lengthSeparators = String(sqlInMemory.upQueries.length).split(\"\").map(char => \"-\").join(\"\");\n console.log(chalk.yellow(\"---------------------------------------------------------------\" + lengthSeparators));\n console.log(chalk.yellow.bold(`-- Schema syncronization will execute following sql queries (${chalk.white(sqlInMemory.upQueries.length.toString())}):`));\n console.log(chalk.yellow(\"---------------------------------------------------------------\" + lengthSeparators));\n\n sqlInMemory.upQueries.forEach(upQuery => {\n let sqlString = upQuery.query;\n sqlString = sqlString.trim();\n sqlString = sqlString.substr(-1) === \";\" ? sqlString : sqlString + \";\";\n console.log(highlight(sqlString));\n });\n }\n await connection.close();\n\n } catch (err) {\n if (connection)\n\n console.log(chalk.black.bgRed(\"Error during schema synchronization:\"));\n console.error(err);\n process.exit(1);\n }\n }\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/commands/SchemaLogCommand.ts"],"names":[],"mappings":";;;;AAAA,sCAA4C;AAE5C,iFAA8E;AAC9E,+CAAwC;AAExC,wDAA0B;AAE1B;;GAEG;AACH;IAAA;QAEI,YAAO,GAAG,YAAY,CAAC;QACvB,aAAQ,GAAG,sGAAsG;YAC7G,+DAA+D,CAAC;IA4DxE,CAAC;IA1DG,kCAAO,GAAP,UAAQ,IAAgB;QACpB,OAAO,IAAI;aACN,MAAM,CAAC,GAAG,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,kEAAkE;SAC/E,CAAC;aACD,MAAM,C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AAgB,CAAC,CAAC,CAAC;4BAChH,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,IAAI,CAAC,mEAAiE,eAAK,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,OAAI,CAAC,CAAC,CAAC;4BAC1J,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,iEAAiE,GAAG,gBAAgB,CAAC,CAAC,CAAC;4BAEhH,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,UAAA,OAAO;gCACjC,IAAI,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC;gCAC9B,SAAS,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;gCAC7B,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC;gCACvE,OAAO,CAAC,GAAG,CAAC,yBAAS,CAAC,SAAS,CAAC,CAAC,CAAC;4BACtC,CAAC,CAAC,CAAC;yBACN;wBACD,qBAAM,UAAU,CAAC,KAAK,EAAE,EAAA;;wBAAxB,SAAwB,CAAC;;;;wBAGzB,IAAI,UAAU;4BAEd,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC,CAAC;wBACvE,OAAO,CAAC,KAAK,CAAC,KAAG,CAAC,CAAC;wBACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;;;KAEvB;IACL,uBAAC;AAAD,CAhEA,AAgEC,IAAA;AAhEY,4CAAgB","file":"SchemaLogCommand.js","sourcesContent":["import {createConnection} from \"../globals\";\nimport {Connection} from \"../connection/Connection\";\nimport {ConnectionOptionsReader} from \"../connection/ConnectionOptionsReader\";\nimport {highlight} from \"cli-highlight\";\nimport * as yargs from \"yargs\";\nimport chalk from \"chalk\";\n\n/**\n * Shows sql to be executed by schema:sync command.\n */\nexport class SchemaLogCommand implements yargs.CommandModule {\n\n command = \"schema:log\";\n describe = \"Shows sql to be executed by schema:sync command. It shows sql log only for your default connection. \" +\n \"To run update queries on a concrete connection use -c option.\";\n\n builder(args: yargs.Argv) {\n return args\n .option(\"c\", {\n alias: \"connection\",\n default: \"default\",\n describe: \"Name of the connection of which schema sync log should be shown.\"\n })\n .option(\"f\", {\n alias: \"config\",\n default: \"ormconfig\",\n describe: \"Name of the file with connection configuration.\"\n });\n }\n\n async handler(args: yargs.Arguments) {\n\n let connection: Connection|undefined = undefined;\n try {\n\n const connectionOptionsReader = new ConnectionOptionsReader({\n root: process.cwd(),\n configName: args.config as any\n });\n const connectionOptions = await connectionOptionsReader.get(args.connection as any);\n Object.assign(connectionOptions, {\n synchronize: false,\n migrationsRun: false,\n dropSchema: false,\n logging: false\n });\n connection = await createConnection(connectionOptions);\n const sqlInMemory = await connection.driver.createSchemaBuilder().log();\n if (sqlInMemory.upQueries.length === 0) {\n console.log(chalk.yellow(\"Your schema is up to date - there are no queries to be executed by schema synchronization.\"));\n\n } else {\n const lengthSeparators = String(sqlInMemory.upQueries.length).split(\"\").map(char => \"-\").join(\"\");\n console.log(chalk.yellow(\"---------------------------------------------------------------\" + lengthSeparators));\n console.log(chalk.yellow.bold(`-- Schema synchronization will execute following sql queries (${chalk.white(sqlInMemory.upQueries.length.toString())}):`));\n console.log(chalk.yellow(\"---------------------------------------------------------------\" + lengthSeparators));\n\n sqlInMemory.upQueries.forEach(upQuery => {\n let sqlString = upQuery.query;\n sqlString = sqlString.trim();\n sqlString = sqlString.substr(-1) === \";\" ? sqlString : sqlString + \";\";\n console.log(highlight(sqlString));\n });\n }\n await connection.close();\n\n } catch (err) {\n if (connection)\n\n console.log(chalk.black.bgRed(\"Error during schema synchronization:\"));\n console.error(err);\n process.exit(1);\n }\n }\n}\n"],"sourceRoot":".."}
@@ -59,7 +59,7 @@ var SchemaSyncCommand = /** @class */ (function () {
59
59
  return [4 /*yield*/, connection.close()];
60
60
  case 5:
61
61
  _a.sent();
62
- console.log(chalk_1.default.green("Schema syncronization finished successfully."));
62
+ console.log(chalk_1.default.green("Schema synchronization finished successfully."));
63
63
  return [3 /*break*/, 9];
64
64
  case 6:
65
65
  err_1 = _a.sent();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/commands/SchemaSyncCommand.ts"],"names":[],"mappings":";;;;AAAA,sCAA4C;AAE5C,iFAA8E;AAE9E,wDAA0B;AAE1B;;GAEG;AACH;IAAA;QACI,YAAO,GAAG,aAAa,CAAC;QACxB,aAAQ,GAAG,8GAA8G;YACrH,+DAA+D,CAAC;IA6CxE,CAAC;IA3CG,mCAAO,GAAP,UAAQ,IAAgB;QACpB,OAAO,IAAI;aACN,MAAM,CAAC,GAAG,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,yEAAyE;SACtF,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACT,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,WAAW;YACpB,QAAQ,EAAE,iDAAiD;SAC9D,CAAC,CAAC;IACX,CAAC;IAEK,mCAAO,GAAb,UAAc,IAAqB;;;;;;wBAE3B,UAAU,GAAyB,SAAS,CAAC;;;;wBAEvC,uBAAuB,GAAG,IAAI,iDAAuB,CAAC;4BACxD,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE;4BACnB,UAAU,EAAE,IAAI,CAAC,MAAa;yBACjC,CAAC,CAAC;wBACuB,qBAAM,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,UAAiB,CAAC,EAAA;;wBAA7E,iBAAiB,GAAG,SAAyD;wBACnF,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE;4BAC7B,WAAW,EAAE,KAAK;4BAClB,aAAa,EAAE,KAAK;4BACpB,UAAU,EAAE,KAAK;4BACjB,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;yBAC/B,CAAC,CAAC;wBACU,qBAAM,0BAAgB,CAAC,iBAAiB,CAAC,EAAA;;wBAAtD,UAAU,GAAG,SAAyC,CAAC;wBACvD,qBAAM,UAAU,CAAC,WAAW,EAAE,EAAA;;wBAA9B,SAA8B,CAAC;wBAC/B,qBAAM,UAAU,CAAC,KAAK,EAAE,EAAA;;wBAAxB,SAAwB,CAAC;wBAEzB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC,CAAC;;;;6BAGrE,UAAU,EAAV,wBAAU;wBAAE,qBAAO,UAAyB,CAAC,KAAK,EAAE,EAAA;;wBAAxC,SAAwC,CAAC;;;wBAEzD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC,CAAC;wBACvE,OAAO,CAAC,KAAK,CAAC,KAAG,CAAC,CAAC;wBACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;;;KAEvB;IACL,wBAAC;AAAD,CAhDA,AAgDC,IAAA;AAhDY,8CAAiB","file":"SchemaSyncCommand.js","sourcesContent":["import {createConnection} from \"../globals\";\nimport {Connection} from \"../connection/Connection\";\nimport {ConnectionOptionsReader} from \"../connection/ConnectionOptionsReader\";\nimport * as yargs from \"yargs\";\nimport chalk from \"chalk\";\n\n/**\n * Synchronizes database schema with entities.\n */\nexport class SchemaSyncCommand implements yargs.CommandModule {\n command = \"schema:sync\";\n describe = \"Synchronizes your entities with database schema. It runs schema update queries on all connections you have. \" +\n \"To run update queries on a concrete connection use -c option.\";\n\n builder(args: yargs.Argv) {\n return args\n .option(\"c\", {\n alias: \"connection\",\n default: \"default\",\n describe: \"Name of the connection on which schema synchronization needs to to run.\"\n })\n .option(\"f\", {\n alias: \"config\",\n default: \"ormconfig\",\n describe: \"Name of the file with connection configuration.\"\n });\n }\n\n async handler(args: yargs.Arguments) {\n\n let connection: Connection|undefined = undefined;\n try {\n const connectionOptionsReader = new ConnectionOptionsReader({\n root: process.cwd(),\n configName: args.config as any\n });\n const connectionOptions = await connectionOptionsReader.get(args.connection as any);\n Object.assign(connectionOptions, {\n synchronize: false,\n migrationsRun: false,\n dropSchema: false,\n logging: [\"query\", \"schema\"]\n });\n connection = await createConnection(connectionOptions);\n await connection.synchronize();\n await connection.close();\n\n console.log(chalk.green(\"Schema syncronization finished successfully.\"));\n\n } catch (err) {\n if (connection) await (connection as Connection).close();\n\n console.log(chalk.black.bgRed(\"Error during schema synchronization:\"));\n console.error(err);\n process.exit(1);\n }\n }\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/commands/SchemaSyncCommand.ts"],"names":[],"mappings":";;;;AAAA,sCAA4C;AAE5C,iFAA8E;AAE9E,wDAA0B;AAE1B;;GAEG;AACH;IAAA;QACI,YAAO,GAAG,aAAa,CAAC;QACxB,aAAQ,GAAG,8GAA8G;YACrH,+DAA+D,CAAC;IA6CxE,CAAC;IA3CG,mCAAO,GAAP,UAAQ,IAAgB;QACpB,OAAO,IAAI;aACN,MAAM,CAAC,GAAG,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,yEAAyE;SACtF,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACT,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,WAAW;YACpB,QAAQ,EAAE,iDAAiD;SAC9D,CAAC,CAAC;IACX,CAAC;IAEK,mCAAO,GAAb,UAAc,IAAqB;;;;;;wBAE3B,UAAU,GAAyB,SAAS,CAAC;;;;wBAEvC,uBAAuB,GAAG,IAAI,iDAAuB,CAAC;4BACxD,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE;4BACnB,UAAU,EAAE,IAAI,CAAC,MAAa;yBACjC,CAAC,CAAC;wBACuB,qBAAM,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,UAAiB,CAAC,EAAA;;wBAA7E,iBAAiB,GAAG,SAAyD;wBACnF,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE;4BAC7B,WAAW,EAAE,KAAK;4BAClB,aAAa,EAAE,KAAK;4BACpB,UAAU,EAAE,KAAK;4BACjB,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;yBAC/B,CAAC,CAAC;wBACU,qBAAM,0BAAgB,CAAC,iBAAiB,CAAC,EAAA;;wBAAtD,UAAU,GAAG,SAAyC,CAAC;wBACvD,qBAAM,UAAU,CAAC,WAAW,EAAE,EAAA;;wBAA9B,SAA8B,CAAC;wBAC/B,qBAAM,UAAU,CAAC,KAAK,EAAE,EAAA;;wBAAxB,SAAwB,CAAC;wBAEzB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC,CAAC;;;;6BAGtE,UAAU,EAAV,wBAAU;wBAAE,qBAAO,UAAyB,CAAC,KAAK,EAAE,EAAA;;wBAAxC,SAAwC,CAAC;;;wBAEzD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC,CAAC;wBACvE,OAAO,CAAC,KAAK,CAAC,KAAG,CAAC,CAAC;wBACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;;;KAEvB;IACL,wBAAC;AAAD,CAhDA,AAgDC,IAAA;AAhDY,8CAAiB","file":"SchemaSyncCommand.js","sourcesContent":["import {createConnection} from \"../globals\";\nimport {Connection} from \"../connection/Connection\";\nimport {ConnectionOptionsReader} from \"../connection/ConnectionOptionsReader\";\nimport * as yargs from \"yargs\";\nimport chalk from \"chalk\";\n\n/**\n * Synchronizes database schema with entities.\n */\nexport class SchemaSyncCommand implements yargs.CommandModule {\n command = \"schema:sync\";\n describe = \"Synchronizes your entities with database schema. It runs schema update queries on all connections you have. \" +\n \"To run update queries on a concrete connection use -c option.\";\n\n builder(args: yargs.Argv) {\n return args\n .option(\"c\", {\n alias: \"connection\",\n default: \"default\",\n describe: \"Name of the connection on which schema synchronization needs to to run.\"\n })\n .option(\"f\", {\n alias: \"config\",\n default: \"ormconfig\",\n describe: \"Name of the file with connection configuration.\"\n });\n }\n\n async handler(args: yargs.Arguments) {\n\n let connection: Connection|undefined = undefined;\n try {\n const connectionOptionsReader = new ConnectionOptionsReader({\n root: process.cwd(),\n configName: args.config as any\n });\n const connectionOptions = await connectionOptionsReader.get(args.connection as any);\n Object.assign(connectionOptions, {\n synchronize: false,\n migrationsRun: false,\n dropSchema: false,\n logging: [\"query\", \"schema\"]\n });\n connection = await createConnection(connectionOptions);\n await connection.synchronize();\n await connection.close();\n\n console.log(chalk.green(\"Schema synchronization finished successfully.\"));\n\n } catch (err) {\n if (connection) await (connection as Connection).close();\n\n console.log(chalk.black.bgRed(\"Error during schema synchronization:\"));\n console.error(err);\n process.exit(1);\n }\n }\n}\n"],"sourceRoot":".."}
@@ -21,11 +21,15 @@ export interface Driver {
21
21
  */
22
22
  options: BaseConnectionOptions;
23
23
  /**
24
- * Master database used to perform all write queries.
24
+ * Database name used to perform all write queries.
25
25
  *
26
26
  * todo: probably move into query runner.
27
27
  */
28
28
  database?: string;
29
+ /**
30
+ * Schema name used to perform all write queries.
31
+ */
32
+ schema?: string;
29
33
  /**
30
34
  * Indicates if replication is enabled.
31
35
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/driver/Driver.ts"],"names":[],"mappings":"","file":"Driver.js","sourcesContent":["import {QueryRunner} from \"../query-runner/QueryRunner\";\nimport {ColumnMetadata} from \"../metadata/ColumnMetadata\";\nimport {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {ColumnType} from \"./types/ColumnTypes\";\nimport {MappedColumnTypes} from \"./types/MappedColumnTypes\";\nimport {SchemaBuilder} from \"../schema-builder/SchemaBuilder\";\nimport {DataTypeDefaults} from \"./types/DataTypeDefaults\";\nimport {BaseConnectionOptions} from \"../connection/BaseConnectionOptions\";\nimport {TableColumn} from \"../schema-builder/table/TableColumn\";\nimport {EntityMetadata} from \"../metadata/EntityMetadata\";\nimport {ReplicationMode} from \"./types/ReplicationMode\";\nimport { Table } from \"../schema-builder/table/Table\";\nimport { View } from \"../schema-builder/view/View\";\nimport { TableForeignKey } from \"../schema-builder/table/TableForeignKey\";\n\n/**\n * Driver organizes TypeORM communication with specific database management system.\n */\nexport interface Driver {\n\n /**\n * Connection options.\n */\n options: BaseConnectionOptions;\n\n /**\n * Master database used to perform all write queries.\n *\n * todo: probably move into query runner.\n */\n database?: string;\n\n /**\n * Indicates if replication is enabled.\n */\n isReplicated: boolean;\n\n /**\n * Indicates if tree tables are supported by this driver.\n */\n treeSupport: boolean;\n\n /**\n * Gets list of supported column data types by a driver.\n */\n supportedDataTypes: ColumnType[];\n\n /**\n * Default values of length, precision and scale depends on column data type.\n * Used in the cases when length/precision/scale is not specified by user.\n */\n dataTypeDefaults: DataTypeDefaults;\n\n /**\n * Gets list of spatial column data types.\n */\n spatialTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support length by a driver.\n */\n withLengthColumnTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support precision by a driver.\n */\n withPrecisionColumnTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support scale by a driver.\n */\n withScaleColumnTypes: ColumnType[];\n\n /**\n * Orm has special columns and we need to know what database column types should be for those types.\n * Column types are driver dependant.\n */\n mappedDataTypes: MappedColumnTypes;\n\n /**\n * Max length allowed by the DBMS for aliases (execution of queries).\n */\n maxAliasLength?: number;\n\n /**\n * Performs connection to the database.\n * Depend on driver type it may create a connection pool.\n */\n connect(): Promise<void>;\n\n /**\n * Makes any action after connection (e.g. create extensions in Postgres driver).\n */\n afterConnect(): Promise<void>;\n\n /**\n * Closes connection with database and releases all resources.\n */\n disconnect(): Promise<void>;\n\n /**\n * Synchronizes database schema (creates tables, indices, etc).\n */\n createSchemaBuilder(): SchemaBuilder;\n\n /**\n * Creates a query runner used for common queries.\n */\n createQueryRunner(mode: ReplicationMode): QueryRunner;\n\n /**\n * Replaces parameters in the given sql with special escaping character\n * and an array of parameter names to be passed to a query.\n */\n escapeQueryWithParameters(sql: string, parameters: ObjectLiteral, nativeParameters: ObjectLiteral): [string, any[]];\n\n /**\n * Escapes a table name, column name or an alias.\n *\n * todo: probably escape should be able to handle dots in the names and automatically escape them\n */\n escape(name: string): string;\n\n /**\n * Build full table name with database name, schema name and table name.\n * E.g. myDB.mySchema.myTable\n */\n buildTableName(tableName: string, schema?: string, database?: string): string;\n\n /**\n * Parse a target table name or other types and return a normalized table definition.\n */\n parseTableName(target: EntityMetadata | Table | View | TableForeignKey | string): { tableName: string, schema?: string, database?: string };\n\n /**\n * Prepares given value to a value to be persisted, based on its column type and metadata.\n */\n preparePersistentValue(value: any, column: ColumnMetadata): any;\n\n /**\n * Prepares given value to a value to be persisted, based on its column type.\n */\n prepareHydratedValue(value: any, column: ColumnMetadata): any;\n\n /**\n * Transforms type of the given column to a database column type.\n */\n normalizeType(column: { type?: ColumnType|string, length?: number|string, precision?: number|null, scale?: number, isArray?: boolean }): string;\n\n /**\n * Normalizes \"default\" value of the column.\n */\n normalizeDefault(columnMetadata: ColumnMetadata): string | undefined;\n\n /**\n * Normalizes \"isUnique\" value of the column.\n */\n normalizeIsUnique(column: ColumnMetadata): boolean;\n\n /**\n * Calculates column length taking into account the default length values.\n */\n getColumnLength(column: ColumnMetadata): string;\n\n /**\n * Normalizes \"default\" value of the column.\n */\n createFullType(column: TableColumn): string;\n\n /**\n * Obtains a new database connection to a master server.\n * Used for replication.\n * If replication is not setup then returns default connection's database connection.\n */\n obtainMasterConnection(): Promise<any>;\n\n /**\n * Obtains a new database connection to a slave server.\n * Used for replication.\n * If replication is not setup then returns master (default) connection's database connection.\n */\n obtainSlaveConnection(): Promise<any>;\n\n /**\n * Creates generated map of values generated or returned by database after INSERT query.\n */\n createGeneratedMap(metadata: EntityMetadata, insertResult: any, entityIndex?: number, entityNum?: number): ObjectLiteral|undefined;\n\n /**\n * Differentiate columns of this table and columns from the given column metadatas columns\n * and returns only changed.\n */\n findChangedColumns(tableColumns: TableColumn[], columnMetadatas: ColumnMetadata[]): ColumnMetadata[];\n\n /**\n * Returns true if driver supports RETURNING / OUTPUT statement.\n */\n isReturningSqlSupported(): boolean;\n\n /**\n * Returns true if driver supports uuid values generation on its own.\n */\n isUUIDGenerationSupported(): boolean;\n\n /**\n * Returns true if driver supports fulltext indices.\n */\n isFullTextColumnTypeSupported(): boolean;\n\n /**\n * Creates an escaped parameter.\n */\n createParameter(parameterName: string, index: number): string;\n\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/driver/Driver.ts"],"names":[],"mappings":"","file":"Driver.js","sourcesContent":["import {QueryRunner} from \"../query-runner/QueryRunner\";\nimport {ColumnMetadata} from \"../metadata/ColumnMetadata\";\nimport {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {ColumnType} from \"./types/ColumnTypes\";\nimport {MappedColumnTypes} from \"./types/MappedColumnTypes\";\nimport {SchemaBuilder} from \"../schema-builder/SchemaBuilder\";\nimport {DataTypeDefaults} from \"./types/DataTypeDefaults\";\nimport {BaseConnectionOptions} from \"../connection/BaseConnectionOptions\";\nimport {TableColumn} from \"../schema-builder/table/TableColumn\";\nimport {EntityMetadata} from \"../metadata/EntityMetadata\";\nimport {ReplicationMode} from \"./types/ReplicationMode\";\nimport { Table } from \"../schema-builder/table/Table\";\nimport { View } from \"../schema-builder/view/View\";\nimport { TableForeignKey } from \"../schema-builder/table/TableForeignKey\";\n\n/**\n * Driver organizes TypeORM communication with specific database management system.\n */\nexport interface Driver {\n\n /**\n * Connection options.\n */\n options: BaseConnectionOptions;\n\n /**\n * Database name used to perform all write queries.\n *\n * todo: probably move into query runner.\n */\n database?: string;\n\n /**\n * Schema name used to perform all write queries.\n */\n schema?: string;\n\n /**\n * Indicates if replication is enabled.\n */\n isReplicated: boolean;\n\n /**\n * Indicates if tree tables are supported by this driver.\n */\n treeSupport: boolean;\n\n /**\n * Gets list of supported column data types by a driver.\n */\n supportedDataTypes: ColumnType[];\n\n /**\n * Default values of length, precision and scale depends on column data type.\n * Used in the cases when length/precision/scale is not specified by user.\n */\n dataTypeDefaults: DataTypeDefaults;\n\n /**\n * Gets list of spatial column data types.\n */\n spatialTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support length by a driver.\n */\n withLengthColumnTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support precision by a driver.\n */\n withPrecisionColumnTypes: ColumnType[];\n\n /**\n * Gets list of column data types that support scale by a driver.\n */\n withScaleColumnTypes: ColumnType[];\n\n /**\n * Orm has special columns and we need to know what database column types should be for those types.\n * Column types are driver dependant.\n */\n mappedDataTypes: MappedColumnTypes;\n\n /**\n * Max length allowed by the DBMS for aliases (execution of queries).\n */\n maxAliasLength?: number;\n\n /**\n * Performs connection to the database.\n * Depend on driver type it may create a connection pool.\n */\n connect(): Promise<void>;\n\n /**\n * Makes any action after connection (e.g. create extensions in Postgres driver).\n */\n afterConnect(): Promise<void>;\n\n /**\n * Closes connection with database and releases all resources.\n */\n disconnect(): Promise<void>;\n\n /**\n * Synchronizes database schema (creates tables, indices, etc).\n */\n createSchemaBuilder(): SchemaBuilder;\n\n /**\n * Creates a query runner used for common queries.\n */\n createQueryRunner(mode: ReplicationMode): QueryRunner;\n\n /**\n * Replaces parameters in the given sql with special escaping character\n * and an array of parameter names to be passed to a query.\n */\n escapeQueryWithParameters(sql: string, parameters: ObjectLiteral, nativeParameters: ObjectLiteral): [string, any[]];\n\n /**\n * Escapes a table name, column name or an alias.\n *\n * todo: probably escape should be able to handle dots in the names and automatically escape them\n */\n escape(name: string): string;\n\n /**\n * Build full table name with database name, schema name and table name.\n * E.g. myDB.mySchema.myTable\n */\n buildTableName(tableName: string, schema?: string, database?: string): string;\n\n /**\n * Parse a target table name or other types and return a normalized table definition.\n */\n parseTableName(target: EntityMetadata | Table | View | TableForeignKey | string): { tableName: string, schema?: string, database?: string };\n\n /**\n * Prepares given value to a value to be persisted, based on its column type and metadata.\n */\n preparePersistentValue(value: any, column: ColumnMetadata): any;\n\n /**\n * Prepares given value to a value to be persisted, based on its column type.\n */\n prepareHydratedValue(value: any, column: ColumnMetadata): any;\n\n /**\n * Transforms type of the given column to a database column type.\n */\n normalizeType(column: { type?: ColumnType|string, length?: number|string, precision?: number|null, scale?: number, isArray?: boolean }): string;\n\n /**\n * Normalizes \"default\" value of the column.\n */\n normalizeDefault(columnMetadata: ColumnMetadata): string | undefined;\n\n /**\n * Normalizes \"isUnique\" value of the column.\n */\n normalizeIsUnique(column: ColumnMetadata): boolean;\n\n /**\n * Calculates column length taking into account the default length values.\n */\n getColumnLength(column: ColumnMetadata): string;\n\n /**\n * Normalizes \"default\" value of the column.\n */\n createFullType(column: TableColumn): string;\n\n /**\n * Obtains a new database connection to a master server.\n * Used for replication.\n * If replication is not setup then returns default connection's database connection.\n */\n obtainMasterConnection(): Promise<any>;\n\n /**\n * Obtains a new database connection to a slave server.\n * Used for replication.\n * If replication is not setup then returns master (default) connection's database connection.\n */\n obtainSlaveConnection(): Promise<any>;\n\n /**\n * Creates generated map of values generated or returned by database after INSERT query.\n */\n createGeneratedMap(metadata: EntityMetadata, insertResult: any, entityIndex?: number, entityNum?: number): ObjectLiteral|undefined;\n\n /**\n * Differentiate columns of this table and columns from the given column metadatas columns\n * and returns only changed.\n */\n findChangedColumns(tableColumns: TableColumn[], columnMetadatas: ColumnMetadata[]): ColumnMetadata[];\n\n /**\n * Returns true if driver supports RETURNING / OUTPUT statement.\n */\n isReturningSqlSupported(): boolean;\n\n /**\n * Returns true if driver supports uuid values generation on its own.\n */\n isUUIDGenerationSupported(): boolean;\n\n /**\n * Returns true if driver supports fulltext indices.\n */\n isFullTextColumnTypeSupported(): boolean;\n\n /**\n * Creates an escaped parameter.\n */\n createParameter(parameterName: string, index: number): string;\n\n}\n"],"sourceRoot":".."}
@@ -39,9 +39,13 @@ export declare class AuroraDataApiDriver implements Driver {
39
39
  */
40
40
  options: AuroraDataApiConnectionOptions;
41
41
  /**
42
- * Master database used to perform all write queries.
42
+ * Database name used to perform all write queries.
43
43
  */
44
44
  database?: string;
45
+ /**
46
+ * Schema name used to performn all write queries.
47
+ */
48
+ schema?: string;
45
49
  /**
46
50
  * Indicates if replication is enabled.
47
51
  */
@@ -266,8 +266,24 @@ var AuroraDataApiDriver = /** @class */ (function () {
266
266
  */
267
267
  AuroraDataApiDriver.prototype.connect = function () {
268
268
  return tslib_1.__awaiter(this, void 0, void 0, function () {
269
- return tslib_1.__generator(this, function (_a) {
270
- return [2 /*return*/];
269
+ var queryRunner, _a;
270
+ return tslib_1.__generator(this, function (_b) {
271
+ switch (_b.label) {
272
+ case 0:
273
+ if (!!this.database) return [3 /*break*/, 4];
274
+ return [4 /*yield*/, this.createQueryRunner("master")];
275
+ case 1:
276
+ queryRunner = _b.sent();
277
+ _a = this;
278
+ return [4 /*yield*/, queryRunner.getCurrentDatabase()];
279
+ case 2:
280
+ _a.database = _b.sent();
281
+ return [4 /*yield*/, queryRunner.release()];
282
+ case 3:
283
+ _b.sent();
284
+ _b.label = 4;
285
+ case 4: return [2 /*return*/];
286
+ }
271
287
  });
272
288
  });
273
289
  };