@mikro-orm/sql 7.0.2 → 7.0.3-dev.0

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 (86) hide show
  1. package/AbstractSqlConnection.d.ts +58 -94
  2. package/AbstractSqlConnection.js +238 -235
  3. package/AbstractSqlDriver.d.ts +155 -411
  4. package/AbstractSqlDriver.js +1937 -2061
  5. package/AbstractSqlPlatform.d.ts +73 -83
  6. package/AbstractSqlPlatform.js +158 -162
  7. package/PivotCollectionPersister.d.ts +15 -33
  8. package/PivotCollectionPersister.js +160 -158
  9. package/SqlEntityManager.d.ts +22 -67
  10. package/SqlEntityManager.js +38 -54
  11. package/SqlEntityRepository.d.ts +14 -14
  12. package/SqlEntityRepository.js +23 -23
  13. package/dialects/mssql/MsSqlNativeQueryBuilder.d.ts +12 -12
  14. package/dialects/mssql/MsSqlNativeQueryBuilder.js +194 -192
  15. package/dialects/mysql/BaseMySqlPlatform.d.ts +45 -64
  16. package/dialects/mysql/BaseMySqlPlatform.js +131 -134
  17. package/dialects/mysql/MySqlExceptionConverter.d.ts +6 -6
  18. package/dialects/mysql/MySqlExceptionConverter.js +77 -91
  19. package/dialects/mysql/MySqlNativeQueryBuilder.d.ts +3 -3
  20. package/dialects/mysql/MySqlNativeQueryBuilder.js +69 -66
  21. package/dialects/mysql/MySqlSchemaHelper.d.ts +39 -39
  22. package/dialects/mysql/MySqlSchemaHelper.js +319 -327
  23. package/dialects/oracledb/OracleDialect.d.ts +52 -81
  24. package/dialects/oracledb/OracleDialect.js +149 -155
  25. package/dialects/oracledb/OracleNativeQueryBuilder.d.ts +12 -12
  26. package/dialects/oracledb/OracleNativeQueryBuilder.js +236 -232
  27. package/dialects/postgresql/BasePostgreSqlPlatform.d.ts +105 -108
  28. package/dialects/postgresql/BasePostgreSqlPlatform.js +350 -351
  29. package/dialects/postgresql/FullTextType.d.ts +6 -10
  30. package/dialects/postgresql/FullTextType.js +51 -51
  31. package/dialects/postgresql/PostgreSqlExceptionConverter.d.ts +5 -5
  32. package/dialects/postgresql/PostgreSqlExceptionConverter.js +43 -55
  33. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.d.ts +1 -1
  34. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.js +4 -4
  35. package/dialects/postgresql/PostgreSqlSchemaHelper.d.ts +82 -102
  36. package/dialects/postgresql/PostgreSqlSchemaHelper.js +683 -711
  37. package/dialects/sqlite/BaseSqliteConnection.d.ts +5 -3
  38. package/dialects/sqlite/BaseSqliteConnection.js +19 -21
  39. package/dialects/sqlite/NodeSqliteDialect.d.ts +1 -1
  40. package/dialects/sqlite/NodeSqliteDialect.js +23 -23
  41. package/dialects/sqlite/SqliteDriver.d.ts +1 -1
  42. package/dialects/sqlite/SqliteDriver.js +3 -3
  43. package/dialects/sqlite/SqliteExceptionConverter.d.ts +6 -6
  44. package/dialects/sqlite/SqliteExceptionConverter.js +51 -67
  45. package/dialects/sqlite/SqliteNativeQueryBuilder.d.ts +2 -2
  46. package/dialects/sqlite/SqliteNativeQueryBuilder.js +7 -7
  47. package/dialects/sqlite/SqlitePlatform.d.ts +72 -63
  48. package/dialects/sqlite/SqlitePlatform.js +139 -139
  49. package/dialects/sqlite/SqliteSchemaHelper.d.ts +60 -70
  50. package/dialects/sqlite/SqliteSchemaHelper.js +520 -533
  51. package/package.json +2 -2
  52. package/plugin/index.d.ts +35 -42
  53. package/plugin/index.js +36 -43
  54. package/plugin/transformer.d.ts +94 -117
  55. package/plugin/transformer.js +881 -890
  56. package/query/ArrayCriteriaNode.d.ts +4 -4
  57. package/query/ArrayCriteriaNode.js +18 -18
  58. package/query/CriteriaNode.d.ts +25 -35
  59. package/query/CriteriaNode.js +123 -133
  60. package/query/CriteriaNodeFactory.d.ts +6 -49
  61. package/query/CriteriaNodeFactory.js +94 -97
  62. package/query/NativeQueryBuilder.d.ts +118 -118
  63. package/query/NativeQueryBuilder.js +480 -484
  64. package/query/ObjectCriteriaNode.d.ts +12 -12
  65. package/query/ObjectCriteriaNode.js +282 -298
  66. package/query/QueryBuilder.d.ts +904 -1546
  67. package/query/QueryBuilder.js +2145 -2270
  68. package/query/QueryBuilderHelper.d.ts +72 -153
  69. package/query/QueryBuilderHelper.js +1028 -1079
  70. package/query/ScalarCriteriaNode.d.ts +3 -3
  71. package/query/ScalarCriteriaNode.js +46 -53
  72. package/query/enums.d.ts +14 -14
  73. package/query/enums.js +14 -14
  74. package/query/raw.d.ts +6 -16
  75. package/query/raw.js +10 -10
  76. package/schema/DatabaseSchema.d.ts +50 -73
  77. package/schema/DatabaseSchema.js +307 -331
  78. package/schema/DatabaseTable.d.ts +73 -96
  79. package/schema/DatabaseTable.js +927 -1012
  80. package/schema/SchemaComparator.d.ts +54 -58
  81. package/schema/SchemaComparator.js +719 -745
  82. package/schema/SchemaHelper.d.ts +95 -109
  83. package/schema/SchemaHelper.js +659 -675
  84. package/schema/SqlSchemaGenerator.d.ts +58 -78
  85. package/schema/SqlSchemaGenerator.js +501 -535
  86. package/typings.d.ts +266 -380
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.0.2",
3
+ "version": "7.0.3-dev.0",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.0.2"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.0.2"
56
+ "@mikro-orm/core": "7.0.3-dev.0"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"
package/plugin/index.d.ts CHANGED
@@ -1,49 +1,42 @@
1
- import {
2
- type KyselyPlugin,
3
- type PluginTransformQueryArgs,
4
- type PluginTransformResultArgs,
5
- type QueryResult,
6
- type RootOperationNode,
7
- type UnknownRow,
8
- } from 'kysely';
1
+ import { type KyselyPlugin, type PluginTransformQueryArgs, type PluginTransformResultArgs, type QueryResult, type RootOperationNode, type UnknownRow } from 'kysely';
9
2
  import type { SqlEntityManager } from '../SqlEntityManager.js';
10
3
  /** Configuration options for the MikroKyselyPlugin. */
11
4
  export interface MikroKyselyPluginOptions {
12
- /**
13
- * Use database table names ('table') or entity names ('entity') in queries.
14
- *
15
- * @default 'table'
16
- */
17
- tableNamingStrategy?: 'table' | 'entity';
18
- /**
19
- * Use database column names ('column') or property names ('property') in queries.
20
- *
21
- * @default 'column'
22
- */
23
- columnNamingStrategy?: 'column' | 'property';
24
- /**
25
- * Automatically process entity `onCreate` hooks in INSERT queries.
26
- *
27
- * @default false
28
- */
29
- processOnCreateHooks?: boolean;
30
- /**
31
- * Automatically process entity `onUpdate` hooks in UPDATE queries.
32
- *
33
- * @default false
34
- */
35
- processOnUpdateHooks?: boolean;
36
- /**
37
- * Convert JavaScript values to database-compatible values (e.g., Date to timestamp, custom types).
38
- *
39
- * @default false
40
- */
41
- convertValues?: boolean;
5
+ /**
6
+ * Use database table names ('table') or entity names ('entity') in queries.
7
+ *
8
+ * @default 'table'
9
+ */
10
+ tableNamingStrategy?: 'table' | 'entity';
11
+ /**
12
+ * Use database column names ('column') or property names ('property') in queries.
13
+ *
14
+ * @default 'column'
15
+ */
16
+ columnNamingStrategy?: 'column' | 'property';
17
+ /**
18
+ * Automatically process entity `onCreate` hooks in INSERT queries.
19
+ *
20
+ * @default false
21
+ */
22
+ processOnCreateHooks?: boolean;
23
+ /**
24
+ * Automatically process entity `onUpdate` hooks in UPDATE queries.
25
+ *
26
+ * @default false
27
+ */
28
+ processOnUpdateHooks?: boolean;
29
+ /**
30
+ * Convert JavaScript values to database-compatible values (e.g., Date to timestamp, custom types).
31
+ *
32
+ * @default false
33
+ */
34
+ convertValues?: boolean;
42
35
  }
43
36
  /** Kysely plugin that transforms queries and results to use MikroORM entity/property naming conventions. */
44
37
  export declare class MikroKyselyPlugin implements KyselyPlugin {
45
- #private;
46
- constructor(em: SqlEntityManager, options?: MikroKyselyPluginOptions);
47
- transformQuery(args: PluginTransformQueryArgs): RootOperationNode;
48
- transformResult(args: PluginTransformResultArgs): Promise<QueryResult<UnknownRow>>;
38
+ #private;
39
+ constructor(em: SqlEntityManager, options?: MikroKyselyPluginOptions);
40
+ transformQuery(args: PluginTransformQueryArgs): RootOperationNode;
41
+ transformResult(args: PluginTransformResultArgs): Promise<QueryResult<UnknownRow>>;
49
42
  }
package/plugin/index.js CHANGED
@@ -1,50 +1,43 @@
1
- import {
2
- SelectQueryNode as SelectQueryNodeClass,
3
- InsertQueryNode as InsertQueryNodeClass,
4
- UpdateQueryNode as UpdateQueryNodeClass,
5
- DeleteQueryNode as DeleteQueryNodeClass,
6
- } from 'kysely';
1
+ import { SelectQueryNode as SelectQueryNodeClass, InsertQueryNode as InsertQueryNodeClass, UpdateQueryNode as UpdateQueryNodeClass, DeleteQueryNode as DeleteQueryNodeClass, } from 'kysely';
7
2
  import { MikroTransformer } from './transformer.js';
8
3
  /** Kysely plugin that transforms queries and results to use MikroORM entity/property naming conventions. */
9
4
  export class MikroKyselyPlugin {
10
- static #queryNodeCache = new WeakMap();
11
- #transformer;
12
- #options;
13
- constructor(em, options = {}) {
14
- this.#options = options;
15
- this.#transformer = new MikroTransformer(em, options);
16
- }
17
- transformQuery(args) {
18
- this.#transformer.reset();
19
- const result = this.#transformer.transformNode(args.node, args.queryId);
20
- // Cache the entity map if it is one we can process (for use in transformResult)
21
- if (
22
- SelectQueryNodeClass.is(args.node) ||
23
- InsertQueryNodeClass.is(args.node) ||
24
- UpdateQueryNodeClass.is(args.node) ||
25
- DeleteQueryNodeClass.is(args.node)
26
- ) {
27
- // clone the entityMap because the transformer's internal map will be cleared and reused by the next query
28
- const entityMap = new Map(this.#transformer.getOutputEntityMap());
29
- MikroKyselyPlugin.#queryNodeCache.set(args.queryId, { entityMap });
5
+ static #queryNodeCache = new WeakMap();
6
+ #transformer;
7
+ #options;
8
+ constructor(em, options = {}) {
9
+ this.#options = options;
10
+ this.#transformer = new MikroTransformer(em, options);
30
11
  }
31
- return result;
32
- }
33
- async transformResult(args) {
34
- // Only transform results if columnNamingStrategy is 'property' or convertValues is true
35
- if (this.#options.columnNamingStrategy !== 'property' && !this.#options.convertValues) {
36
- return args.result;
12
+ transformQuery(args) {
13
+ this.#transformer.reset();
14
+ const result = this.#transformer.transformNode(args.node, args.queryId);
15
+ // Cache the entity map if it is one we can process (for use in transformResult)
16
+ if (SelectQueryNodeClass.is(args.node) ||
17
+ InsertQueryNodeClass.is(args.node) ||
18
+ UpdateQueryNodeClass.is(args.node) ||
19
+ DeleteQueryNodeClass.is(args.node)) {
20
+ // clone the entityMap because the transformer's internal map will be cleared and reused by the next query
21
+ const entityMap = new Map(this.#transformer.getOutputEntityMap());
22
+ MikroKyselyPlugin.#queryNodeCache.set(args.queryId, { entityMap });
23
+ }
24
+ return result;
37
25
  }
38
- // Retrieve the cached query node and metadata
39
- const cache = MikroKyselyPlugin.#queryNodeCache.get(args.queryId);
40
- if (!cache) {
41
- return args.result;
26
+ async transformResult(args) {
27
+ // Only transform results if columnNamingStrategy is 'property' or convertValues is true
28
+ if (this.#options.columnNamingStrategy !== 'property' && !this.#options.convertValues) {
29
+ return args.result;
30
+ }
31
+ // Retrieve the cached query node and metadata
32
+ const cache = MikroKyselyPlugin.#queryNodeCache.get(args.queryId);
33
+ if (!cache) {
34
+ return args.result;
35
+ }
36
+ // Transform the result rows using the transformer
37
+ const transformedRows = this.#transformer.transformResult(args.result.rows ?? [], cache.entityMap);
38
+ return {
39
+ ...args.result,
40
+ rows: transformedRows ?? [],
41
+ };
42
42
  }
43
- // Transform the result rows using the transformer
44
- const transformedRows = this.#transformer.transformResult(args.result.rows ?? [], cache.entityMap);
45
- return {
46
- ...args.result,
47
- rows: transformedRows ?? [],
48
- };
49
- }
50
43
  }
@@ -1,122 +1,99 @@
1
1
  import { type EntityMetadata, type EntityProperty } from '@mikro-orm/core';
2
- import {
3
- type CommonTableExpressionNameNode,
4
- type DeleteQueryNode,
5
- type IdentifierNode,
6
- type InsertQueryNode,
7
- type JoinNode,
8
- type MergeQueryNode,
9
- type QueryId,
10
- type SelectQueryNode,
11
- type UpdateQueryNode,
12
- type WithNode,
13
- ColumnNode,
14
- OperationNodeTransformer,
15
- TableNode,
16
- } from 'kysely';
2
+ import { type CommonTableExpressionNameNode, type DeleteQueryNode, type IdentifierNode, type InsertQueryNode, type JoinNode, type MergeQueryNode, type QueryId, type SelectQueryNode, type UpdateQueryNode, type WithNode, ColumnNode, OperationNodeTransformer, TableNode } from 'kysely';
17
3
  import type { MikroKyselyPluginOptions } from './index.js';
18
4
  import type { SqlEntityManager } from '../SqlEntityManager.js';
19
5
  export declare class MikroTransformer extends OperationNodeTransformer {
20
- #private;
21
- constructor(em: SqlEntityManager, options?: MikroKyselyPluginOptions);
22
- reset(): void;
23
- getOutputEntityMap(): Map<string, EntityMetadata>;
24
- /** @internal */
25
- getContextStack(): Map<string, EntityMetadata | undefined>[];
26
- /** @internal */
27
- getSubqueryAliasMap(): Map<string, EntityMetadata | undefined>;
28
- transformSelectQuery(node: SelectQueryNode, queryId: QueryId): SelectQueryNode;
29
- transformInsertQuery(node: InsertQueryNode, queryId?: QueryId): InsertQueryNode;
30
- transformUpdateQuery(node: UpdateQueryNode, queryId?: QueryId): UpdateQueryNode;
31
- transformDeleteQuery(node: DeleteQueryNode, queryId?: QueryId): DeleteQueryNode;
32
- transformMergeQuery(node: MergeQueryNode, queryId?: QueryId): MergeQueryNode;
33
- transformIdentifier(node: IdentifierNode, queryId: QueryId): IdentifierNode;
34
- /**
35
- * Find owner entity metadata for the current identifier in the context stack.
36
- * Supports both aliased and non-aliased table references.
37
- * Searches up the context stack to support correlated subqueries.
38
- * Also checks subquery/CTE aliases to resolve to their source tables.
39
- */
40
- findOwnerEntityInContext(): EntityMetadata | undefined;
41
- processOnCreateHooks(node: InsertQueryNode, meta: EntityMetadata): InsertQueryNode;
42
- processOnUpdateHooks(node: UpdateQueryNode, meta: EntityMetadata): UpdateQueryNode;
43
- processInsertValues(node: InsertQueryNode, meta: EntityMetadata): InsertQueryNode;
44
- processUpdateValues(node: UpdateQueryNode, meta: EntityMetadata): UpdateQueryNode;
45
- mapColumnsToProperties(columns: readonly ColumnNode[], meta: EntityMetadata): (EntityProperty | undefined)[];
46
- normalizeColumnName(identifier: IdentifierNode): string;
47
- findProperty(meta: EntityMetadata | undefined, columnName?: string): EntityProperty | undefined;
48
- shouldConvertValues(): boolean;
49
- prepareInputValue(prop: EntityProperty | undefined, value: unknown, enabled: boolean): unknown;
50
- /**
51
- * Look up a table name/alias in the context stack.
52
- * Searches from current scope (top of stack) to parent scopes (bottom).
53
- * This supports correlated subqueries and references to outer query tables.
54
- */
55
- lookupInContextStack(tableNameOrAlias: string): EntityMetadata | undefined;
56
- /**
57
- * Process WITH node (CTE definitions)
58
- */
59
- processWithNode(withNode: WithNode, context: Map<string, EntityMetadata | undefined>): void;
60
- /**
61
- * Extract CTE name from CommonTableExpressionNameNode
62
- */
63
- getCTEName(nameNode: CommonTableExpressionNameNode): string | undefined;
64
- /**
65
- * Process a FROM item (can be TableNode or AliasNode)
66
- */
67
- processFromItem(
68
- from: any, // OperationNode type - can be TableNode, AliasNode, or SelectQueryNode
69
- context: Map<string, EntityMetadata | undefined>,
70
- ): void;
71
- /**
72
- * Process a JOIN node
73
- */
74
- processJoinNode(join: JoinNode, context: Map<string, EntityMetadata | undefined>): void;
75
- /**
76
- * Extract the primary source table from a SELECT query
77
- * This helps resolve columns from subqueries to their original entity tables
78
- */
79
- extractSourceTableFromSelectQuery(selectQuery: SelectQueryNode): EntityMetadata | undefined;
80
- /**
81
- * Extract alias name from an alias node
82
- */
83
- extractAliasName(alias: any): string | undefined;
84
- /**
85
- * Extract table name from a TableNode
86
- */
87
- getTableName(node: TableNode | undefined): string | undefined;
88
- /**
89
- * Find entity metadata by table name or entity name
90
- */
91
- findEntityMetadata(name: string): EntityMetadata | undefined;
92
- /**
93
- * Transform result rows by mapping database column names to property names
94
- * This is called for SELECT queries when columnNamingStrategy is 'property'
95
- */
96
- transformResult(
97
- rows: Record<string, any>[] | undefined,
98
- entityMap: Map<string, EntityMetadata>,
99
- ): Record<string, any>[] | undefined;
100
- buildGlobalFieldMap(entityMap: Map<string, EntityMetadata>): Record<string, EntityProperty>;
101
- buildGlobalRelationFieldMap(entityMap: Map<string, EntityMetadata>): Record<string, string>;
102
- /**
103
- * Build a mapping from database field names to property objects
104
- * Format: { 'field_name': EntityProperty }
105
- */
106
- buildFieldToPropertyMap(meta: EntityMetadata, alias?: string): Record<string, EntityProperty>;
107
- /**
108
- * Build a mapping for relation fields
109
- * For ManyToOne relations, we need to map from the foreign key field to the relation property
110
- * Format: { 'foreign_key_field': 'relationPropertyName' }
111
- */
112
- buildRelationFieldMap(meta: EntityMetadata, alias?: string): Record<string, string>;
113
- /**
114
- * Transform a single row by mapping column names to property names
115
- */
116
- transformRow(
117
- row: Record<string, any>,
118
- fieldToPropertyMap: Record<string, EntityProperty>,
119
- relationFieldMap: Record<string, string>,
120
- ): Record<string, any>;
121
- prepareOutputValue(prop: EntityProperty | undefined, value: unknown): unknown;
6
+ #private;
7
+ constructor(em: SqlEntityManager, options?: MikroKyselyPluginOptions);
8
+ reset(): void;
9
+ getOutputEntityMap(): Map<string, EntityMetadata>;
10
+ /** @internal */
11
+ getContextStack(): Map<string, EntityMetadata | undefined>[];
12
+ /** @internal */
13
+ getSubqueryAliasMap(): Map<string, EntityMetadata | undefined>;
14
+ transformSelectQuery(node: SelectQueryNode, queryId: QueryId): SelectQueryNode;
15
+ transformInsertQuery(node: InsertQueryNode, queryId?: QueryId): InsertQueryNode;
16
+ transformUpdateQuery(node: UpdateQueryNode, queryId?: QueryId): UpdateQueryNode;
17
+ transformDeleteQuery(node: DeleteQueryNode, queryId?: QueryId): DeleteQueryNode;
18
+ transformMergeQuery(node: MergeQueryNode, queryId?: QueryId): MergeQueryNode;
19
+ transformIdentifier(node: IdentifierNode, queryId: QueryId): IdentifierNode;
20
+ /**
21
+ * Find owner entity metadata for the current identifier in the context stack.
22
+ * Supports both aliased and non-aliased table references.
23
+ * Searches up the context stack to support correlated subqueries.
24
+ * Also checks subquery/CTE aliases to resolve to their source tables.
25
+ */
26
+ findOwnerEntityInContext(): EntityMetadata | undefined;
27
+ processOnCreateHooks(node: InsertQueryNode, meta: EntityMetadata): InsertQueryNode;
28
+ processOnUpdateHooks(node: UpdateQueryNode, meta: EntityMetadata): UpdateQueryNode;
29
+ processInsertValues(node: InsertQueryNode, meta: EntityMetadata): InsertQueryNode;
30
+ processUpdateValues(node: UpdateQueryNode, meta: EntityMetadata): UpdateQueryNode;
31
+ mapColumnsToProperties(columns: readonly ColumnNode[], meta: EntityMetadata): (EntityProperty | undefined)[];
32
+ normalizeColumnName(identifier: IdentifierNode): string;
33
+ findProperty(meta: EntityMetadata | undefined, columnName?: string): EntityProperty | undefined;
34
+ shouldConvertValues(): boolean;
35
+ prepareInputValue(prop: EntityProperty | undefined, value: unknown, enabled: boolean): unknown;
36
+ /**
37
+ * Look up a table name/alias in the context stack.
38
+ * Searches from current scope (top of stack) to parent scopes (bottom).
39
+ * This supports correlated subqueries and references to outer query tables.
40
+ */
41
+ lookupInContextStack(tableNameOrAlias: string): EntityMetadata | undefined;
42
+ /**
43
+ * Process WITH node (CTE definitions)
44
+ */
45
+ processWithNode(withNode: WithNode, context: Map<string, EntityMetadata | undefined>): void;
46
+ /**
47
+ * Extract CTE name from CommonTableExpressionNameNode
48
+ */
49
+ getCTEName(nameNode: CommonTableExpressionNameNode): string | undefined;
50
+ /**
51
+ * Process a FROM item (can be TableNode or AliasNode)
52
+ */
53
+ processFromItem(from: any, // OperationNode type - can be TableNode, AliasNode, or SelectQueryNode
54
+ context: Map<string, EntityMetadata | undefined>): void;
55
+ /**
56
+ * Process a JOIN node
57
+ */
58
+ processJoinNode(join: JoinNode, context: Map<string, EntityMetadata | undefined>): void;
59
+ /**
60
+ * Extract the primary source table from a SELECT query
61
+ * This helps resolve columns from subqueries to their original entity tables
62
+ */
63
+ extractSourceTableFromSelectQuery(selectQuery: SelectQueryNode): EntityMetadata | undefined;
64
+ /**
65
+ * Extract alias name from an alias node
66
+ */
67
+ extractAliasName(alias: any): string | undefined;
68
+ /**
69
+ * Extract table name from a TableNode
70
+ */
71
+ getTableName(node: TableNode | undefined): string | undefined;
72
+ /**
73
+ * Find entity metadata by table name or entity name
74
+ */
75
+ findEntityMetadata(name: string): EntityMetadata | undefined;
76
+ /**
77
+ * Transform result rows by mapping database column names to property names
78
+ * This is called for SELECT queries when columnNamingStrategy is 'property'
79
+ */
80
+ transformResult(rows: Record<string, any>[] | undefined, entityMap: Map<string, EntityMetadata>): Record<string, any>[] | undefined;
81
+ buildGlobalFieldMap(entityMap: Map<string, EntityMetadata>): Record<string, EntityProperty>;
82
+ buildGlobalRelationFieldMap(entityMap: Map<string, EntityMetadata>): Record<string, string>;
83
+ /**
84
+ * Build a mapping from database field names to property objects
85
+ * Format: { 'field_name': EntityProperty }
86
+ */
87
+ buildFieldToPropertyMap(meta: EntityMetadata, alias?: string): Record<string, EntityProperty>;
88
+ /**
89
+ * Build a mapping for relation fields
90
+ * For ManyToOne relations, we need to map from the foreign key field to the relation property
91
+ * Format: { 'foreign_key_field': 'relationPropertyName' }
92
+ */
93
+ buildRelationFieldMap(meta: EntityMetadata, alias?: string): Record<string, string>;
94
+ /**
95
+ * Transform a single row by mapping column names to property names
96
+ */
97
+ transformRow(row: Record<string, any>, fieldToPropertyMap: Record<string, EntityProperty>, relationFieldMap: Record<string, string>): Record<string, any>;
98
+ prepareOutputValue(prop: EntityProperty | undefined, value: unknown): unknown;
122
99
  }