typeorm 0.3.18-dev.a909d5b → 0.3.18-dev.c6f608d

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 (79) hide show
  1. package/README.md +23 -23
  2. package/browser/driver/DriverUtils.js +2 -5
  3. package/browser/driver/DriverUtils.js.map +1 -1
  4. package/browser/driver/sqlserver/SqlServerConnectionCredentialsOptions.d.ts +2 -1
  5. package/browser/driver/sqlserver/SqlServerConnectionCredentialsOptions.js.map +1 -1
  6. package/browser/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
  7. package/browser/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
  8. package/browser/driver/sqlserver/SqlServerQueryRunner.js +13 -0
  9. package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  10. package/browser/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.d.ts +12 -0
  11. package/browser/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.js +3 -0
  12. package/browser/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.js.map +1 -0
  13. package/browser/error/QueryFailedError.d.ts +3 -3
  14. package/browser/error/QueryFailedError.js.map +1 -1
  15. package/browser/find-options/FindOptionsUtils.js +1 -1
  16. package/browser/find-options/FindOptionsUtils.js.map +1 -1
  17. package/browser/index.d.ts +1 -0
  18. package/browser/index.js +1 -0
  19. package/browser/index.js.map +1 -1
  20. package/browser/naming-strategy/DefaultNamingStrategy.d.ts +0 -1
  21. package/browser/naming-strategy/DefaultNamingStrategy.js +0 -3
  22. package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
  23. package/browser/naming-strategy/NamingStrategyInterface.d.ts +0 -4
  24. package/browser/naming-strategy/NamingStrategyInterface.js.map +1 -1
  25. package/browser/persistence/Subject.js +2 -1
  26. package/browser/persistence/Subject.js.map +1 -1
  27. package/browser/query-builder/QueryBuilder.js +1 -1
  28. package/browser/query-builder/QueryBuilder.js.map +1 -1
  29. package/browser/repository/Repository.d.ts +1 -1
  30. package/browser/repository/Repository.js +9 -5
  31. package/browser/repository/Repository.js.map +1 -1
  32. package/commands/CommandUtils.js +6 -1
  33. package/commands/CommandUtils.js.map +1 -1
  34. package/commands/EntityCreateCommand.d.ts +3 -0
  35. package/commands/EntityCreateCommand.js +7 -0
  36. package/commands/EntityCreateCommand.js.map +1 -1
  37. package/commands/InitCommand.js +1 -1
  38. package/commands/InitCommand.js.map +1 -1
  39. package/commands/MigrationCreateCommand.d.ts +5 -1
  40. package/commands/MigrationCreateCommand.js +6 -1
  41. package/commands/MigrationCreateCommand.js.map +1 -1
  42. package/commands/MigrationGenerateCommand.d.ts +5 -1
  43. package/commands/MigrationGenerateCommand.js +5 -0
  44. package/commands/MigrationGenerateCommand.js.map +1 -1
  45. package/commands/SubscriberCreateCommand.d.ts +3 -0
  46. package/commands/SubscriberCreateCommand.js +7 -0
  47. package/commands/SubscriberCreateCommand.js.map +1 -1
  48. package/driver/DriverUtils.js +2 -5
  49. package/driver/DriverUtils.js.map +1 -1
  50. package/driver/sqlserver/SqlServerConnectionCredentialsOptions.d.ts +2 -1
  51. package/driver/sqlserver/SqlServerConnectionCredentialsOptions.js.map +1 -1
  52. package/driver/sqlserver/SqlServerConnectionOptions.d.ts +5 -0
  53. package/driver/sqlserver/SqlServerConnectionOptions.js.map +1 -1
  54. package/driver/sqlserver/SqlServerQueryRunner.js +13 -0
  55. package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  56. package/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.d.ts +12 -0
  57. package/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.js +4 -0
  58. package/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.js.map +1 -0
  59. package/error/QueryFailedError.d.ts +3 -3
  60. package/error/QueryFailedError.js.map +1 -1
  61. package/find-options/FindOptionsUtils.js +1 -1
  62. package/find-options/FindOptionsUtils.js.map +1 -1
  63. package/index.d.ts +1 -0
  64. package/index.js +1 -0
  65. package/index.js.map +1 -1
  66. package/index.mjs +2 -0
  67. package/naming-strategy/DefaultNamingStrategy.d.ts +0 -1
  68. package/naming-strategy/DefaultNamingStrategy.js +0 -3
  69. package/naming-strategy/DefaultNamingStrategy.js.map +1 -1
  70. package/naming-strategy/NamingStrategyInterface.d.ts +0 -4
  71. package/naming-strategy/NamingStrategyInterface.js.map +1 -1
  72. package/package.json +1 -1
  73. package/persistence/Subject.js +2 -1
  74. package/persistence/Subject.js.map +1 -1
  75. package/query-builder/QueryBuilder.js +1 -1
  76. package/query-builder/QueryBuilder.js.map +1 -1
  77. package/repository/Repository.d.ts +1 -1
  78. package/repository/Repository.js +9 -5
  79. package/repository/Repository.js.map +1 -1
@@ -0,0 +1,12 @@
1
+ export interface AzureActiveDirectoryDefaultAuthentication {
2
+ /**
3
+ * This uses DefaultAzureCredential from @azure/identity to try multiple methods of authentication
4
+ */
5
+ type: "azure-active-directory-default";
6
+ options: {
7
+ /**
8
+ * The clientId of the user you want to log in with, mapped to the managedIdentityClientId in tedious
9
+ */
10
+ clientId?: string;
11
+ };
12
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+
4
+ //# sourceMappingURL=AzureActiveDirectoryDefaultAuthentication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/driver/sqlserver/authentication/AzureActiveDirectoryDefaultAuthentication.ts"],"names":[],"mappings":"","file":"AzureActiveDirectoryDefaultAuthentication.js","sourcesContent":["export interface AzureActiveDirectoryDefaultAuthentication {\n /**\n * This uses DefaultAzureCredential from @azure/identity to try multiple methods of authentication\n */\n type: \"azure-active-directory-default\"\n options: {\n /**\n * The clientId of the user you want to log in with, mapped to the managedIdentityClientId in tedious\n */\n clientId?: string\n }\n}\n"],"sourceRoot":"../../.."}
@@ -2,9 +2,9 @@ import { TypeORMError } from "./TypeORMError";
2
2
  /**
3
3
  * Thrown when query execution has failed.
4
4
  */
5
- export declare class QueryFailedError extends TypeORMError {
5
+ export declare class QueryFailedError<T extends Error = Error> extends TypeORMError {
6
6
  readonly query: string;
7
7
  readonly parameters: any[] | undefined;
8
- readonly driverError: any;
9
- constructor(query: string, parameters: any[] | undefined, driverError: any);
8
+ readonly driverError: T;
9
+ constructor(query: string, parameters: any[] | undefined, driverError: T);
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/error/QueryFailedError.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AACjD,iDAA6C;AAE7C;;GAEG;AACH,MAAa,gBAAiB,SAAQ,2BAAY;IAC9C,YACa,KAAa,EACb,UAA6B,EAC7B,WAAgB;QAEzB,KAAK,CACD,WAAW;aACN,QAAQ,EAAE;aACV,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;aACvB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;aACvB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAC/B,CAAA;QAVQ,UAAK,GAAL,KAAK,CAAQ;QACb,eAAU,GAAV,UAAU,CAAmB;QAC7B,gBAAW,GAAX,WAAW,CAAK;QAUzB,IAAI,WAAW,EAAE;YACb,MAAM,EACF,IAAI,EAAE,CAAC,EAAE,sBAAsB;YAC/B,GAAG,eAAe,EACrB,GAAG,WAAW,CAAA;YAEf,yBAAW,CAAC,MAAM,CAAC,IAAI,EAAE;gBACrB,GAAG,eAAe;aACrB,CAAC,CAAA;SACL;IACL,CAAC;CACJ;AAzBD,4CAyBC","file":"QueryFailedError.js","sourcesContent":["import { ObjectUtils } from \"../util/ObjectUtils\"\nimport { TypeORMError } from \"./TypeORMError\"\n\n/**\n * Thrown when query execution has failed.\n */\nexport class QueryFailedError extends TypeORMError {\n constructor(\n readonly query: string,\n readonly parameters: any[] | undefined,\n readonly driverError: any,\n ) {\n super(\n driverError\n .toString()\n .replace(/^error: /, \"\")\n .replace(/^Error: /, \"\")\n .replace(/^Request/, \"\"),\n )\n\n if (driverError) {\n const {\n name: _, // eslint-disable-line\n ...otherProperties\n } = driverError\n\n ObjectUtils.assign(this, {\n ...otherProperties,\n })\n }\n }\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/error/QueryFailedError.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AACjD,iDAA6C;AAE7C;;GAEG;AACH,MAAa,gBAA0C,SAAQ,2BAAY;IACvE,YACa,KAAa,EACb,UAA6B,EAC7B,WAAc;QAEvB,KAAK,CACD,WAAW;aACN,QAAQ,EAAE;aACV,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;aACvB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;aACvB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAC/B,CAAA;QAVQ,UAAK,GAAL,KAAK,CAAQ;QACb,eAAU,GAAV,UAAU,CAAmB;QAC7B,gBAAW,GAAX,WAAW,CAAG;QAUvB,IAAI,WAAW,EAAE;YACb,MAAM,EACF,IAAI,EAAE,CAAC,EAAE,sBAAsB;YAC/B,GAAG,eAAe,EACrB,GAAG,WAAW,CAAA;YAEf,yBAAW,CAAC,MAAM,CAAC,IAAI,EAAE;gBACrB,GAAG,eAAe;aACrB,CAAC,CAAA;SACL;IACL,CAAC;CACJ;AAzBD,4CAyBC","file":"QueryFailedError.js","sourcesContent":["import { ObjectUtils } from \"../util/ObjectUtils\"\nimport { TypeORMError } from \"./TypeORMError\"\n\n/**\n * Thrown when query execution has failed.\n */\nexport class QueryFailedError<T extends Error = Error> extends TypeORMError {\n constructor(\n readonly query: string,\n readonly parameters: any[] | undefined,\n readonly driverError: T,\n ) {\n super(\n driverError\n .toString()\n .replace(/^error: /, \"\")\n .replace(/^Error: /, \"\")\n .replace(/^Request/, \"\"),\n )\n\n if (driverError) {\n const {\n name: _, // eslint-disable-line\n ...otherProperties\n } = driverError\n\n ObjectUtils.assign(this, {\n ...otherProperties,\n })\n }\n }\n}\n"],"sourceRoot":".."}
@@ -303,7 +303,7 @@ class FindOptionsUtils {
303
303
  static joinEagerRelations(qb, alias, metadata) {
304
304
  metadata.eagerRelations.forEach((relation) => {
305
305
  // generate a relation alias
306
- let relationAlias = DriverUtils_1.DriverUtils.buildAlias(qb.connection.driver, { joiner: "__" }, alias, relation.propertyPath);
306
+ let relationAlias = DriverUtils_1.DriverUtils.buildAlias(qb.connection.driver, { joiner: "__" }, alias, relation.propertyName);
307
307
  // add a join for the relation
308
308
  // Checking whether the relation wasn't joined yet.
309
309
  let addJoin = true;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/find-options/FindOptionsUtils.ts"],"names":[],"mappings":";;;AAGA,oCAAqD;AAErD,uDAAmD;AAInD,oCAAsD;AAEtD;;GAEG;AACH,MAAa,gBAAgB;IACzB,4EAA4E;IAC5E,wBAAwB;IACxB,4EAA4E;IAE5E;;OAEG;IACH,MAAM,CAAC,gBAAgB,CACnB,GAAQ;QAER,MAAM,eAAe,GAA2B,GAAG,CAAA;QACnD,OAAO,CACH,eAAe;YACf,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC;gBAClC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC;gBACxC,OAAO,eAAe,CAAC,MAAM,KAAK,QAAQ;gBAC1C,OAAO,eAAe,CAAC,SAAS,KAAK,QAAQ;gBAC7C,OAAO,eAAe,CAAC,KAAK,KAAK,QAAQ;gBACzC,+CAA+C;gBAC/C,OAAO,eAAe,CAAC,IAAI,KAAK,QAAQ;gBACxC,OAAO,eAAe,CAAC,KAAK,KAAK,QAAQ;gBACzC,OAAO,eAAe,CAAC,KAAK,KAAK,QAAQ;gBACzC,OAAO,eAAe,CAAC,KAAK,KAAK,SAAS;gBAC1C,OAAO,eAAe,CAAC,KAAK,KAAK,QAAQ;gBACzC,OAAO,eAAe,CAAC,OAAO,KAAK,QAAQ;gBAC3C,OAAO,eAAe,CAAC,IAAI,KAAK,QAAQ;gBACxC,OAAO,eAAe,CAAC,eAAe,KAAK,QAAQ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ionsUtils.js","sourcesContent":["import { FindManyOptions } from \"./FindManyOptions\"\nimport { FindOneOptions } from \"./FindOneOptions\"\nimport { SelectQueryBuilder } from \"../query-builder/SelectQueryBuilder\"\nimport { FindRelationsNotFoundError } from \"../error\"\nimport { EntityMetadata } from \"../metadata/EntityMetadata\"\nimport { DriverUtils } from \"../driver/DriverUtils\"\nimport { FindTreeOptions } from \"./FindTreeOptions\"\nimport { ObjectLiteral } from \"../common/ObjectLiteral\"\nimport { RelationMetadata } from \"../metadata/RelationMetadata\"\nimport { EntityPropertyNotFoundError } from \"../error\"\n\n/**\n * Utilities to work with FindOptions.\n */\nexport class FindOptionsUtils {\n // -------------------------------------------------------------------------\n // Public Static Methods\n // -------------------------------------------------------------------------\n\n /**\n * Checks if given object is really instance of FindOneOptions interface.\n */\n static isFindOneOptions<Entity = any>(\n obj: any,\n ): obj is FindOneOptions<Entity> {\n const possibleOptions: FindOneOptions<Entity> = obj\n return (\n possibleOptions &&\n (Array.isArray(possibleOptions.select) ||\n Array.isArray(possibleOptions.relations) ||\n typeof possibleOptions.select === \"object\" ||\n typeof possibleOptions.relations === \"object\" ||\n typeof possibleOptions.where === \"object\" ||\n // typeof possibleOptions.where === \"string\" ||\n typeof possibleOptions.join === \"object\" ||\n typeof possibleOptions.order === \"object\" ||\n typeof possibleOptions.cache === \"object\" ||\n typeof possibleOptions.cache === \"boolean\" ||\n typeof possibleOptions.cache === \"number\" ||\n typeof possibleOptions.comment === \"string\" ||\n typeof possibleOptions.lock === \"object\" ||\n typeof possibleOptions.loadRelationIds === \"object\" ||\n typeof possibleOptions.loadRelationIds === \"boolean\" ||\n typeof possibleOptions.loadEagerRelations === \"boolean\" ||\n typeof possibleOptions.withDeleted === \"boolean\" ||\n typeof possibleOptions.relationLoadStrategy === \"string\" ||\n typeof possibleOptions.transaction === \"boolean\")\n )\n }\n\n /**\n * Checks if given object is really instance of FindManyOptions interface.\n */\n static isFindManyOptions<Entity = any>(\n obj: any,\n ): obj is FindManyOptions<Entity> {\n const possibleOptions: FindManyOptions<Entity> = obj\n return (\n possibleOptions &&\n (this.isFindOneOptions(possibleOptions) ||\n typeof (possibleOptions as FindManyOptions<any>).skip ===\n \"number\" ||\n typeof (possibleOptions as FindManyOptions<any>).take ===\n \"number\" ||\n typeof (possibleOptions as FindManyOptions<any>).skip ===\n \"string\" ||\n typeof (possibleOptions as FindManyOptions<any>).take ===\n \"string\")\n )\n }\n\n /**\n * Checks if given object is really instance of FindOptions interface.\n */\n static extractFindManyOptionsAlias(object: any): string | undefined {\n if (this.isFindManyOptions(object) && object.join)\n return object.join.alias\n\n return undefined\n }\n\n /**\n * Applies give find many options to the given query builder.\n\n static applyFindManyOptionsOrConditionsToQueryBuilder<T>(qb: SelectQueryBuilder<T>, options: FindManyOptions<T>|Partial<T>|undefined): SelectQueryBuilder<T> {\n if (this.isFindManyOptions(options))\n return this.applyOptionsToQueryBuilder(qb, options);\n\n if (options)\n return qb.where(options);\n\n return qb;\n }*/\n\n /**\n * Applies give find options to the given query builder.\n\n static applyOptionsToQueryBuilder<T>(qb: SelectQueryBuilder<T>, options: FindOneOptions<T>|FindManyOptions<T>|undefined): SelectQueryBuilder<T> {\n\n // if options are not set then simply return query builder. This is made for simplicity of usage.\n if (!options || (!this.isFindOneOptions(options) && !this.isFindManyOptions(options)))\n return qb;\n\n if (options.transaction === true) {\n qb.expressionMap.useTransaction = true;\n }\n\n if (!qb.expressionMap.mainAlias || !qb.expressionMap.mainAlias.hasMetadata)\n return qb;\n\n const metadata = qb.expressionMap.mainAlias!.metadata;\n\n // apply all options from FindOptions\n if (options.comment) {\n qb.comment(options.comment);\n }\n\n if (options.withDeleted) {\n qb.withDeleted();\n }\n\n if (options.select) {\n qb.select([]);\n options.select.forEach(select => {\n if (!metadata.hasColumnWithPropertyPath(`${select}`))\n throw new TypeORMError(`${select} column was not found in the ${metadata.name} entity.`);\n\n const columns = metadata.findColumnsWithPropertyPath(`${select}`);\n\n for (const column of columns) {\n qb.addSelect(qb.alias + \".\" + column.propertyPath);\n }\n });\n }\n\n if (options.relations) {\n // Copy because `applyRelationsRecursively` modifies it\n const allRelations = [...options.relations];\n this.applyRelationsRecursively(qb, allRelations, qb.expressionMap.mainAlias!.name, qb.expressionMap.mainAlias!.metadata, \"\");\n // recursive removes found relations from allRelations array\n // if there are relations left in this array it means those relations were not found in the entity structure\n // so, we give an exception about not found relations\n if (allRelations.length > 0)\n throw new FindRelationsNotFoundError(allRelations);\n }\n\n if (options.join) {\n if (options.join.leftJoin)\n Object.keys(options.join.leftJoin).forEach(key => {\n qb.leftJoin(options.join!.leftJoin![key], key);\n });\n\n if (options.join.innerJoin)\n Object.keys(options.join.innerJoin).forEach(key => {\n qb.innerJoin(options.join!.innerJoin![key], key);\n });\n\n if (options.join.leftJoinAndSelect)\n Object.keys(options.join.leftJoinAndSelect).forEach(key => {\n qb.leftJoinAndSelect(options.join!.leftJoinAndSelect![key], key);\n });\n\n if (options.join.innerJoinAndSelect)\n Object.keys(options.join.innerJoinAndSelect).forEach(key => {\n qb.innerJoinAndSelect(options.join!.innerJoinAndSelect![key], key);\n });\n }\n\n if (options.cache) {\n if (options.cache instanceof Object) {\n const cache = options.cache as { id: any, milliseconds: number };\n qb.cache(cache.id, cache.milliseconds);\n } else {\n qb.cache(options.cache);\n }\n }\n\n if (options.lock) {\n if (options.lock.mode === \"optimistic\") {\n qb.setLock(options.lock.mode, options.lock.version);\n } else if (\n options.lock.mode === \"pessimistic_read\" ||\n options.lock.mode === \"pessimistic_write\" ||\n options.lock.mode === \"dirty_read\" ||\n options.lock.mode === \"pessimistic_partial_write\" ||\n options.lock.mode === \"pessimistic_write_or_fail\" ||\n options.lock.mode === \"for_no_key_update\" ||\n options.lock.mode === \"for_key_share\"\n ) {\n const tableNames = options.lock.tables ? options.lock.tables.map((table) => {\n const tableAlias = qb.expressionMap.aliases.find((alias) => {\n return alias.metadata.tableNameWithoutPrefix === table;\n });\n if (!tableAlias) {\n throw new TypeORMError(`\"${table}\" is not part of this query`);\n }\n return qb.escape(tableAlias.name);\n }) : undefined;\n qb.setLock(options.lock.mode, undefined, tableNames);\n }\n }\n\n if (options.loadRelationIds === true) {\n qb.loadAllRelationIds();\n\n } else if (options.loadRelationIds instanceof Object) {\n qb.loadAllRelationIds(options.loadRelationIds as any);\n }\n\n if (options.where)\n qb.where(options.where);\n\n if ((options as FindManyOptions<T>).skip)\n qb.skip((options as FindManyOptions<T>).skip!);\n\n if ((options as FindManyOptions<T>).take)\n qb.take((options as FindManyOptions<T>).take!);\n\n if (options.order)\n Object.keys(options.order).forEach(key => {\n const order = ((options as FindOneOptions<T>).order as any)[key as any];\n\n if (!metadata.findColumnWithPropertyPath(key))\n throw new Error(`${key} column was not found in the ${metadata.name} entity.`);\n\n switch (order) {\n case 1:\n qb.addOrderBy(qb.alias + \".\" + key, \"ASC\");\n break;\n case -1:\n qb.addOrderBy(qb.alias + \".\" + key, \"DESC\");\n break;\n case \"ASC\":\n qb.addOrderBy(qb.alias + \".\" + key, \"ASC\");\n break;\n case \"DESC\":\n qb.addOrderBy(qb.alias + \".\" + key, \"DESC\");\n break;\n }\n });\n\n return qb;\n }*/\n\n static applyOptionsToTreeQueryBuilder<T extends ObjectLiteral>(\n qb: SelectQueryBuilder<T>,\n options?: FindTreeOptions,\n ): SelectQueryBuilder<T> {\n if (options?.relations) {\n // Copy because `applyRelationsRecursively` modifies it\n const allRelations = [...options.relations]\n\n FindOptionsUtils.applyRelationsRecursively(\n qb,\n allRelations,\n qb.expressionMap.mainAlias!.name,\n qb.expressionMap.mainAlias!.metadata,\n \"\",\n )\n\n // recursive removes found relations from allRelations array\n // if there are relations left in this array it means those relations were not found in the entity structure\n // so, we give an exception about not found relations\n if (allRelations.length > 0)\n throw new FindRelationsNotFoundError(allRelations)\n }\n\n return qb\n }\n\n // -------------------------------------------------------------------------\n // Protected Static Methods\n // -------------------------------------------------------------------------\n\n /**\n * Adds joins for all relations and sub-relations of the given relations provided in the find options.\n */\n public static applyRelationsRecursively(\n qb: SelectQueryBuilder<any>,\n allRelations: string[],\n alias: string,\n metadata: EntityMetadata,\n prefix: string,\n ): void {\n // find all relations that match given prefix\n let matchedBaseRelations: RelationMetadata[] = []\n if (prefix) {\n const regexp = new RegExp(\"^\" + prefix.replace(\".\", \"\\\\.\") + \"\\\\.\")\n matchedBaseRelations = allRelations\n .filter((relation) => relation.match(regexp))\n .map((relation) =>\n metadata.findRelationWithPropertyPath(\n relation.replace(regexp, \"\"),\n ),\n )\n .filter((entity) => entity) as RelationMetadata[]\n } else {\n matchedBaseRelations = allRelations\n .map((relation) =>\n metadata.findRelationWithPropertyPath(relation),\n )\n .filter((entity) => entity) as RelationMetadata[]\n }\n\n // go through all matched relations and add join for them\n matchedBaseRelations.forEach((relation) => {\n // generate a relation alias\n let relationAlias: string = DriverUtils.buildAlias(\n qb.connection.driver,\n { joiner: \"__\" },\n alias,\n relation.propertyPath,\n )\n\n // add a join for the found relation\n const selection = alias + \".\" + relation.propertyPath\n if (qb.expressionMap.relationLoadStrategy === \"query\") {\n qb.concatRelationMetadata(relation)\n } else {\n qb.leftJoinAndSelect(selection, relationAlias)\n }\n\n // remove added relations from the allRelations array, this is needed to find all not found relations at the end\n allRelations.splice(\n allRelations.indexOf(\n prefix\n ? prefix + \".\" + relation.propertyPath\n : relation.propertyPath,\n ),\n 1,\n )\n\n // try to find sub-relations\n let relationMetadata: EntityMetadata | undefined\n let relationName: string | undefined\n\n if (qb.expressionMap.relationLoadStrategy === \"query\") {\n relationMetadata = relation.inverseEntityMetadata\n relationName = relationAlias\n } else {\n const join = qb.expressionMap.joinAttributes.find(\n (join) => join.entityOrProperty === selection,\n )\n relationMetadata = join!.metadata!\n relationName = join!.alias.name\n }\n\n if (!relationName || !relationMetadata) {\n throw new EntityPropertyNotFoundError(\n relation.propertyPath,\n metadata,\n )\n }\n\n this.applyRelationsRecursively(\n qb,\n allRelations,\n relationName,\n relationMetadata,\n prefix\n ? prefix + \".\" + relation.propertyPath\n : relation.propertyPath,\n )\n\n // join the eager relations of the found relation\n // Only supported for \"join\" relationLoadStrategy\n if (qb.expressionMap.relationLoadStrategy === \"join\") {\n const relMetadata = metadata.relations.find(\n (metadata) =>\n metadata.propertyName === relation.propertyPath,\n )\n if (relMetadata) {\n this.joinEagerRelations(\n qb,\n relationAlias,\n relMetadata.inverseEntityMetadata,\n )\n }\n }\n })\n }\n\n public static joinEagerRelations(\n qb: SelectQueryBuilder<any>,\n alias: string,\n metadata: EntityMetadata,\n ) {\n metadata.eagerRelations.forEach((relation) => {\n // generate a relation alias\n let relationAlias: string = DriverUtils.buildAlias(\n qb.connection.driver,\n { joiner: \"__\" },\n alias,\n relation.propertyPath,\n )\n\n // add a join for the relation\n // Checking whether the relation wasn't joined yet.\n let addJoin = true\n // TODO: Review this validation\n for (const join of qb.expressionMap.joinAttributes) {\n if (\n join.condition !== undefined ||\n join.mapToProperty !== undefined ||\n join.isMappingMany !== undefined ||\n join.direction !== \"LEFT\" ||\n join.entityOrProperty !==\n `${alias}.${relation.propertyPath}`\n ) {\n continue\n }\n addJoin = false\n relationAlias = join.alias.name\n break\n }\n\n const joinAlreadyAdded = Boolean(\n qb.expressionMap.joinAttributes.find(\n (joinAttribute) =>\n joinAttribute.alias.name === relationAlias,\n ),\n )\n\n if (addJoin && !joinAlreadyAdded) {\n qb.leftJoin(alias + \".\" + relation.propertyPath, relationAlias)\n }\n\n // Checking whether the relation wasn't selected yet.\n // This check shall be after the join check to detect relationAlias.\n let addSelect = true\n for (const select of qb.expressionMap.selects) {\n if (\n select.aliasName !== undefined ||\n select.virtual !== undefined ||\n select.selection !== relationAlias\n ) {\n continue\n }\n addSelect = false\n break\n }\n\n if (addSelect) {\n qb.addSelect(relationAlias)\n }\n\n // (recursive) join the eager relations\n this.joinEagerRelations(\n qb,\n relationAlias,\n relation.inverseEntityMetadata,\n )\n })\n }\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/find-options/FindOptionsUtils.ts"],"names":[],"mappings":";;;AAGA,oCAAqD;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AAa,CAAC,cAAc,CAAC,IAAI,CAChC,CAAC,aAAa,EAAE,EAAE,CACd,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,aAAa,CACjD,CACJ,CAAA;YAED,IAAI,OAAO,IAAI,CAAC,gBAAgB,EAAE;gBAC9B,EAAE,CAAC,QAAQ,CAAC,KAAK,GAAG,GAAG,GAAG,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;aAClE;YAED,qDAAqD;YACrD,oEAAoE;YACpE,IAAI,SAAS,GAAG,IAAI,CAAA;YACpB,KAAK,MAAM,MAAM,IAAI,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE;gBAC3C,IACI,MAAM,CAAC,SAAS,KAAK,SAAS;oBAC9B,MAAM,CAAC,OAAO,KAAK,SAAS;oBAC5B,MAAM,CAAC,SAAS,KAAK,aAAa,EACpC;oBACE,SAAQ;iBACX;gBACD,SAAS,GAAG,KAAK,CAAA;gBACjB,MAAK;aACR;YAED,IAAI,SAAS,EAAE;gBACX,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;aAC9B;YAED,uCAAuC;YACvC,IAAI,CAAC,kBAAkB,CACnB,EAAE,EACF,aAAa,EACb,QAAQ,CAAC,qBAAqB,CACjC,CAAA;QACL,CAAC,CAAC,CAAA;IACN,CAAC;CACJ;AAxbD,4CAwbC","file":"FindOptionsUtils.js","sourcesContent":["import { FindManyOptions } from \"./FindManyOptions\"\nimport { FindOneOptions } from \"./FindOneOptions\"\nimport { SelectQueryBuilder } from \"../query-builder/SelectQueryBuilder\"\nimport { FindRelationsNotFoundError } from \"../error\"\nimport { EntityMetadata } from \"../metadata/EntityMetadata\"\nimport { DriverUtils } from \"../driver/DriverUtils\"\nimport { FindTreeOptions } from \"./FindTreeOptions\"\nimport { ObjectLiteral } from \"../common/ObjectLiteral\"\nimport { RelationMetadata } from \"../metadata/RelationMetadata\"\nimport { EntityPropertyNotFoundError } from \"../error\"\n\n/**\n * Utilities to work with FindOptions.\n */\nexport class FindOptionsUtils {\n // -------------------------------------------------------------------------\n // Public Static Methods\n // -------------------------------------------------------------------------\n\n /**\n * Checks if given object is really instance of FindOneOptions interface.\n */\n static isFindOneOptions<Entity = any>(\n obj: any,\n ): obj is FindOneOptions<Entity> {\n const possibleOptions: FindOneOptions<Entity> = obj\n return (\n possibleOptions &&\n (Array.isArray(possibleOptions.select) ||\n Array.isArray(possibleOptions.relations) ||\n typeof possibleOptions.select === \"object\" ||\n typeof possibleOptions.relations === \"object\" ||\n typeof possibleOptions.where === \"object\" ||\n // typeof possibleOptions.where === \"string\" ||\n typeof possibleOptions.join === \"object\" ||\n typeof possibleOptions.order === \"object\" ||\n typeof possibleOptions.cache === \"object\" ||\n typeof possibleOptions.cache === \"boolean\" ||\n typeof possibleOptions.cache === \"number\" ||\n typeof possibleOptions.comment === \"string\" ||\n typeof possibleOptions.lock === \"object\" ||\n typeof possibleOptions.loadRelationIds === \"object\" ||\n typeof possibleOptions.loadRelationIds === \"boolean\" ||\n typeof possibleOptions.loadEagerRelations === \"boolean\" ||\n typeof possibleOptions.withDeleted === \"boolean\" ||\n typeof possibleOptions.relationLoadStrategy === \"string\" ||\n typeof possibleOptions.transaction === \"boolean\")\n )\n }\n\n /**\n * Checks if given object is really instance of FindManyOptions interface.\n */\n static isFindManyOptions<Entity = any>(\n obj: any,\n ): obj is FindManyOptions<Entity> {\n const possibleOptions: FindManyOptions<Entity> = obj\n return (\n possibleOptions &&\n (this.isFindOneOptions(possibleOptions) ||\n typeof (possibleOptions as FindManyOptions<any>).skip ===\n \"number\" ||\n typeof (possibleOptions as FindManyOptions<any>).take ===\n \"number\" ||\n typeof (possibleOptions as FindManyOptions<any>).skip ===\n \"string\" ||\n typeof (possibleOptions as FindManyOptions<any>).take ===\n \"string\")\n )\n }\n\n /**\n * Checks if given object is really instance of FindOptions interface.\n */\n static extractFindManyOptionsAlias(object: any): string | undefined {\n if (this.isFindManyOptions(object) && object.join)\n return object.join.alias\n\n return undefined\n }\n\n /**\n * Applies give find many options to the given query builder.\n\n static applyFindManyOptionsOrConditionsToQueryBuilder<T>(qb: SelectQueryBuilder<T>, options: FindManyOptions<T>|Partial<T>|undefined): SelectQueryBuilder<T> {\n if (this.isFindManyOptions(options))\n return this.applyOptionsToQueryBuilder(qb, options);\n\n if (options)\n return qb.where(options);\n\n return qb;\n }*/\n\n /**\n * Applies give find options to the given query builder.\n\n static applyOptionsToQueryBuilder<T>(qb: SelectQueryBuilder<T>, options: FindOneOptions<T>|FindManyOptions<T>|undefined): SelectQueryBuilder<T> {\n\n // if options are not set then simply return query builder. This is made for simplicity of usage.\n if (!options || (!this.isFindOneOptions(options) && !this.isFindManyOptions(options)))\n return qb;\n\n if (options.transaction === true) {\n qb.expressionMap.useTransaction = true;\n }\n\n if (!qb.expressionMap.mainAlias || !qb.expressionMap.mainAlias.hasMetadata)\n return qb;\n\n const metadata = qb.expressionMap.mainAlias!.metadata;\n\n // apply all options from FindOptions\n if (options.comment) {\n qb.comment(options.comment);\n }\n\n if (options.withDeleted) {\n qb.withDeleted();\n }\n\n if (options.select) {\n qb.select([]);\n options.select.forEach(select => {\n if (!metadata.hasColumnWithPropertyPath(`${select}`))\n throw new TypeORMError(`${select} column was not found in the ${metadata.name} entity.`);\n\n const columns = metadata.findColumnsWithPropertyPath(`${select}`);\n\n for (const column of columns) {\n qb.addSelect(qb.alias + \".\" + column.propertyPath);\n }\n });\n }\n\n if (options.relations) {\n // Copy because `applyRelationsRecursively` modifies it\n const allRelations = [...options.relations];\n this.applyRelationsRecursively(qb, allRelations, qb.expressionMap.mainAlias!.name, qb.expressionMap.mainAlias!.metadata, \"\");\n // recursive removes found relations from allRelations array\n // if there are relations left in this array it means those relations were not found in the entity structure\n // so, we give an exception about not found relations\n if (allRelations.length > 0)\n throw new FindRelationsNotFoundError(allRelations);\n }\n\n if (options.join) {\n if (options.join.leftJoin)\n Object.keys(options.join.leftJoin).forEach(key => {\n qb.leftJoin(options.join!.leftJoin![key], key);\n });\n\n if (options.join.innerJoin)\n Object.keys(options.join.innerJoin).forEach(key => {\n qb.innerJoin(options.join!.innerJoin![key], key);\n });\n\n if (options.join.leftJoinAndSelect)\n Object.keys(options.join.leftJoinAndSelect).forEach(key => {\n qb.leftJoinAndSelect(options.join!.leftJoinAndSelect![key], key);\n });\n\n if (options.join.innerJoinAndSelect)\n Object.keys(options.join.innerJoinAndSelect).forEach(key => {\n qb.innerJoinAndSelect(options.join!.innerJoinAndSelect![key], key);\n });\n }\n\n if (options.cache) {\n if (options.cache instanceof Object) {\n const cache = options.cache as { id: any, milliseconds: number };\n qb.cache(cache.id, cache.milliseconds);\n } else {\n qb.cache(options.cache);\n }\n }\n\n if (options.lock) {\n if (options.lock.mode === \"optimistic\") {\n qb.setLock(options.lock.mode, options.lock.version);\n } else if (\n options.lock.mode === \"pessimistic_read\" ||\n options.lock.mode === \"pessimistic_write\" ||\n options.lock.mode === \"dirty_read\" ||\n options.lock.mode === \"pessimistic_partial_write\" ||\n options.lock.mode === \"pessimistic_write_or_fail\" ||\n options.lock.mode === \"for_no_key_update\" ||\n options.lock.mode === \"for_key_share\"\n ) {\n const tableNames = options.lock.tables ? options.lock.tables.map((table) => {\n const tableAlias = qb.expressionMap.aliases.find((alias) => {\n return alias.metadata.tableNameWithoutPrefix === table;\n });\n if (!tableAlias) {\n throw new TypeORMError(`\"${table}\" is not part of this query`);\n }\n return qb.escape(tableAlias.name);\n }) : undefined;\n qb.setLock(options.lock.mode, undefined, tableNames);\n }\n }\n\n if (options.loadRelationIds === true) {\n qb.loadAllRelationIds();\n\n } else if (options.loadRelationIds instanceof Object) {\n qb.loadAllRelationIds(options.loadRelationIds as any);\n }\n\n if (options.where)\n qb.where(options.where);\n\n if ((options as FindManyOptions<T>).skip)\n qb.skip((options as FindManyOptions<T>).skip!);\n\n if ((options as FindManyOptions<T>).take)\n qb.take((options as FindManyOptions<T>).take!);\n\n if (options.order)\n Object.keys(options.order).forEach(key => {\n const order = ((options as FindOneOptions<T>).order as any)[key as any];\n\n if (!metadata.findColumnWithPropertyPath(key))\n throw new Error(`${key} column was not found in the ${metadata.name} entity.`);\n\n switch (order) {\n case 1:\n qb.addOrderBy(qb.alias + \".\" + key, \"ASC\");\n break;\n case -1:\n qb.addOrderBy(qb.alias + \".\" + key, \"DESC\");\n break;\n case \"ASC\":\n qb.addOrderBy(qb.alias + \".\" + key, \"ASC\");\n break;\n case \"DESC\":\n qb.addOrderBy(qb.alias + \".\" + key, \"DESC\");\n break;\n }\n });\n\n return qb;\n }*/\n\n static applyOptionsToTreeQueryBuilder<T extends ObjectLiteral>(\n qb: SelectQueryBuilder<T>,\n options?: FindTreeOptions,\n ): SelectQueryBuilder<T> {\n if (options?.relations) {\n // Copy because `applyRelationsRecursively` modifies it\n const allRelations = [...options.relations]\n\n FindOptionsUtils.applyRelationsRecursively(\n qb,\n allRelations,\n qb.expressionMap.mainAlias!.name,\n qb.expressionMap.mainAlias!.metadata,\n \"\",\n )\n\n // recursive removes found relations from allRelations array\n // if there are relations left in this array it means those relations were not found in the entity structure\n // so, we give an exception about not found relations\n if (allRelations.length > 0)\n throw new FindRelationsNotFoundError(allRelations)\n }\n\n return qb\n }\n\n // -------------------------------------------------------------------------\n // Protected Static Methods\n // -------------------------------------------------------------------------\n\n /**\n * Adds joins for all relations and sub-relations of the given relations provided in the find options.\n */\n public static applyRelationsRecursively(\n qb: SelectQueryBuilder<any>,\n allRelations: string[],\n alias: string,\n metadata: EntityMetadata,\n prefix: string,\n ): void {\n // find all relations that match given prefix\n let matchedBaseRelations: RelationMetadata[] = []\n if (prefix) {\n const regexp = new RegExp(\"^\" + prefix.replace(\".\", \"\\\\.\") + \"\\\\.\")\n matchedBaseRelations = allRelations\n .filter((relation) => relation.match(regexp))\n .map((relation) =>\n metadata.findRelationWithPropertyPath(\n relation.replace(regexp, \"\"),\n ),\n )\n .filter((entity) => entity) as RelationMetadata[]\n } else {\n matchedBaseRelations = allRelations\n .map((relation) =>\n metadata.findRelationWithPropertyPath(relation),\n )\n .filter((entity) => entity) as RelationMetadata[]\n }\n\n // go through all matched relations and add join for them\n matchedBaseRelations.forEach((relation) => {\n // generate a relation alias\n let relationAlias: string = DriverUtils.buildAlias(\n qb.connection.driver,\n { joiner: \"__\" },\n alias,\n relation.propertyPath,\n )\n\n // add a join for the found relation\n const selection = alias + \".\" + relation.propertyPath\n if (qb.expressionMap.relationLoadStrategy === \"query\") {\n qb.concatRelationMetadata(relation)\n } else {\n qb.leftJoinAndSelect(selection, relationAlias)\n }\n\n // remove added relations from the allRelations array, this is needed to find all not found relations at the end\n allRelations.splice(\n allRelations.indexOf(\n prefix\n ? prefix + \".\" + relation.propertyPath\n : relation.propertyPath,\n ),\n 1,\n )\n\n // try to find sub-relations\n let relationMetadata: EntityMetadata | undefined\n let relationName: string | undefined\n\n if (qb.expressionMap.relationLoadStrategy === \"query\") {\n relationMetadata = relation.inverseEntityMetadata\n relationName = relationAlias\n } else {\n const join = qb.expressionMap.joinAttributes.find(\n (join) => join.entityOrProperty === selection,\n )\n relationMetadata = join!.metadata!\n relationName = join!.alias.name\n }\n\n if (!relationName || !relationMetadata) {\n throw new EntityPropertyNotFoundError(\n relation.propertyPath,\n metadata,\n )\n }\n\n this.applyRelationsRecursively(\n qb,\n allRelations,\n relationName,\n relationMetadata,\n prefix\n ? prefix + \".\" + relation.propertyPath\n : relation.propertyPath,\n )\n\n // join the eager relations of the found relation\n // Only supported for \"join\" relationLoadStrategy\n if (qb.expressionMap.relationLoadStrategy === \"join\") {\n const relMetadata = metadata.relations.find(\n (metadata) =>\n metadata.propertyName === relation.propertyPath,\n )\n if (relMetadata) {\n this.joinEagerRelations(\n qb,\n relationAlias,\n relMetadata.inverseEntityMetadata,\n )\n }\n }\n })\n }\n\n public static joinEagerRelations(\n qb: SelectQueryBuilder<any>,\n alias: string,\n metadata: EntityMetadata,\n ) {\n metadata.eagerRelations.forEach((relation) => {\n // generate a relation alias\n let relationAlias: string = DriverUtils.buildAlias(\n qb.connection.driver,\n { joiner: \"__\" },\n alias,\n relation.propertyName,\n )\n\n // add a join for the relation\n // Checking whether the relation wasn't joined yet.\n let addJoin = true\n // TODO: Review this validation\n for (const join of qb.expressionMap.joinAttributes) {\n if (\n join.condition !== undefined ||\n join.mapToProperty !== undefined ||\n join.isMappingMany !== undefined ||\n join.direction !== \"LEFT\" ||\n join.entityOrProperty !==\n `${alias}.${relation.propertyPath}`\n ) {\n continue\n }\n addJoin = false\n relationAlias = join.alias.name\n break\n }\n\n const joinAlreadyAdded = Boolean(\n qb.expressionMap.joinAttributes.find(\n (joinAttribute) =>\n joinAttribute.alias.name === relationAlias,\n ),\n )\n\n if (addJoin && !joinAlreadyAdded) {\n qb.leftJoin(alias + \".\" + relation.propertyPath, relationAlias)\n }\n\n // Checking whether the relation wasn't selected yet.\n // This check shall be after the join check to detect relationAlias.\n let addSelect = true\n for (const select of qb.expressionMap.selects) {\n if (\n select.aliasName !== undefined ||\n select.virtual !== undefined ||\n select.selection !== relationAlias\n ) {\n continue\n }\n addSelect = false\n break\n }\n\n if (addSelect) {\n qb.addSelect(relationAlias)\n }\n\n // (recursive) join the eager relations\n this.joinEagerRelations(\n qb,\n relationAlias,\n relation.inverseEntityMetadata,\n )\n })\n }\n}\n"],"sourceRoot":".."}
package/index.d.ts CHANGED
@@ -114,6 +114,7 @@ export * from "./schema-builder/table/TableForeignKey";
114
114
  export * from "./schema-builder/table/TableIndex";
115
115
  export * from "./schema-builder/table/TableUnique";
116
116
  export * from "./schema-builder/table/Table";
117
+ export * from "./schema-builder/view/View";
117
118
  export * from "./schema-builder/options/TableCheckOptions";
118
119
  export * from "./schema-builder/options/TableColumnOptions";
119
120
  export * from "./schema-builder/options/TableExclusionOptions";
package/index.js CHANGED
@@ -121,6 +121,7 @@ tslib_1.__exportStar(require("./schema-builder/table/TableForeignKey"), exports)
121
121
  tslib_1.__exportStar(require("./schema-builder/table/TableIndex"), exports);
122
122
  tslib_1.__exportStar(require("./schema-builder/table/TableUnique"), exports);
123
123
  tslib_1.__exportStar(require("./schema-builder/table/Table"), exports);
124
+ tslib_1.__exportStar(require("./schema-builder/view/View"), exports);
124
125
  tslib_1.__exportStar(require("./schema-builder/options/TableCheckOptions"), exports);
125
126
  tslib_1.__exportStar(require("./schema-builder/options/TableColumnOptions"), exports);
126
127
  tslib_1.__exportStar(require("./schema-builder/options/TableExclusionOptions"), exports);
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA;GACG;AACH,4BAAyB;AAEzB,4EAA4E;AAC5E,wBAAwB;AACxB,4EAA4E;AAE5E,oDAAyB;AACzB,sDAA2B;AAC3B,gEAAqC;AACrC,8DAAmC;AACnC,iEAAsC;AACtC,6DAAkC;AAClC,+DAAoC;AACpC,gEAAqC;AACrC,kDAAuB;AACvB,qEAA0C;AAC1C,+EAAoD;AACpD,+EAAoD;AACpD,qFAA0D;AAC1D,4EAAiD;AACjD,+EAAoD;AACpD,4EAAiD;AACjD,4EAAiD;AACjD,yEAA8C;AAC9C,6EAAkD;AAClD,4EAAiD;AACjD,0EAA+C;AAC/C,4EAAiD;AACjD,gFAAqD;AACrD,6EAAkD;AAClD,4EAAiD;AACjD,6EAAkD;AAClD,6EAAkD;AAClD,iFAAsD;AACtD,8EAAmD;AACnD,6EAAkD;AAClD,gFAAqD;AACrD,4EAAiD;AACjD,2EAAgD;AAChD,gFAAqD;AACrD,+EAAoD;AACpD,8EAAmD;AACnD,4EAAiD;AACjD,+EAAoD;AACpD,2EAAgD;AAChD,0EAA+C;AAC/C,2EAAgD;AAChD,0EAA+C;AAC/C,0EAA+C;AAC/C,yEAA8C;AAC9C,8EAAmD;AACnD,2EAAgD;AAChD,oEAAyC;AACzC,yEAA8C;AAC9C,8EAAmD;AACnD,6EAAkD;AAClD,2EAAgD;AAChD,sEAA2C;AAC3C,wEAA6C;AAC7C,gEAAqC;AACrC,4DAAiC;AACjC,6DAAkC;AAClC,4DAAiC;AACjC,gEAAqC;AACrC,gEAAqC;AACr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,OAAA;AACrB,yEAAuE;AAA9D,wHAAA,kBAAkB,OAAA;AAC3B,yEAAuE;AAA9D,wHAAA,kBAAkB,OAAA;AAC3B,yEAAuE;AAA9D,wHAAA,kBAAkB,OAAA;AAC3B,yEAAuE;AAA9D,wHAAA,kBAAkB,OAAA;AAC3B,6EAA2E;AAAlE,4HAAA,oBAAoB,OAAA;AAC7B,qDAAmD;AAA1C,oGAAA,QAAQ,OAAA;AACjB,2DAAyD;AAAhD,0GAAA,WAAW,OAAA;AAGpB,oEAAkE;AAAzD,4GAAA,YAAY,OAAA;AACrB,oEAAkE;AAAzD,4GAAA,YAAY,OAAA;AACrB,oEAAkE;AAAzD,4GAAA,YAAY,OAAA;AACrB,0DAAwD;AAA/C,0GAAA,WAAW,OAAA;AAEpB,0EAAwE;AAA/D,wHAAA,kBAAkB,OAAA;AAC3B,mDAAiD;AAAxC,sGAAA,SAAS,OAAA;AAClB,mEAAiE;AAAxD,sHAAA,iBAAiB,OAAA;AAE1B,iFAA+E;AAAtE,8HAAA,qBAAqB,OAAA;AAE9B,2FAAyF;AAAhF,wIAAA,0BAA0B,OAAA;AAWnC,6DAA2D;AAAlD,4GAAA,YAAY,OAAA;AAIrB,uGAAqG;AAA5F,sJAAA,iCAAiC,OAAA;AAE1C,2EAAyE;AAAhE,0HAAA,mBAAmB,OAAA;AAC5B,0DAAwD;AAA/C,kHAAA,eAAe,OAAA;AACxB,kEAAgE;AAAvD,0HAAA,mBAAmB,OAAA","file":"index.js","sourcesContent":["/*!\n */\nimport \"reflect-metadata\"\n\n// -------------------------------------------------------------------------\n// Commonly Used exports\n// -------------------------------------------------------------------------\n\nexport * from \"./globals\"\nexport * from \"./container\"\nexport * from \"./common/EntityTarget\"\nexport * from \"./common/ObjectType\"\nexport * from \"./common/ObjectLiteral\"\nexport * from \"./common/MixedList\"\nexport * from \"./common/DeepPartial\"\nexport * from \"./common/RelationType\"\nexport * from \"./error\"\nexport * from \"./decorator/columns/Column\"\nexport * from \"./decorator/columns/CreateDateColumn\"\nexport * from \"./decorator/columns/DeleteDateColumn\"\nexport * from \"./decorator/columns/PrimaryGeneratedColumn\"\nexport * from \"./decorator/columns/PrimaryColumn\"\nexport * from \"./decorator/columns/UpdateDateColumn\"\nexport * from \"./decorator/columns/VersionColumn\"\nexport * from \"./decorator/columns/VirtualColumn\"\nexport * from \"./decorator/columns/ViewColumn\"\nexport * from \"./decorator/columns/ObjectIdColumn\"\nexport * from \"./decorator/listeners/AfterInsert\"\nexport * from \"./decorator/listeners/AfterLoad\"\nexport * from \"./decorator/listeners/AfterRemove\"\nexport * from \"./decorator/listeners/AfterSoftRemove\"\nexport * from \"./decorator/listeners/AfterRecover\"\nexport * from \"./decorator/listeners/AfterUpdate\"\nexport * from \"./decorator/listeners/BeforeInsert\"\nexport * from \"./decorator/listeners/BeforeRemove\"\nexport * from \"./decorator/listeners/BeforeSoftRemove\"\nexport * from \"./decorator/listeners/BeforeRecover\"\nexport * from \"./decorator/listeners/BeforeUpdate\"\nexport * from \"./decorator/listeners/EventSubscriber\"\nexport * from \"./decorator/options/ColumnOptions\"\nexport * from \"./decorator/options/IndexOptions\"\nexport * from \"./decorator/options/JoinColumnOptions\"\nexport * from \"./decorator/options/JoinTableOptions\"\nexport * from \"./decorator/options/RelationOptions\"\nexport * from \"./decorator/options/EntityOptions\"\nexport * from \"./decorator/options/ValueTransformer\"\nexport * from \"./decorator/relations/JoinColumn\"\nexport * from \"./decorator/relations/JoinTable\"\nexport * from \"./decorator/relations/ManyToMany\"\nexport * from \"./decorator/relations/ManyToOne\"\nexport * from \"./decorator/relations/OneToMany\"\nexport * from \"./decorator/relations/OneToOne\"\nexport * from \"./decorator/relations/RelationCount\"\nexport * from \"./decorator/relations/RelationId\"\nexport * from \"./decorator/entity/Entity\"\nexport * from \"./decorator/entity/ChildEntity\"\nexport * from \"./decorator/entity/TableInheritance\"\nexport * from \"./decorator/entity-view/ViewEntity\"\nexport * from \"./decorator/tree/TreeLevelColumn\"\nexport * from \"./decorator/tree/TreeParent\"\nexport * from \"./decorator/tree/TreeChildren\"\nexport * from \"./decorator/tree/Tree\"\nexport * from \"./decorator/Index\"\nexport * from \"./decorator/Unique\"\nexport * from \"./decorator/Check\"\nexport * from \"./decorator/Exclusion\"\nexport * from \"./decorator/Generated\"\nexport * from \"./decorator/EntityRepository\"\nexport * from \"./find-options/operator/And\"\nexport * from \"./find-options/operator/Any\"\nexport * from \"./find-options/operator/ArrayContainedBy\"\nexport * from \"./find-options/operator/ArrayContains\"\nexport * from \"./find-options/operator/ArrayOverlap\"\nexport * from \"./find-options/operator/Between\"\nexport * from \"./find-options/operator/Equal\"\nexport * from \"./find-options/operator/In\"\nexport * from \"./find-options/operator/IsNull\"\nexport * from \"./find-options/operator/LessThan\"\nexport * from \"./find-options/operator/LessThanOrEqual\"\nexport * from \"./find-options/operator/ILike\"\nexport * from \"./find-options/operator/Like\"\nexport * from \"./find-options/operator/MoreThan\"\nexport * from \"./find-options/operator/MoreThanOrEqual\"\nexport * from \"./find-options/operator/Not\"\nexport * from \"./find-options/operator/Raw\"\nexport * from \"./find-options/operator/JsonContains\"\nexport * from \"./find-options/EqualOperator\"\nexport * from \"./find-options/FindManyOptions\"\nexport * from \"./find-options/FindOneOptions\"\nexport * from \"./find-options/FindOperator\"\nexport * from \"./find-options/FindOperatorType\"\nexport * from \"./find-options/FindOptionsOrder\"\nexport * from \"./find-options/FindOptionsRelations\"\nexport * from \"./find-options/FindOptionsSelect\"\nexport * from \"./find-options/FindOptionsUtils\"\nexport * from \"./find-options/FindOptionsWhere\"\nexport * from \"./find-options/FindTreeOptions\"\nexport * from \"./find-options/JoinOptions\"\nexport * from \"./find-options/OrderByCondition\"\nexport * from \"./logger/AbstractLogger\"\nexport * from \"./logger/Logger\"\nexport * from \"./logger/LoggerOptions\"\nexport * from \"./logger/AdvancedConsoleLogger\"\nexport * from \"./logger/SimpleConsoleLogger\"\nexport * from \"./logger/FileLogger\"\nexport * from \"./metadata/EntityMetadata\"\nexport * from \"./entity-manager/EntityManager\"\nexport * from \"./repository/AbstractRepository\"\nexport * from \"./repository/Repository\"\nexport * from \"./repository/BaseEntity\"\nexport * from \"./repository/TreeRepository\"\nexport * from \"./repository/MongoRepository\"\nexport * from \"./repository/RemoveOptions\"\nexport * from \"./repository/SaveOptions\"\nexport * from \"./schema-builder/table/TableCheck\"\nexport * from \"./schema-builder/table/TableColumn\"\nexport * from \"./schema-builder/table/TableExclusion\"\nexport * from \"./schema-builder/table/TableForeignKey\"\nexport * from \"./schema-builder/table/TableIndex\"\nexport * from \"./schema-builder/table/TableUnique\"\nexport * from \"./schema-builder/table/Table\"\nexport * from \"./schema-builder/options/TableCheckOptions\"\nexport * from \"./schema-builder/options/TableColumnOptions\"\nexport * from \"./schema-builder/options/TableExclusionOptions\"\nexport * from \"./schema-builder/options/TableForeignKeyOptions\"\nexport * from \"./schema-builder/options/TableIndexOptions\"\nexport * from \"./schema-builder/options/TableOptions\"\nexport * from \"./schema-builder/options/TableUniqueOptions\"\nexport * from \"./schema-builder/options/ViewOptions\"\nexport * from \"./driver/mongodb/typings\"\nexport * from \"./driver/types/DatabaseType\"\nexport * from \"./driver/types/GeoJsonTypes\"\nexport * from \"./driver/types/ReplicationMode\"\nexport * from \"./driver/sqlserver/MssqlParameter\"\n\n// export * from \"./data-source\";\n\nexport { ConnectionOptionsReader } from \"./connection/ConnectionOptionsReader\"\nexport { ConnectionOptions } from \"./connection/ConnectionOptions\"\nexport { DataSource } from \"./data-source/DataSource\"\nexport { Connection } from \"./connection/Connection\"\nexport { ConnectionManager } from \"./connection/ConnectionManager\"\nexport { DataSourceOptions } from \"./data-source/DataSourceOptions\"\nexport { Driver } from \"./driver/Driver\"\nexport { QueryBuilder } from \"./query-builder/QueryBuilder\"\nexport { SelectQueryBuilder } from \"./query-builder/SelectQueryBuilder\"\nexport { DeleteQueryBuilder } from \"./query-builder/DeleteQueryBuilder\"\nexport { InsertQueryBuilder } from \"./query-builder/InsertQueryBuilder\"\nexport { UpdateQueryBuilder } from \"./query-builder/UpdateQueryBuilder\"\nexport { RelationQueryBuilder } from \"./query-builder/RelationQueryBuilder\"\nexport { Brackets } from \"./query-builder/Brackets\"\nexport { NotBrackets } from \"./query-builder/NotBrackets\"\nexport { WhereExpressionBuilder } from \"./query-builder/WhereExpressionBuilder\"\nexport { WhereExpression } from \"./query-builder/WhereExpressionBuilder\"\nexport { InsertResult } from \"./query-builder/result/InsertResult\"\nexport { UpdateResult } from \"./query-builder/result/UpdateResult\"\nexport { DeleteResult } from \"./query-builder/result/DeleteResult\"\nexport { QueryResult } from \"./query-runner/QueryResult\"\nexport { QueryRunner } from \"./query-runner/QueryRunner\"\nexport { MongoEntityManager } from \"./entity-manager/MongoEntityManager\"\nexport { Migration } from \"./migration/Migration\"\nexport { MigrationExecutor } from \"./migration/MigrationExecutor\"\nexport { MigrationInterface } from \"./migration/MigrationInterface\"\nexport { DefaultNamingStrategy } from \"./naming-strategy/DefaultNamingStrategy\"\nexport { NamingStrategyInterface } from \"./naming-strategy/NamingStrategyInterface\"\nexport { LegacyOracleNamingStrategy } from \"./naming-strategy/LegacyOracleNamingStrategy\"\nexport { InsertEvent } from \"./subscriber/event/InsertEvent\"\nexport { LoadEvent } from \"./subscriber/event/LoadEvent\"\nexport { UpdateEvent } from \"./subscriber/event/UpdateEvent\"\nexport { RemoveEvent } from \"./subscriber/event/RemoveEvent\"\nexport { SoftRemoveEvent } from \"./subscriber/event/SoftRemoveEvent\"\nexport { RecoverEvent } from \"./subscriber/event/RecoverEvent\"\nexport { TransactionCommitEvent } from \"./subscriber/event/TransactionCommitEvent\"\nexport { TransactionRollbackEvent } from \"./subscriber/event/TransactionRollbackEvent\"\nexport { TransactionStartEvent } from \"./subscriber/event/TransactionStartEvent\"\nexport { EntitySubscriberInterface } from \"./subscriber/EntitySubscriberInterface\"\nexport { EntitySchema } from \"./entity-schema/EntitySchema\"\nexport { EntitySchemaColumnOptions } from \"./entity-schema/EntitySchemaColumnOptions\"\nexport { EntitySchemaIndexOptions } from \"./entity-schema/EntitySchemaIndexOptions\"\nexport { EntitySchemaRelationOptions } from \"./entity-schema/EntitySchemaRelationOptions\"\nexport { EntitySchemaEmbeddedColumnOptions } from \"./entity-schema/EntitySchemaEmbeddedColumnOptions\"\nexport { ColumnType } from \"./driver/types/ColumnTypes\"\nexport { EntitySchemaOptions } from \"./entity-schema/EntitySchemaOptions\"\nexport { InstanceChecker } from \"./util/InstanceChecker\"\nexport { TreeRepositoryUtils } from \"./util/TreeRepositoryUtils\"\n"],"sourceRoot":"."}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA;GACG;AACH,4BAAyB;AAEzB,4EAA4E;AAC5E,wBAAwB;AACxB,4EAA4E;AAE5E,oDAAyB;AACzB,sDAA2B;AAC3B,gEAAqC;AACrC,8DAAmC;AACnC,iEAAsC;AACtC,6DAAkC;AAClC,+DAAoC;AACpC,gEAAqC;AACrC,kDAAuB;AACvB,qEAA0C;AAC1C,+EAAoD;AACpD,+EAAoD;AACpD,qFAA0D;AAC1D,4EAAiD;AACjD,+EAAoD;AACpD,4EAAiD;AACjD,4EAAiD;AACjD,yEAA8C;AAC9C,6EAAkD;AAClD,4EAAiD;AACjD,0EAA+C;AAC/C,4EAAiD;AACjD,gFAAqD;AACrD,6EAAkD;AAClD,4EAAiD;AACjD,6EAAkD;AAClD,6EAAkD;AAClD,iFAAsD;AACtD,8EAAmD;AACnD,6EAAkD;AAClD,gFAAqD;AACrD,4EAAiD;AACjD,2EAAgD;AAChD,gFAAqD;AACrD,+EAAoD;AACpD,8EAAmD;AACnD,4EAAiD;AACjD,+EAAoD;AACpD,2EAAgD;AAChD,0EAA+C;AAC/C,2EAAgD;AAChD,0EAA+C;AAC/C,0EAA+C;AAC/C,yEAA8C;AAC9C,8EAAmD;AACnD,2EAAgD;AAChD,oEAAyC;AACzC,yEAA8C;AAC9C,8EAAmD;AACnD,6EAAkD;AAClD,2EAAgD;AAChD,sEAA2C;AAC3C,wEAA6C;AAC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AA3C,wGAAA,UAAU,OAAA;AACnB,oEAAkE;AAAzD,sHAAA,iBAAiB,OAAA;AAG1B,6DAA2D;AAAlD,4GAAA,YAAY,OAAA;AACrB,yEAAuE;AAA9D,wHAAA,kBAAkB,OAAA;AAC3B,yEAAuE;AAA9D,wHAAA,kBAAkB,OAAA;AAC3B,yEAAuE;AAA9D,wHAAA,kBAAkB,OAAA;AAC3B,yEAAuE;AAA9D,wHAAA,kBAAkB,OAAA;AAC3B,6EAA2E;AAAlE,4HAAA,oBAAoB,OAAA;AAC7B,qDAAmD;AAA1C,oGAAA,QAAQ,OAAA;AACjB,2DAAyD;AAAhD,0GAAA,WAAW,OAAA;AAGpB,oEAAkE;AAAzD,4GAAA,YAAY,OAAA;AACrB,oEAAkE;AAAzD,4GAAA,YAAY,OAAA;AACrB,oEAAkE;AAAzD,4GAAA,YAAY,OAAA;AACrB,0DAAwD;AAA/C,0GAAA,WAAW,OAAA;AAEpB,0EAAwE;AAA/D,wHAAA,kBAAkB,OAAA;AAC3B,mDAAiD;AAAxC,sGAAA,SAAS,OAAA;AAClB,mEAAiE;AAAxD,sHAAA,iBAAiB,OAAA;AAE1B,iFAA+E;AAAtE,8HAAA,qBAAqB,OAAA;AAE9B,2FAAyF;AAAhF,wIAAA,0BAA0B,OAAA;AAWnC,6DAA2D;AAAlD,4GAAA,YAAY,OAAA;AAIrB,uGAAqG;AAA5F,sJAAA,iCAAiC,OAAA;AAE1C,2EAAyE;AAAhE,0HAAA,mBAAmB,OAAA;AAC5B,0DAAwD;AAA/C,kHAAA,eAAe,OAAA;AACxB,kEAAgE;AAAvD,0HAAA,mBAAmB,OAAA","file":"index.js","sourcesContent":["/*!\n */\nimport \"reflect-metadata\"\n\n// -------------------------------------------------------------------------\n// Commonly Used exports\n// -------------------------------------------------------------------------\n\nexport * from \"./globals\"\nexport * from \"./container\"\nexport * from \"./common/EntityTarget\"\nexport * from \"./common/ObjectType\"\nexport * from \"./common/ObjectLiteral\"\nexport * from \"./common/MixedList\"\nexport * from \"./common/DeepPartial\"\nexport * from \"./common/RelationType\"\nexport * from \"./error\"\nexport * from \"./decorator/columns/Column\"\nexport * from \"./decorator/columns/CreateDateColumn\"\nexport * from \"./decorator/columns/DeleteDateColumn\"\nexport * from \"./decorator/columns/PrimaryGeneratedColumn\"\nexport * from \"./decorator/columns/PrimaryColumn\"\nexport * from \"./decorator/columns/UpdateDateColumn\"\nexport * from \"./decorator/columns/VersionColumn\"\nexport * from \"./decorator/columns/VirtualColumn\"\nexport * from \"./decorator/columns/ViewColumn\"\nexport * from \"./decorator/columns/ObjectIdColumn\"\nexport * from \"./decorator/listeners/AfterInsert\"\nexport * from \"./decorator/listeners/AfterLoad\"\nexport * from \"./decorator/listeners/AfterRemove\"\nexport * from \"./decorator/listeners/AfterSoftRemove\"\nexport * from \"./decorator/listeners/AfterRecover\"\nexport * from \"./decorator/listeners/AfterUpdate\"\nexport * from \"./decorator/listeners/BeforeInsert\"\nexport * from \"./decorator/listeners/BeforeRemove\"\nexport * from \"./decorator/listeners/BeforeSoftRemove\"\nexport * from \"./decorator/listeners/BeforeRecover\"\nexport * from \"./decorator/listeners/BeforeUpdate\"\nexport * from \"./decorator/listeners/EventSubscriber\"\nexport * from \"./decorator/options/ColumnOptions\"\nexport * from \"./decorator/options/IndexOptions\"\nexport * from \"./decorator/options/JoinColumnOptions\"\nexport * from \"./decorator/options/JoinTableOptions\"\nexport * from \"./decorator/options/RelationOptions\"\nexport * from \"./decorator/options/EntityOptions\"\nexport * from \"./decorator/options/ValueTransformer\"\nexport * from \"./decorator/relations/JoinColumn\"\nexport * from \"./decorator/relations/JoinTable\"\nexport * from \"./decorator/relations/ManyToMany\"\nexport * from \"./decorator/relations/ManyToOne\"\nexport * from \"./decorator/relations/OneToMany\"\nexport * from \"./decorator/relations/OneToOne\"\nexport * from \"./decorator/relations/RelationCount\"\nexport * from \"./decorator/relations/RelationId\"\nexport * from \"./decorator/entity/Entity\"\nexport * from \"./decorator/entity/ChildEntity\"\nexport * from \"./decorator/entity/TableInheritance\"\nexport * from \"./decorator/entity-view/ViewEntity\"\nexport * from \"./decorator/tree/TreeLevelColumn\"\nexport * from \"./decorator/tree/TreeParent\"\nexport * from \"./decorator/tree/TreeChildren\"\nexport * from \"./decorator/tree/Tree\"\nexport * from \"./decorator/Index\"\nexport * from \"./decorator/Unique\"\nexport * from \"./decorator/Check\"\nexport * from \"./decorator/Exclusion\"\nexport * from \"./decorator/Generated\"\nexport * from \"./decorator/EntityRepository\"\nexport * from \"./find-options/operator/And\"\nexport * from \"./find-options/operator/Any\"\nexport * from \"./find-options/operator/ArrayContainedBy\"\nexport * from \"./find-options/operator/ArrayContains\"\nexport * from \"./find-options/operator/ArrayOverlap\"\nexport * from \"./find-options/operator/Between\"\nexport * from \"./find-options/operator/Equal\"\nexport * from \"./find-options/operator/In\"\nexport * from \"./find-options/operator/IsNull\"\nexport * from \"./find-options/operator/LessThan\"\nexport * from \"./find-options/operator/LessThanOrEqual\"\nexport * from \"./find-options/operator/ILike\"\nexport * from \"./find-options/operator/Like\"\nexport * from \"./find-options/operator/MoreThan\"\nexport * from \"./find-options/operator/MoreThanOrEqual\"\nexport * from \"./find-options/operator/Not\"\nexport * from \"./find-options/operator/Raw\"\nexport * from \"./find-options/operator/JsonContains\"\nexport * from \"./find-options/EqualOperator\"\nexport * from \"./find-options/FindManyOptions\"\nexport * from \"./find-options/FindOneOptions\"\nexport * from \"./find-options/FindOperator\"\nexport * from \"./find-options/FindOperatorType\"\nexport * from \"./find-options/FindOptionsOrder\"\nexport * from \"./find-options/FindOptionsRelations\"\nexport * from \"./find-options/FindOptionsSelect\"\nexport * from \"./find-options/FindOptionsUtils\"\nexport * from \"./find-options/FindOptionsWhere\"\nexport * from \"./find-options/FindTreeOptions\"\nexport * from \"./find-options/JoinOptions\"\nexport * from \"./find-options/OrderByCondition\"\nexport * from \"./logger/AbstractLogger\"\nexport * from \"./logger/Logger\"\nexport * from \"./logger/LoggerOptions\"\nexport * from \"./logger/AdvancedConsoleLogger\"\nexport * from \"./logger/SimpleConsoleLogger\"\nexport * from \"./logger/FileLogger\"\nexport * from \"./metadata/EntityMetadata\"\nexport * from \"./entity-manager/EntityManager\"\nexport * from \"./repository/AbstractRepository\"\nexport * from \"./repository/Repository\"\nexport * from \"./repository/BaseEntity\"\nexport * from \"./repository/TreeRepository\"\nexport * from \"./repository/MongoRepository\"\nexport * from \"./repository/RemoveOptions\"\nexport * from \"./repository/SaveOptions\"\nexport * from \"./schema-builder/table/TableCheck\"\nexport * from \"./schema-builder/table/TableColumn\"\nexport * from \"./schema-builder/table/TableExclusion\"\nexport * from \"./schema-builder/table/TableForeignKey\"\nexport * from \"./schema-builder/table/TableIndex\"\nexport * from \"./schema-builder/table/TableUnique\"\nexport * from \"./schema-builder/table/Table\"\nexport * from \"./schema-builder/view/View\"\nexport * from \"./schema-builder/options/TableCheckOptions\"\nexport * from \"./schema-builder/options/TableColumnOptions\"\nexport * from \"./schema-builder/options/TableExclusionOptions\"\nexport * from \"./schema-builder/options/TableForeignKeyOptions\"\nexport * from \"./schema-builder/options/TableIndexOptions\"\nexport * from \"./schema-builder/options/TableOptions\"\nexport * from \"./schema-builder/options/TableUniqueOptions\"\nexport * from \"./schema-builder/options/ViewOptions\"\nexport * from \"./driver/mongodb/typings\"\nexport * from \"./driver/types/DatabaseType\"\nexport * from \"./driver/types/GeoJsonTypes\"\nexport * from \"./driver/types/ReplicationMode\"\nexport * from \"./driver/sqlserver/MssqlParameter\"\n\n// export * from \"./data-source\";\n\nexport { ConnectionOptionsReader } from \"./connection/ConnectionOptionsReader\"\nexport { ConnectionOptions } from \"./connection/ConnectionOptions\"\nexport { DataSource } from \"./data-source/DataSource\"\nexport { Connection } from \"./connection/Connection\"\nexport { ConnectionManager } from \"./connection/ConnectionManager\"\nexport { DataSourceOptions } from \"./data-source/DataSourceOptions\"\nexport { Driver } from \"./driver/Driver\"\nexport { QueryBuilder } from \"./query-builder/QueryBuilder\"\nexport { SelectQueryBuilder } from \"./query-builder/SelectQueryBuilder\"\nexport { DeleteQueryBuilder } from \"./query-builder/DeleteQueryBuilder\"\nexport { InsertQueryBuilder } from \"./query-builder/InsertQueryBuilder\"\nexport { UpdateQueryBuilder } from \"./query-builder/UpdateQueryBuilder\"\nexport { RelationQueryBuilder } from \"./query-builder/RelationQueryBuilder\"\nexport { Brackets } from \"./query-builder/Brackets\"\nexport { NotBrackets } from \"./query-builder/NotBrackets\"\nexport { WhereExpressionBuilder } from \"./query-builder/WhereExpressionBuilder\"\nexport { WhereExpression } from \"./query-builder/WhereExpressionBuilder\"\nexport { InsertResult } from \"./query-builder/result/InsertResult\"\nexport { UpdateResult } from \"./query-builder/result/UpdateResult\"\nexport { DeleteResult } from \"./query-builder/result/DeleteResult\"\nexport { QueryResult } from \"./query-runner/QueryResult\"\nexport { QueryRunner } from \"./query-runner/QueryRunner\"\nexport { MongoEntityManager } from \"./entity-manager/MongoEntityManager\"\nexport { Migration } from \"./migration/Migration\"\nexport { MigrationExecutor } from \"./migration/MigrationExecutor\"\nexport { MigrationInterface } from \"./migration/MigrationInterface\"\nexport { DefaultNamingStrategy } from \"./naming-strategy/DefaultNamingStrategy\"\nexport { NamingStrategyInterface } from \"./naming-strategy/NamingStrategyInterface\"\nexport { LegacyOracleNamingStrategy } from \"./naming-strategy/LegacyOracleNamingStrategy\"\nexport { InsertEvent } from \"./subscriber/event/InsertEvent\"\nexport { LoadEvent } from \"./subscriber/event/LoadEvent\"\nexport { UpdateEvent } from \"./subscriber/event/UpdateEvent\"\nexport { RemoveEvent } from \"./subscriber/event/RemoveEvent\"\nexport { SoftRemoveEvent } from \"./subscriber/event/SoftRemoveEvent\"\nexport { RecoverEvent } from \"./subscriber/event/RecoverEvent\"\nexport { TransactionCommitEvent } from \"./subscriber/event/TransactionCommitEvent\"\nexport { TransactionRollbackEvent } from \"./subscriber/event/TransactionRollbackEvent\"\nexport { TransactionStartEvent } from \"./subscriber/event/TransactionStartEvent\"\nexport { EntitySubscriberInterface } from \"./subscriber/EntitySubscriberInterface\"\nexport { EntitySchema } from \"./entity-schema/EntitySchema\"\nexport { EntitySchemaColumnOptions } from \"./entity-schema/EntitySchemaColumnOptions\"\nexport { EntitySchemaIndexOptions } from \"./entity-schema/EntitySchemaIndexOptions\"\nexport { EntitySchemaRelationOptions } from \"./entity-schema/EntitySchemaRelationOptions\"\nexport { EntitySchemaEmbeddedColumnOptions } from \"./entity-schema/EntitySchemaEmbeddedColumnOptions\"\nexport { ColumnType } from \"./driver/types/ColumnTypes\"\nexport { EntitySchemaOptions } from \"./entity-schema/EntitySchemaOptions\"\nexport { InstanceChecker } from \"./util/InstanceChecker\"\nexport { TreeRepositoryUtils } from \"./util/TreeRepositoryUtils\"\n"],"sourceRoot":"."}
package/index.mjs CHANGED
@@ -187,6 +187,7 @@ const {
187
187
  TableIndex,
188
188
  TableUnique,
189
189
  Table,
190
+ View,
190
191
  Binary,
191
192
  BSON,
192
193
  BSONRegExp,
@@ -394,6 +395,7 @@ export {
394
395
  TableIndex,
395
396
  TableUnique,
396
397
  Table,
398
+ View,
397
399
  Binary,
398
400
  BSON,
399
401
  BSONRegExp,
@@ -40,7 +40,6 @@ export declare class DefaultNamingStrategy implements NamingStrategyInterface {
40
40
  * Note that table name comes here already normalized by #tableName method.
41
41
  */
42
42
  prefixTableName(prefix: string, tableName: string): string;
43
- eagerJoinRelationAlias(alias: string, propertyPath: string): string;
44
43
  nestedSetColumnNames: {
45
44
  left: string;
46
45
  right: string;
@@ -139,9 +139,6 @@ class DefaultNamingStrategy {
139
139
  prefixTableName(prefix, tableName) {
140
140
  return prefix + tableName;
141
141
  }
142
- eagerJoinRelationAlias(alias, propertyPath) {
143
- return alias + "_" + propertyPath.replace(".", "_");
144
- }
145
142
  }
146
143
  exports.DefaultNamingStrategy = DefaultNamingStrategy;
147
144
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/naming-strategy/DefaultNamingStrategy.ts"],"names":[],"mappings":";;;AACA,6DAAyD;AACzD,qDAAqE;A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EAAE,EAAE,CAAC,CAAA;IAC3D,CAAC;IAED,cAAc,CAAC,YAAoB,EAAE,oBAA4B;QAC7D,OAAO,IAAA,uBAAS,EAAC,YAAY,GAAG,GAAG,GAAG,oBAAoB,CAAC,CAAA;IAC/D,CAAC;IAED,aAAa,CACT,cAAsB,EACtB,eAAuB,EACvB,iBAAyB,EACzB,kBAA0B;QAE1B,OAAO,IAAA,uBAAS,EACZ,cAAc;YACV,GAAG;YACH,iBAAiB,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;YACtC,GAAG;YACH,eAAe,CACtB,CAAA;IACL,CAAC;IAED,gCAAgC,CAC5B,UAAkB,EAClB,KAAa;QAEb,OAAO,UAAU,GAAG,GAAG,GAAG,KAAK,CAAA;IACnC,CAAC;IAED,mBAAmB,CACf,SAAiB,EACjB,YAAoB,EACpB,UAAmB;QAEnB,OAAO,IAAA,uBAAS,EACZ,SAAS,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAC7D,CAAA;IACL,CAAC;IAED,0BAA0B,CACtB,SAAiB,EACjB,YAAoB,EACpB,UAAmB;QAEnB,OAAO,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC,CAAA;IACxE,CAAC;IAED;;;;;OAKG;IACH,eAAe,CAAC,MAAc,EAAE,SAAiB;QAC7C,OAAO,MAAM,GAAG,SAAS,CAAA;IAC7B,CAAC;IAED,sBAAsB,CAAC,KAAa,EAAE,YAAoB;QACtD,OAAO,KAAK,GAAG,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACvD,CAAC;CAIJ;AAjND,sDAiNC","file":"DefaultNamingStrategy.js","sourcesContent":["import { NamingStrategyInterface } from \"./NamingStrategyInterface\"\nimport { RandomGenerator } from \"../util/RandomGenerator\"\nimport { camelCase, snakeCase, titleCase } from \"../util/StringUtils\"\nimport { Table } from \"../schema-builder/table/Table\"\n\n/**\n * Naming strategy that is used by default.\n */\nexport class DefaultNamingStrategy implements NamingStrategyInterface {\n protected getTableName(tableOrName: Table | string): string {\n if (typeof tableOrName !== \"string\") {\n tableOrName = tableOrName.name\n }\n\n return tableOrName.split(\".\").pop()!\n }\n /**\n * Normalizes table name.\n *\n * @param targetName Name of the target entity that can be used to generate a table name.\n * @param userSpecifiedName For example if user specified a table name in a decorator, e.g. @Entity(\"name\")\n */\n tableName(\n targetName: string,\n userSpecifiedName: string | undefined,\n ): string {\n return userSpecifiedName ? userSpecifiedName : snakeCase(targetName)\n }\n\n /**\n * Creates a table name for a junction table of a closure table.\n *\n * @param originalClosureTableName Name of the closure table which owns this junction table.\n */\n closureJunctionTableName(originalClosureTableName: string): string {\n return originalClosureTableName + \"_closure\"\n }\n\n columnName(\n propertyName: string,\n customName: string,\n embeddedPrefixes: string[],\n ): string {\n const name = customName || propertyName\n\n if (embeddedPrefixes.length)\n return camelCase(embeddedPrefixes.join(\"_\")) + titleCase(name)\n\n return name\n }\n\n relationName(propertyName: string): string {\n return propertyName\n }\n\n primaryKeyName(tableOrName: Table | string, columnNames: string[]): string {\n // sort incoming column names to avoid issue when [\"id\", \"name\"] and [\"name\", \"id\"] arrays\n const clonedColumnNames = [...columnNames]\n clonedColumnNames.sort()\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${clonedColumnNames.join(\"_\")}`\n return \"PK_\" + RandomGenerator.sha1(key).substr(0, 27)\n }\n\n uniqueConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n ): string {\n // sort incoming column names to avoid issue when [\"id\", \"name\"] and [\"name\", \"id\"] arrays\n const clonedColumnNames = [...columnNames]\n clonedColumnNames.sort()\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${clonedColumnNames.join(\"_\")}`\n return \"UQ_\" + RandomGenerator.sha1(key).substr(0, 27)\n }\n\n relationConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n where?: string,\n ): string {\n // sort incoming column names to avoid issue when [\"id\", \"name\"] and [\"name\", \"id\"] arrays\n const clonedColumnNames = [...columnNames]\n clonedColumnNames.sort()\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n let key = `${replacedTableName}_${clonedColumnNames.join(\"_\")}`\n if (where) key += `_${where}`\n\n return \"REL_\" + RandomGenerator.sha1(key).substr(0, 26)\n }\n\n defaultConstraintName(\n tableOrName: Table | string,\n columnName: string,\n ): string {\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${columnName}`\n return \"DF_\" + RandomGenerator.sha1(key).substr(0, 27)\n }\n\n foreignKeyName(\n tableOrName: Table | string,\n columnNames: string[],\n _referencedTablePath?: string,\n _referencedColumnNames?: string[],\n ): string {\n // sort incoming column names to avoid issue when [\"id\", \"name\"] and [\"name\", \"id\"] arrays\n const clonedColumnNames = [...columnNames]\n clonedColumnNames.sort()\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${clonedColumnNames.join(\"_\")}`\n return \"FK_\" + RandomGenerator.sha1(key).substr(0, 27)\n }\n\n indexName(\n tableOrName: Table | string,\n columnNames: string[],\n where?: string,\n ): string {\n // sort incoming column names to avoid issue when [\"id\", \"name\"] and [\"name\", \"id\"] arrays\n const clonedColumnNames = [...columnNames]\n clonedColumnNames.sort()\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n let key = `${replacedTableName}_${clonedColumnNames.join(\"_\")}`\n if (where) key += `_${where}`\n\n return \"IDX_\" + RandomGenerator.sha1(key).substr(0, 26)\n }\n\n checkConstraintName(\n tableOrName: Table | string,\n expression: string,\n isEnum?: boolean,\n ): string {\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${expression}`\n const name = \"CHK_\" + RandomGenerator.sha1(key).substr(0, 26)\n return isEnum ? `${name}_ENUM` : name\n }\n\n exclusionConstraintName(\n tableOrName: Table | string,\n expression: string,\n ): string {\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${expression}`\n return \"XCL_\" + RandomGenerator.sha1(key).substr(0, 26)\n }\n\n joinColumnName(relationName: string, referencedColumnName: string): string {\n return camelCase(relationName + \"_\" + referencedColumnName)\n }\n\n joinTableName(\n firstTableName: string,\n secondTableName: string,\n firstPropertyName: string,\n secondPropertyName: string,\n ): string {\n return snakeCase(\n firstTableName +\n \"_\" +\n firstPropertyName.replace(/\\./gi, \"_\") +\n \"_\" +\n secondTableName,\n )\n }\n\n joinTableColumnDuplicationPrefix(\n columnName: string,\n index: number,\n ): string {\n return columnName + \"_\" + index\n }\n\n joinTableColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string {\n return camelCase(\n tableName + \"_\" + (columnName ? columnName : propertyName),\n )\n }\n\n joinTableInverseColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string {\n return this.joinTableColumnName(tableName, propertyName, columnName)\n }\n\n /**\n * Adds globally set prefix to the table name.\n * This method is executed no matter if prefix was set or not.\n * Table name is either user's given table name, either name generated from entity target.\n * Note that table name comes here already normalized by #tableName method.\n */\n prefixTableName(prefix: string, tableName: string): string {\n return prefix + tableName\n }\n\n eagerJoinRelationAlias(alias: string, propertyPath: string): string {\n return alias + \"_\" + propertyPath.replace(\".\", \"_\")\n }\n\n nestedSetColumnNames = { left: \"nsleft\", right: \"nsright\" }\n materializedPathColumnName = \"mpath\"\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/naming-strategy/DefaultNamingStrategy.ts"],"names":[],"mappings":";;;AACA,6DAAyD;AACzD,qDAAqE;AAGrE;;GAEG;AACH,MAAa,qBAAqB;IAAlC;QA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,cAAc,CAAC,YAAoB,EAAE,oBAA4B;QAC7D,OAAO,IAAA,uBAAS,EAAC,YAAY,GAAG,GAAG,GAAG,oBAAoB,CAAC,CAAA;IAC/D,CAAC;IAED,aAAa,CACT,cAAsB,EACtB,eAAuB,EACvB,iBAAyB,EACzB,kBAA0B;QAE1B,OAAO,IAAA,uBAAS,EACZ,cAAc;YACV,GAAG;YACH,iBAAiB,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;YACtC,GAAG;YACH,eAAe,CACtB,CAAA;IACL,CAAC;IAED,gCAAgC,CAC5B,UAAkB,EAClB,KAAa;QAEb,OAAO,UAAU,GAAG,GAAG,GAAG,KAAK,CAAA;IACnC,CAAC;IAED,mBAAmB,CACf,SAAiB,EACjB,YAAoB,EACpB,UAAmB;QAEnB,OAAO,IAAA,uBAAS,EACZ,SAAS,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAC7D,CAAA;IACL,CAAC;IAED,0BAA0B,CACtB,SAAiB,EACjB,YAAoB,EACpB,UAAmB;QAEnB,OAAO,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC,CAAA;IACxE,CAAC;IAED;;;;;OAKG;IACH,eAAe,CAAC,MAAc,EAAE,SAAiB;QAC7C,OAAO,MAAM,GAAG,SAAS,CAAA;IAC7B,CAAC;CAIJ;AA7MD,sDA6MC","file":"DefaultNamingStrategy.js","sourcesContent":["import { NamingStrategyInterface } from \"./NamingStrategyInterface\"\nimport { RandomGenerator } from \"../util/RandomGenerator\"\nimport { camelCase, snakeCase, titleCase } from \"../util/StringUtils\"\nimport { Table } from \"../schema-builder/table/Table\"\n\n/**\n * Naming strategy that is used by default.\n */\nexport class DefaultNamingStrategy implements NamingStrategyInterface {\n protected getTableName(tableOrName: Table | string): string {\n if (typeof tableOrName !== \"string\") {\n tableOrName = tableOrName.name\n }\n\n return tableOrName.split(\".\").pop()!\n }\n /**\n * Normalizes table name.\n *\n * @param targetName Name of the target entity that can be used to generate a table name.\n * @param userSpecifiedName For example if user specified a table name in a decorator, e.g. @Entity(\"name\")\n */\n tableName(\n targetName: string,\n userSpecifiedName: string | undefined,\n ): string {\n return userSpecifiedName ? userSpecifiedName : snakeCase(targetName)\n }\n\n /**\n * Creates a table name for a junction table of a closure table.\n *\n * @param originalClosureTableName Name of the closure table which owns this junction table.\n */\n closureJunctionTableName(originalClosureTableName: string): string {\n return originalClosureTableName + \"_closure\"\n }\n\n columnName(\n propertyName: string,\n customName: string,\n embeddedPrefixes: string[],\n ): string {\n const name = customName || propertyName\n\n if (embeddedPrefixes.length)\n return camelCase(embeddedPrefixes.join(\"_\")) + titleCase(name)\n\n return name\n }\n\n relationName(propertyName: string): string {\n return propertyName\n }\n\n primaryKeyName(tableOrName: Table | string, columnNames: string[]): string {\n // sort incoming column names to avoid issue when [\"id\", \"name\"] and [\"name\", \"id\"] arrays\n const clonedColumnNames = [...columnNames]\n clonedColumnNames.sort()\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${clonedColumnNames.join(\"_\")}`\n return \"PK_\" + RandomGenerator.sha1(key).substr(0, 27)\n }\n\n uniqueConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n ): string {\n // sort incoming column names to avoid issue when [\"id\", \"name\"] and [\"name\", \"id\"] arrays\n const clonedColumnNames = [...columnNames]\n clonedColumnNames.sort()\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${clonedColumnNames.join(\"_\")}`\n return \"UQ_\" + RandomGenerator.sha1(key).substr(0, 27)\n }\n\n relationConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n where?: string,\n ): string {\n // sort incoming column names to avoid issue when [\"id\", \"name\"] and [\"name\", \"id\"] arrays\n const clonedColumnNames = [...columnNames]\n clonedColumnNames.sort()\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n let key = `${replacedTableName}_${clonedColumnNames.join(\"_\")}`\n if (where) key += `_${where}`\n\n return \"REL_\" + RandomGenerator.sha1(key).substr(0, 26)\n }\n\n defaultConstraintName(\n tableOrName: Table | string,\n columnName: string,\n ): string {\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${columnName}`\n return \"DF_\" + RandomGenerator.sha1(key).substr(0, 27)\n }\n\n foreignKeyName(\n tableOrName: Table | string,\n columnNames: string[],\n _referencedTablePath?: string,\n _referencedColumnNames?: string[],\n ): string {\n // sort incoming column names to avoid issue when [\"id\", \"name\"] and [\"name\", \"id\"] arrays\n const clonedColumnNames = [...columnNames]\n clonedColumnNames.sort()\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${clonedColumnNames.join(\"_\")}`\n return \"FK_\" + RandomGenerator.sha1(key).substr(0, 27)\n }\n\n indexName(\n tableOrName: Table | string,\n columnNames: string[],\n where?: string,\n ): string {\n // sort incoming column names to avoid issue when [\"id\", \"name\"] and [\"name\", \"id\"] arrays\n const clonedColumnNames = [...columnNames]\n clonedColumnNames.sort()\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n let key = `${replacedTableName}_${clonedColumnNames.join(\"_\")}`\n if (where) key += `_${where}`\n\n return \"IDX_\" + RandomGenerator.sha1(key).substr(0, 26)\n }\n\n checkConstraintName(\n tableOrName: Table | string,\n expression: string,\n isEnum?: boolean,\n ): string {\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${expression}`\n const name = \"CHK_\" + RandomGenerator.sha1(key).substr(0, 26)\n return isEnum ? `${name}_ENUM` : name\n }\n\n exclusionConstraintName(\n tableOrName: Table | string,\n expression: string,\n ): string {\n const tableName = this.getTableName(tableOrName)\n const replacedTableName = tableName.replace(\".\", \"_\")\n const key = `${replacedTableName}_${expression}`\n return \"XCL_\" + RandomGenerator.sha1(key).substr(0, 26)\n }\n\n joinColumnName(relationName: string, referencedColumnName: string): string {\n return camelCase(relationName + \"_\" + referencedColumnName)\n }\n\n joinTableName(\n firstTableName: string,\n secondTableName: string,\n firstPropertyName: string,\n secondPropertyName: string,\n ): string {\n return snakeCase(\n firstTableName +\n \"_\" +\n firstPropertyName.replace(/\\./gi, \"_\") +\n \"_\" +\n secondTableName,\n )\n }\n\n joinTableColumnDuplicationPrefix(\n columnName: string,\n index: number,\n ): string {\n return columnName + \"_\" + index\n }\n\n joinTableColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string {\n return camelCase(\n tableName + \"_\" + (columnName ? columnName : propertyName),\n )\n }\n\n joinTableInverseColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string {\n return this.joinTableColumnName(tableName, propertyName, columnName)\n }\n\n /**\n * Adds globally set prefix to the table name.\n * This method is executed no matter if prefix was set or not.\n * Table name is either user's given table name, either name generated from entity target.\n * Note that table name comes here already normalized by #tableName method.\n */\n prefixTableName(prefix: string, tableName: string): string {\n return prefix + tableName\n }\n\n nestedSetColumnNames = { left: \"nsleft\", right: \"nsright\" }\n materializedPathColumnName = \"mpath\"\n}\n"],"sourceRoot":".."}
@@ -99,10 +99,6 @@ export interface NamingStrategyInterface {
99
99
  * Note that table name comes here already normalized by #tableName method.
100
100
  */
101
101
  prefixTableName(prefix: string, tableName: string): string;
102
- /**
103
- * Gets the name of the alias used for relation joins.
104
- */
105
- eagerJoinRelationAlias(alias: string, propertyPath: string): string;
106
102
  /**
107
103
  * Column names for nested sets.
108
104
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/naming-strategy/NamingStrategyInterface.ts"],"names":[],"mappings":"","file":"NamingStrategyInterface.js","sourcesContent":["import { Table } from \"../schema-builder/table/Table\"\nimport { View } from \"../schema-builder/view/View\"\n\n/**\n * Naming strategy defines how auto-generated names for such things like table name, or table column gonna be\n * generated.\n */\nexport interface NamingStrategyInterface {\n /**\n * Naming strategy name.\n */\n name?: string\n\n /**\n * Normalizes table name.\n *\n * @param targetName Name of the target entity that can be used to generate a table name.\n * @param userSpecifiedName For example if user specified a table name in a decorator, e.g. @Entity(\"name\")\n */\n tableName(targetName: string, userSpecifiedName: string | undefined): string\n\n /**\n * Creates a table name for a junction table of a closure table.\n *\n * @param originalClosureTableName Name of the closure table which owns this junction table.\n */\n closureJunctionTableName(originalClosureTableName: string): string\n\n /**\n * Gets the table's column name from the given property name.\n */\n columnName(\n propertyName: string,\n customName: string | undefined,\n embeddedPrefixes: string[],\n ): string\n\n /**\n * Gets the table's relation name from the given property name.\n */\n relationName(propertyName: string): string\n\n /**\n * Gets the table's primary key name from the given table name and column names.\n */\n primaryKeyName(tableOrName: Table | string, columnNames: string[]): string\n\n /**\n * Gets the table's unique constraint name from the given table name and column names.\n */\n uniqueConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n ): string\n\n /**\n * Gets the relation constraint (UNIQUE or UNIQUE INDEX) name from the given table name, column names\n * and WHERE condition, if UNIQUE INDEX used.\n */\n relationConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n where?: string,\n ): string\n\n /**\n * Gets the table's default constraint name from the given table name and column name.\n */\n defaultConstraintName(\n tableOrName: Table | string,\n columnName: string,\n ): string\n\n /**\n * Gets the name of the foreign key.\n */\n foreignKeyName(\n tableOrName: Table | string,\n columnNames: string[],\n referencedTablePath?: string,\n referencedColumnNames?: string[],\n ): string\n\n /**\n * Gets the name of the index - simple and compose index.\n */\n indexName(\n tableOrName: Table | View | string,\n columns: string[],\n where?: string,\n ): string\n\n /**\n * Gets the name of the check constraint.\n *\n * \"isEnum\" parameter is used to indicate if this check constraint used\n * to handle \"simple-enum\" type for databases that are not supporting \"enum\"\n * type out of the box. If \"true\", constraint is ignored during CHECK constraints\n * synchronization.\n */\n checkConstraintName(\n tableOrName: Table | string,\n expression: string,\n isEnum?: boolean,\n ): string\n\n /**\n * Gets the name of the exclusion constraint.\n */\n exclusionConstraintName(\n tableOrName: Table | string,\n expression: string,\n ): string\n\n /**\n * Gets the name of the join column used in the one-to-one and many-to-one relations.\n */\n joinColumnName(relationName: string, referencedColumnName: string): string\n\n /**\n * Gets the name of the join table used in the many-to-many relations.\n */\n joinTableName(\n firstTableName: string,\n secondTableName: string,\n firstPropertyName: string,\n secondPropertyName: string,\n ): string\n\n /**\n * Columns in join tables can have duplicate names in case of self-referencing.\n * This method provide a resolution for such column names.\n */\n joinTableColumnDuplicationPrefix(columnName: string, index: number): string\n\n /**\n * Gets the name of the column used for columns in the junction tables.\n *\n * The reverse?:boolean parameter denotes if the joinTableColumnName is called for the junctionColumn (false)\n * or the inverseJunctionColumns (true)\n */\n joinTableColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string\n\n /**\n * Gets the name of the column used for columns in the junction tables from the invers side of the relationship.\n */\n joinTableInverseColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string\n\n /**\n * Adds globally set prefix to the table name.\n * This method is executed no matter if prefix was set or not.\n * Table name is either user's given table name, either name generated from entity target.\n * Note that table name comes here already normalized by #tableName method.\n */\n prefixTableName(prefix: string, tableName: string): string\n\n /**\n * Gets the name of the alias used for relation joins.\n */\n eagerJoinRelationAlias(alias: string, propertyPath: string): string\n\n /**\n * Column names for nested sets.\n */\n nestedSetColumnNames: { left: string; right: string }\n\n /**\n * Column name for materialized paths.\n */\n materializedPathColumnName: string\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../src/naming-strategy/NamingStrategyInterface.ts"],"names":[],"mappings":"","file":"NamingStrategyInterface.js","sourcesContent":["import { Table } from \"../schema-builder/table/Table\"\nimport { View } from \"../schema-builder/view/View\"\n\n/**\n * Naming strategy defines how auto-generated names for such things like table name, or table column gonna be\n * generated.\n */\nexport interface NamingStrategyInterface {\n /**\n * Naming strategy name.\n */\n name?: string\n\n /**\n * Normalizes table name.\n *\n * @param targetName Name of the target entity that can be used to generate a table name.\n * @param userSpecifiedName For example if user specified a table name in a decorator, e.g. @Entity(\"name\")\n */\n tableName(targetName: string, userSpecifiedName: string | undefined): string\n\n /**\n * Creates a table name for a junction table of a closure table.\n *\n * @param originalClosureTableName Name of the closure table which owns this junction table.\n */\n closureJunctionTableName(originalClosureTableName: string): string\n\n /**\n * Gets the table's column name from the given property name.\n */\n columnName(\n propertyName: string,\n customName: string | undefined,\n embeddedPrefixes: string[],\n ): string\n\n /**\n * Gets the table's relation name from the given property name.\n */\n relationName(propertyName: string): string\n\n /**\n * Gets the table's primary key name from the given table name and column names.\n */\n primaryKeyName(tableOrName: Table | string, columnNames: string[]): string\n\n /**\n * Gets the table's unique constraint name from the given table name and column names.\n */\n uniqueConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n ): string\n\n /**\n * Gets the relation constraint (UNIQUE or UNIQUE INDEX) name from the given table name, column names\n * and WHERE condition, if UNIQUE INDEX used.\n */\n relationConstraintName(\n tableOrName: Table | string,\n columnNames: string[],\n where?: string,\n ): string\n\n /**\n * Gets the table's default constraint name from the given table name and column name.\n */\n defaultConstraintName(\n tableOrName: Table | string,\n columnName: string,\n ): string\n\n /**\n * Gets the name of the foreign key.\n */\n foreignKeyName(\n tableOrName: Table | string,\n columnNames: string[],\n referencedTablePath?: string,\n referencedColumnNames?: string[],\n ): string\n\n /**\n * Gets the name of the index - simple and compose index.\n */\n indexName(\n tableOrName: Table | View | string,\n columns: string[],\n where?: string,\n ): string\n\n /**\n * Gets the name of the check constraint.\n *\n * \"isEnum\" parameter is used to indicate if this check constraint used\n * to handle \"simple-enum\" type for databases that are not supporting \"enum\"\n * type out of the box. If \"true\", constraint is ignored during CHECK constraints\n * synchronization.\n */\n checkConstraintName(\n tableOrName: Table | string,\n expression: string,\n isEnum?: boolean,\n ): string\n\n /**\n * Gets the name of the exclusion constraint.\n */\n exclusionConstraintName(\n tableOrName: Table | string,\n expression: string,\n ): string\n\n /**\n * Gets the name of the join column used in the one-to-one and many-to-one relations.\n */\n joinColumnName(relationName: string, referencedColumnName: string): string\n\n /**\n * Gets the name of the join table used in the many-to-many relations.\n */\n joinTableName(\n firstTableName: string,\n secondTableName: string,\n firstPropertyName: string,\n secondPropertyName: string,\n ): string\n\n /**\n * Columns in join tables can have duplicate names in case of self-referencing.\n * This method provide a resolution for such column names.\n */\n joinTableColumnDuplicationPrefix(columnName: string, index: number): string\n\n /**\n * Gets the name of the column used for columns in the junction tables.\n *\n * The reverse?:boolean parameter denotes if the joinTableColumnName is called for the junctionColumn (false)\n * or the inverseJunctionColumns (true)\n */\n joinTableColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string\n\n /**\n * Gets the name of the column used for columns in the junction tables from the invers side of the relationship.\n */\n joinTableInverseColumnName(\n tableName: string,\n propertyName: string,\n columnName?: string,\n ): string\n\n /**\n * Adds globally set prefix to the table name.\n * This method is executed no matter if prefix was set or not.\n * Table name is either user's given table name, either name generated from entity target.\n * Note that table name comes here already normalized by #tableName method.\n */\n prefixTableName(prefix: string, tableName: string): string\n\n /**\n * Column names for nested sets.\n */\n nestedSetColumnNames: { left: string; right: string }\n\n /**\n * Column name for materialized paths.\n */\n materializedPathColumnName: string\n}\n"],"sourceRoot":".."}
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "typeorm", "private": false, "version": "0.3.18-dev.a909d5b", "description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.", "license": "MIT", "readmeFilename": "README.md", "author": { "name": "Umed Khudoiberdiev", "email": "pleerock.me@gmail.com" }, "engines": { "node": ">= 12.9.0" }, "exports": { ".": { "types": "./index.d.ts", "node": { "import": "./index.mjs", "require": "./index.js", "types": "./index.d.ts" }, "browser": { "require": "./index.js", "import": "./browser/index.js", "default": "./index.js" } }, "./browser": { "types": "./index.d.ts", "default": "./browser/index.js" }, "./*.js": "./*.js", "./*": { "require": "./*.js", "import": "./*" } }, "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", "browser": { "./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsYmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/driver/aurora-data-api/AuroraDataApiDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/better-sqlite3/BetterSqlite3Driver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/cockroachdb/CockroachDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoQueryRunner.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/bson.typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mysql/MysqlDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/oracle/OracleDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/postgres/PostgresDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sap/SapDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlite/SqliteDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlserver/SqlServerDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/entity-manager/MongoEntityManager.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/logger/FileLogger.js": "./browser/platform/BrowserFileLoggerDummy.js", "./browser/platform/PlatformTools.js": "./browser/platform/BrowserPlatformTools.js", "./browser/repository/MongoRepository.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/util/DirectoryExportedClassesLoader.js": "./browser/platform/BrowserDirectoryExportedClassesLoader.js", "./index.js": "./browser/index.js", "./index.mjs": "./browser/index.js" }, "repository": { "type": "git", "url": "https://github.com/typeorm/typeorm.git" }, "bugs": { "url": "https://github.com/typeorm/typeorm/issues" }, "homepage": "https://typeorm.io", "tags": [ "orm", "typescript", "typescript-orm", "mysql", "mysql-orm", "postgresql", "postgresql-orm", "mariadb", "mariadb-orm", "spanner", "sqlite", "sqlite-orm", "sql-server", "sql-server-orm", "oracle", "oracle-orm", "cloud-spanner", "cloud-spanner-orm" ], "devDependencies": { "@types/app-root-path": "^1.2.4", "@types/chai": "^4.3.4", "@types/chai-as-promised": "^7.1.5", "@types/debug": "^4.1.7", "@types/mkdirp": "^1.0.2", "@types/mocha": "^10.0.1", "@types/node": "^18.13.0", "@types/sha.js": "^2.4.0", "@types/sinon": "^10.0.13", "@types/source-map-support": "^0.5.6", "@types/uuid": "^9.0.0", "@types/yargs": "^17.0.22", "better-sqlite3": "^8.1.0", "chai": "^4.3.7", "chai-as-promised": "^7.1.1", "class-transformer": "^0.5.1", "conventional-changelog-angular": "^5.0.13", "conventional-changelog-cli": "^2.2.2", "del": "6.1.1", "gulp": "^4.0.2", "gulp-istanbul": "^1.1.3", "gulp-mocha": "^8.0.0", "gulp-rename": "^2.0.0", "gulp-replace": "^1.1.4", "gulp-shell": "^0.8.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1", "gulpclass": "^0.2.0", "husky": "^8.0.3", "mocha": "^10.2.0", "mongodb": "^5.2.0", "mssql": "^9.1.1", "mysql": "^2.18.1", "mysql2": "^3.1.1", "pg": "^8.9.0", "pg-query-stream": "^4.3.0", "prettier": "^2.8.3", "redis": "^4.6.4", "remap-istanbul": "^0.13.0", "rimraf": "^4.1.2", "sinon": "^15.0.1", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", "sql.js": "^1.8.0", "sqlite3": "^5.1.4", "ts-node": "^10.9.1", "typeorm-aurora-data-api-driver": "^2.4.4", "typescript": "^4.9.5" }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^7.1.2 || ^8.0.0", "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^5.2.0", "mssql": "^9.1.1", "mysql2": "^2.2.5 || ^3.0.1", "oracledb": "^5.1.0", "pg": "^8.5.1", "pg-native": "^3.0.0", "pg-query-stream": "^4.0.0", "redis": "^3.1.1 || ^4.0.0", "sql.js": "^1.4.0", "sqlite3": "^5.0.3", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0" }, "peerDependenciesMeta": { "@google-cloud/spanner": { "optional": true }, "@sap/hana-client": { "optional": true }, "better-sqlite3": { "optional": true }, "hdb-pool": { "optional": true }, "ioredis": { "optional": true }, "mongodb": { "optional": true }, "mssql": { "optional": true }, "mysql2": { "optional": true }, "oracledb": { "optional": true }, "pg": { "optional": true }, "pg-native": { "optional": true }, "pg-query-stream": { "optional": true }, "redis": { "optional": true }, "sql.js": { "optional": true }, "sqlite3": { "optional": true }, "ts-node": { "optional": true }, "typeorm-aurora-data-api-driver": { "optional": true } }, "dependencies": { "@sqltools/formatter": "^1.2.5", "app-root-path": "^3.1.0", "buffer": "^6.0.3", "chalk": "^4.1.2", "cli-highlight": "^2.1.11", "date-fns": "^2.29.3", "debug": "^4.3.4", "dotenv": "^16.0.3", "glob": "^8.1.0", "mkdirp": "^2.1.3", "reflect-metadata": "^0.1.13", "sha.js": "^2.4.11", "tslib": "^2.5.0", "uuid": "^9.0.0", "yargs": "^17.6.2" }, "scripts": { "test": "rimraf ./build && tsc && mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 90000 ./build/compiled/test", "test-fast": "mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 90000 ./build/compiled/test", "compile": "rimraf ./build && tsc", "watch": "./node_modules/.bin/tsc -w", "package": "gulp package", "pack": "gulp pack", "lint": "prettier --check \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "format": "prettier --write --end-of-line auto \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2" }, "bin": { "typeorm": "./cli.js", "typeorm-ts-node-commonjs": "./cli-ts-node-commonjs.js", "typeorm-ts-node-esm": "./cli-ts-node-esm.js" }, "funding": "https://opencollective.com/typeorm", "collective": { "type": "opencollective", "url": "https://opencollective.com/typeorm", "logo": "https://opencollective.com/opencollective/logo.txt" }, "nyc": { "all": true, "cache": false, "exclude": [ "**/*.d.ts" ], "extension": [ ".ts" ], "include": [ "build/compiled/src/**", "src/**" ], "reporter": "json" } }
1
+ { "name": "typeorm", "private": false, "version": "0.3.18-dev.c6f608d", "description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.", "license": "MIT", "readmeFilename": "README.md", "author": { "name": "Umed Khudoiberdiev", "email": "pleerock.me@gmail.com" }, "engines": { "node": ">= 12.9.0" }, "exports": { ".": { "types": "./index.d.ts", "node": { "import": "./index.mjs", "require": "./index.js", "types": "./index.d.ts" }, "browser": { "require": "./index.js", "import": "./browser/index.js", "default": "./index.js" } }, "./browser": { "types": "./index.d.ts", "default": "./browser/index.js" }, "./*.js": "./*.js", "./*": { "require": "./*.js", "import": "./*" } }, "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", "browser": { "./browser/connection/ConnectionOptionsReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsXmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/connection/options-reader/ConnectionOptionsYmlReader.js": "./browser/platform/BrowserConnectionOptionsReaderDummy.js", "./browser/driver/aurora-data-api/AuroraDataApiDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/better-sqlite3/BetterSqlite3Driver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/cockroachdb/CockroachDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/MongoQueryRunner.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/bson.typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mongodb/typings.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/mysql/MysqlDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/oracle/OracleDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/postgres/PostgresDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sap/SapDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlite/SqliteDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/driver/sqlserver/SqlServerDriver.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/entity-manager/MongoEntityManager.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/logger/FileLogger.js": "./browser/platform/BrowserFileLoggerDummy.js", "./browser/platform/PlatformTools.js": "./browser/platform/BrowserPlatformTools.js", "./browser/repository/MongoRepository.js": "./browser/platform/BrowserDisabledDriversDummy.js", "./browser/util/DirectoryExportedClassesLoader.js": "./browser/platform/BrowserDirectoryExportedClassesLoader.js", "./index.js": "./browser/index.js", "./index.mjs": "./browser/index.js" }, "repository": { "type": "git", "url": "https://github.com/typeorm/typeorm.git" }, "bugs": { "url": "https://github.com/typeorm/typeorm/issues" }, "homepage": "https://typeorm.io", "tags": [ "orm", "typescript", "typescript-orm", "mysql", "mysql-orm", "postgresql", "postgresql-orm", "mariadb", "mariadb-orm", "spanner", "sqlite", "sqlite-orm", "sql-server", "sql-server-orm", "oracle", "oracle-orm", "cloud-spanner", "cloud-spanner-orm" ], "devDependencies": { "@types/app-root-path": "^1.2.4", "@types/chai": "^4.3.4", "@types/chai-as-promised": "^7.1.5", "@types/debug": "^4.1.7", "@types/mkdirp": "^1.0.2", "@types/mocha": "^10.0.1", "@types/node": "^18.13.0", "@types/sha.js": "^2.4.0", "@types/sinon": "^10.0.13", "@types/source-map-support": "^0.5.6", "@types/uuid": "^9.0.0", "@types/yargs": "^17.0.22", "better-sqlite3": "^8.1.0", "chai": "^4.3.7", "chai-as-promised": "^7.1.1", "class-transformer": "^0.5.1", "conventional-changelog-angular": "^5.0.13", "conventional-changelog-cli": "^2.2.2", "del": "6.1.1", "gulp": "^4.0.2", "gulp-istanbul": "^1.1.3", "gulp-mocha": "^8.0.0", "gulp-rename": "^2.0.0", "gulp-replace": "^1.1.4", "gulp-shell": "^0.8.0", "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^6.0.0-alpha.1", "gulpclass": "^0.2.0", "husky": "^8.0.3", "mocha": "^10.2.0", "mongodb": "^5.2.0", "mssql": "^9.1.1", "mysql": "^2.18.1", "mysql2": "^3.1.1", "pg": "^8.9.0", "pg-query-stream": "^4.3.0", "prettier": "^2.8.3", "redis": "^4.6.4", "remap-istanbul": "^0.13.0", "rimraf": "^4.1.2", "sinon": "^15.0.1", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", "sql.js": "^1.8.0", "sqlite3": "^5.1.4", "ts-node": "^10.9.1", "typeorm-aurora-data-api-driver": "^2.4.4", "typescript": "^4.9.5" }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^7.1.2 || ^8.0.0", "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^5.2.0", "mssql": "^9.1.1", "mysql2": "^2.2.5 || ^3.0.1", "oracledb": "^5.1.0", "pg": "^8.5.1", "pg-native": "^3.0.0", "pg-query-stream": "^4.0.0", "redis": "^3.1.1 || ^4.0.0", "sql.js": "^1.4.0", "sqlite3": "^5.0.3", "ts-node": "^10.7.0", "typeorm-aurora-data-api-driver": "^2.0.0" }, "peerDependenciesMeta": { "@google-cloud/spanner": { "optional": true }, "@sap/hana-client": { "optional": true }, "better-sqlite3": { "optional": true }, "hdb-pool": { "optional": true }, "ioredis": { "optional": true }, "mongodb": { "optional": true }, "mssql": { "optional": true }, "mysql2": { "optional": true }, "oracledb": { "optional": true }, "pg": { "optional": true }, "pg-native": { "optional": true }, "pg-query-stream": { "optional": true }, "redis": { "optional": true }, "sql.js": { "optional": true }, "sqlite3": { "optional": true }, "ts-node": { "optional": true }, "typeorm-aurora-data-api-driver": { "optional": true } }, "dependencies": { "@sqltools/formatter": "^1.2.5", "app-root-path": "^3.1.0", "buffer": "^6.0.3", "chalk": "^4.1.2", "cli-highlight": "^2.1.11", "date-fns": "^2.29.3", "debug": "^4.3.4", "dotenv": "^16.0.3", "glob": "^8.1.0", "mkdirp": "^2.1.3", "reflect-metadata": "^0.1.13", "sha.js": "^2.4.11", "tslib": "^2.5.0", "uuid": "^9.0.0", "yargs": "^17.6.2" }, "scripts": { "test": "rimraf ./build && tsc && mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 90000 ./build/compiled/test", "test-fast": "mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 90000 ./build/compiled/test", "compile": "rimraf ./build && tsc", "watch": "./node_modules/.bin/tsc -w", "package": "gulp package", "pack": "gulp pack", "lint": "prettier --check \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "format": "prettier --write --end-of-line auto \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2" }, "bin": { "typeorm": "./cli.js", "typeorm-ts-node-commonjs": "./cli-ts-node-commonjs.js", "typeorm-ts-node-esm": "./cli-ts-node-esm.js" }, "funding": "https://opencollective.com/typeorm", "collective": { "type": "opencollective", "url": "https://opencollective.com/typeorm", "logo": "https://opencollective.com/opencollective/logo.txt" }, "nyc": { "all": true, "cache": false, "exclude": [ "**/*.d.ts" ], "extension": [ ".ts" ], "include": [ "build/compiled/src/**", "src/**" ], "reporter": "json" } }
@@ -118,7 +118,8 @@ class Subject {
118
118
  (this.databaseEntityLoaded === false ||
119
119
  (this.databaseEntityLoaded && this.databaseEntity)) &&
120
120
  // ((this.entity && this.databaseEntity) || (!this.entity && !this.databaseEntity)) &&
121
- this.changeMaps.length > 0);
121
+ // ensure there are one or more changes for updatable columns
122
+ this.changeMaps.some((change) => !change.column || change.column.isUpdate));
122
123
  }
123
124
  /**
124
125
  * Checks if this subject must be soft-removed into the database.