typeorm 0.3.26 → 0.3.27-dev.22b26d1

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.
@@ -8,6 +8,11 @@ export interface VirtualColumnOptions {
8
8
  * Column type. Must be one of the value from the ColumnTypes class.
9
9
  */
10
10
  type?: ColumnType;
11
+ /**
12
+ * Indicates if column is always selected by QueryBuilder and find operations.
13
+ * Default value is "true".
14
+ */
15
+ select?: boolean;
11
16
  /**
12
17
  * Return type of HSTORE column.
13
18
  * Returns value as string or as object.
@@ -1 +1 @@
1
- {"version":3,"sources":["../browser/src/decorator/options/VirtualColumnOptions.ts"],"names":[],"mappings":"","file":"VirtualColumnOptions.js","sourcesContent":["import { ColumnType } from \"../../driver/types/ColumnTypes\"\nimport { ValueTransformer } from \"./ValueTransformer\"\n\n/**\n * Describes all calculated column's options.\n */\nexport interface VirtualColumnOptions {\n /**\n * Column type. Must be one of the value from the ColumnTypes class.\n */\n type?: ColumnType\n\n /**\n * Return type of HSTORE column.\n * Returns value as string or as object.\n */\n hstoreType?: \"object\" | \"string\"\n\n /**\n * Query to be used to populate the column data. This query is used when generating the relational db script.\n * The query function is called with the current entities alias either defined by the Entity Decorator or automatically\n * @See https://typeorm.io/decorator-reference#virtualcolumn for more details.\n */\n query: (alias: string) => string\n\n /**\n * Specifies a value transformer(s) that is to be used to unmarshal\n * this column when reading from the database.\n */\n transformer?: ValueTransformer | ValueTransformer[]\n}\n"],"sourceRoot":"../.."}
1
+ {"version":3,"sources":["../browser/src/decorator/options/VirtualColumnOptions.ts"],"names":[],"mappings":"","file":"VirtualColumnOptions.js","sourcesContent":["import { ColumnType } from \"../../driver/types/ColumnTypes\"\nimport { ValueTransformer } from \"./ValueTransformer\"\n\n/**\n * Describes all calculated column's options.\n */\nexport interface VirtualColumnOptions {\n /**\n * Column type. Must be one of the value from the ColumnTypes class.\n */\n type?: ColumnType\n\n /**\n * Indicates if column is always selected by QueryBuilder and find operations.\n * Default value is \"true\".\n */\n select?: boolean\n\n /**\n * Return type of HSTORE column.\n * Returns value as string or as object.\n */\n hstoreType?: \"object\" | \"string\"\n\n /**\n * Query to be used to populate the column data. This query is used when generating the relational db script.\n * The query function is called with the current entities alias either defined by the Entity Decorator or automatically\n * @See https://typeorm.io/decorator-reference#virtualcolumn for more details.\n */\n query: (alias: string) => string\n\n /**\n * Specifies a value transformer(s) that is to be used to unmarshal\n * this column when reading from the database.\n */\n transformer?: ValueTransformer | ValueTransformer[]\n}\n"],"sourceRoot":"../.."}
@@ -1667,12 +1667,9 @@ export class SelectQueryBuilder extends QueryBuilder {
1667
1667
  return finalSelects;
1668
1668
  }
1669
1669
  findEntityColumnSelects(aliasName, metadata) {
1670
- const mainSelect = this.expressionMap.selects.find((select) => select.selection === aliasName);
1671
- if (mainSelect)
1672
- return [mainSelect];
1673
- return this.expressionMap.selects.filter((select) => {
1674
- return metadata.columns.some((column) => select.selection === aliasName + "." + column.propertyPath);
1675
- });
1670
+ return this.expressionMap.selects.filter((select) => select.selection === aliasName ||
1671
+ metadata.columns.some((column) => select.selection ===
1672
+ aliasName + "." + column.propertyPath));
1676
1673
  }
1677
1674
  computeCountExpression() {
1678
1675
  const mainAlias = this.expressionMap.mainAlias.name; // todo: will this work with "fromTableName"?