@simplysm/orm-common 13.0.83 → 13.0.84

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 (73) hide show
  1. package/dist/ddl/initialize.d.ts +2 -2
  2. package/dist/ddl/initialize.js +1 -1
  3. package/dist/ddl/initialize.js.map +1 -1
  4. package/dist/ddl/table-ddl.d.ts +1 -1
  5. package/dist/exec/queryable.d.ts +115 -115
  6. package/dist/exec/queryable.js +68 -68
  7. package/dist/exec/queryable.js.map +1 -1
  8. package/dist/expr/expr.d.ts +248 -248
  9. package/dist/expr/expr.js +250 -250
  10. package/dist/query-builder/base/expr-renderer-base.d.ts +7 -7
  11. package/dist/query-builder/mssql/mssql-expr-renderer.d.ts +3 -3
  12. package/dist/query-builder/mssql/mssql-expr-renderer.d.ts.map +1 -1
  13. package/dist/query-builder/mssql/mssql-expr-renderer.js +5 -5
  14. package/dist/query-builder/mssql/mssql-query-builder.d.ts +2 -2
  15. package/dist/query-builder/mssql/mssql-query-builder.d.ts.map +1 -1
  16. package/dist/query-builder/mssql/mssql-query-builder.js +7 -7
  17. package/dist/query-builder/mysql/mysql-expr-renderer.d.ts +2 -2
  18. package/dist/query-builder/mysql/mysql-expr-renderer.d.ts.map +1 -1
  19. package/dist/query-builder/mysql/mysql-expr-renderer.js +4 -4
  20. package/dist/query-builder/mysql/mysql-query-builder.d.ts +10 -10
  21. package/dist/query-builder/mysql/mysql-query-builder.d.ts.map +1 -1
  22. package/dist/query-builder/mysql/mysql-query-builder.js +4 -4
  23. package/dist/query-builder/postgresql/postgresql-expr-renderer.d.ts +2 -2
  24. package/dist/query-builder/postgresql/postgresql-expr-renderer.d.ts.map +1 -1
  25. package/dist/query-builder/postgresql/postgresql-expr-renderer.js +4 -4
  26. package/dist/query-builder/postgresql/postgresql-query-builder.d.ts +8 -8
  27. package/dist/query-builder/postgresql/postgresql-query-builder.d.ts.map +1 -1
  28. package/dist/query-builder/postgresql/postgresql-query-builder.js +7 -7
  29. package/dist/query-builder/query-builder.d.ts +1 -1
  30. package/dist/schema/factory/column-builder.d.ts +46 -46
  31. package/dist/schema/factory/column-builder.js +25 -25
  32. package/dist/schema/factory/index-builder.d.ts +22 -22
  33. package/dist/schema/factory/index-builder.js +14 -14
  34. package/dist/schema/factory/relation-builder.d.ts +93 -93
  35. package/dist/schema/factory/relation-builder.d.ts.map +1 -1
  36. package/dist/schema/factory/relation-builder.js +37 -37
  37. package/dist/schema/procedure-builder.d.ts +38 -38
  38. package/dist/schema/procedure-builder.d.ts.map +1 -1
  39. package/dist/schema/procedure-builder.js +26 -26
  40. package/dist/schema/table-builder.d.ts +38 -38
  41. package/dist/schema/table-builder.d.ts.map +1 -1
  42. package/dist/schema/table-builder.js +29 -29
  43. package/dist/schema/view-builder.d.ts +26 -26
  44. package/dist/schema/view-builder.d.ts.map +1 -1
  45. package/dist/schema/view-builder.js +18 -18
  46. package/dist/types/db.d.ts +40 -40
  47. package/dist/types/expr.d.ts +75 -75
  48. package/dist/types/expr.d.ts.map +1 -1
  49. package/dist/types/query-def.d.ts +32 -32
  50. package/dist/types/query-def.d.ts.map +1 -1
  51. package/package.json +2 -2
  52. package/src/ddl/initialize.ts +16 -16
  53. package/src/ddl/table-ddl.ts +1 -1
  54. package/src/exec/queryable.ts +163 -163
  55. package/src/expr/expr.ts +257 -257
  56. package/src/query-builder/base/expr-renderer-base.ts +8 -8
  57. package/src/query-builder/mssql/mssql-expr-renderer.ts +20 -20
  58. package/src/query-builder/mssql/mssql-query-builder.ts +28 -28
  59. package/src/query-builder/mysql/mysql-expr-renderer.ts +22 -22
  60. package/src/query-builder/mysql/mysql-query-builder.ts +65 -65
  61. package/src/query-builder/postgresql/postgresql-expr-renderer.ts +15 -15
  62. package/src/query-builder/postgresql/postgresql-query-builder.ts +43 -43
  63. package/src/query-builder/query-builder.ts +1 -1
  64. package/src/schema/factory/column-builder.ts +48 -48
  65. package/src/schema/factory/index-builder.ts +22 -22
  66. package/src/schema/factory/relation-builder.ts +95 -95
  67. package/src/schema/procedure-builder.ts +38 -38
  68. package/src/schema/table-builder.ts +38 -38
  69. package/src/schema/view-builder.ts +28 -28
  70. package/src/types/db.ts +41 -41
  71. package/src/types/expr.ts +79 -79
  72. package/src/types/query-def.ts +37 -37
  73. package/tests/ddl/basic.expected.ts +8 -8
@@ -5,13 +5,13 @@ import { type ColumnBuilderRecord, createColumnFactory } from "./factory/column-
5
5
  // ============================================
6
6
 
7
7
  /**
8
- * 저장 Procedure definition builder
8
+ * Stored Procedure definition builder
9
9
  *
10
- * Fluent API를 통해 Procedure 파라미터, return type, 본문을 definition
11
- * DbContext executable() 함께 사용하여 type 안전한 Procedure 호출
10
+ * Define Procedure parameters, return type, and body via Fluent API
11
+ * Use with DbContext's executable() for type-safe Procedure invocation
12
12
  *
13
- * @template TParams - 파라미터 Column definition type
14
- * @template TReturns - return Column definition type
13
+ * @template TParams - Parameter Column definition type
14
+ * @template TReturns - Return Column definition type
15
15
  *
16
16
  * @example
17
17
  * ```typescript
@@ -28,12 +28,12 @@ import { type ColumnBuilderRecord, createColumnFactory } from "./factory/column-
28
28
  * }))
29
29
  * .body("SELECT id, name, email FROM User WHERE id = userId");
30
30
  *
31
- * // DbContextused in
31
+ * // Used in DbContext
32
32
  * class MyDb extends DbContext {
33
33
  * readonly getUserById = executable(this, GetUserById);
34
34
  * }
35
35
  *
36
- * // 호출
36
+ * // Invocation
37
37
  * const users = await db.getUserById({ userId: 1n }).execute();
38
38
  * ```
39
39
  *
@@ -44,20 +44,20 @@ export class ProcedureBuilder<
44
44
  TParams extends ColumnBuilderRecord,
45
45
  TReturns extends ColumnBuilderRecord,
46
46
  > {
47
- /** 파라미터 definition (type for inference) */
47
+ /** Parameter definition (type for inference) */
48
48
  readonly $params!: TParams;
49
49
  /** return type definition (type for inference) */
50
50
  readonly $returns!: TReturns;
51
51
 
52
52
  /**
53
53
  * @param meta - Procedure Metadata
54
- * @param meta.name - Procedure 이름
55
- * @param meta.description - Procedure description (주석)
56
- * @param meta.database - Database 이름
57
- * @param meta.schema - Schema 이름 (MSSQL/PostgreSQL)
58
- * @param meta.params - 파라미터 definition
59
- * @param meta.returns - return type definition
60
- * @param meta.query - Procedure 본문 SQL
54
+ * @param meta.name - Procedure name
55
+ * @param meta.description - Procedure description (comment)
56
+ * @param meta.database - Database name
57
+ * @param meta.schema - Schema name (MSSQL/PostgreSQL)
58
+ * @param meta.params - Parameter definition
59
+ * @param meta.returns - Return type definition
60
+ * @param meta.query - Procedure body SQL
61
61
  */
62
62
  constructor(
63
63
  readonly meta: {
@@ -74,7 +74,7 @@ export class ProcedureBuilder<
74
74
  /**
75
75
  * Procedure set description
76
76
  *
77
- * @param desc - Procedure description (DDL Comment으로 사용)
77
+ * @param desc - Procedure description (used as DDL Comment)
78
78
  * @returns new ProcedureBuilder instance
79
79
  */
80
80
  description(desc: string): ProcedureBuilder<TParams, TReturns> {
@@ -84,7 +84,7 @@ export class ProcedureBuilder<
84
84
  /**
85
85
  * Database set name
86
86
  *
87
- * @param db - Database 이름
87
+ * @param db - Database name
88
88
  * @returns new ProcedureBuilder instance
89
89
  *
90
90
  * @example
@@ -101,7 +101,7 @@ export class ProcedureBuilder<
101
101
  *
102
102
  * MSSQL, PostgreSQLused in
103
103
  *
104
- * @param schema - Schema 이름 (MSSQL: dbo, PostgreSQL: public)
104
+ * @param schema - Schema name (MSSQL: dbo, PostgreSQL: public)
105
105
  * @returns new ProcedureBuilder instance
106
106
  */
107
107
  schema(schema: string): ProcedureBuilder<TParams, TReturns> {
@@ -109,13 +109,13 @@ export class ProcedureBuilder<
109
109
  }
110
110
 
111
111
  /**
112
- * 파라미터 definition
112
+ * Parameter definition
113
113
  *
114
- * Procedure 입력 파라미터 definition
115
- * DBMS 파라미터 문법 차이 주의 (MSSQL: @param, MySQL/PostgreSQL: param)
114
+ * Define Procedure input parameters
115
+ * Note DBMS-specific parameter syntax differences (MSSQL: @param, MySQL/PostgreSQL: param)
116
116
  *
117
- * @template T - 파라미터 definition type
118
- * @param fn - Column factory 받아 파라미터 정의를 반환하는 function
117
+ * @template T - New parameter definition type
118
+ * @param fn - Function that receives a Column factory and returns parameter definitions
119
119
  * @returns new ProcedureBuilder instance
120
120
  *
121
121
  * @example
@@ -134,12 +134,12 @@ export class ProcedureBuilder<
134
134
  }
135
135
 
136
136
  /**
137
- * return type definition
137
+ * Return type definition
138
138
  *
139
- * Procedure return result Column definition
139
+ * Define Procedure return result columns
140
140
  *
141
- * @template T - return type definition
142
- * @param fn - Column factory 받아 return Column definition를 반환하는 function
141
+ * @template T - New return type definition
142
+ * @param fn - Function that receives a Column factory and returns Column definitions
143
143
  * @returns new ProcedureBuilder instance
144
144
  *
145
145
  * @example
@@ -160,14 +160,14 @@ export class ProcedureBuilder<
160
160
  }
161
161
 
162
162
  /**
163
- * Procedure 본문 SQL 설정
163
+ * Set Procedure body SQL
164
164
  *
165
- * DBMS SQL 문법 차이 주의:
166
- * - MySQL: 파라미터명 그대로 (userId)
167
- * - MSSQL: @ 접두사 (@userId)
168
- * - PostgreSQL: RETURN QUERY 필요
165
+ * Note DBMS-specific SQL syntax differences:
166
+ * - MySQL: parameter name as-is (userId)
167
+ * - MSSQL: @ prefix (@userId)
168
+ * - PostgreSQL: RETURN QUERY required
169
169
  *
170
- * @param sql - Procedure 본문 SQL
170
+ * @param sql - Procedure body SQL
171
171
  * @returns new ProcedureBuilder instance
172
172
  *
173
173
  * @example
@@ -193,16 +193,16 @@ export class ProcedureBuilder<
193
193
  // ============================================
194
194
 
195
195
  /**
196
- * Procedure builder Generate factory function
196
+ * Procedure builder factory function
197
197
  *
198
- * ProcedureBuilder 생성하여 Fluent API로 저장 Procedure schema definition
198
+ * Creates a ProcedureBuilder for defining stored Procedure schema via Fluent API
199
199
  *
200
- * @param name - Procedure 이름
200
+ * @param name - Procedure name
201
201
  * @returns ProcedureBuilder instance
202
202
  *
203
203
  * @example
204
204
  * ```typescript
205
- * // Basic 사용
205
+ * // Basic usage
206
206
  * const GetUserById = Procedure("GetUserById")
207
207
  * .database("mydb")
208
208
  * .params((c) => ({
@@ -215,7 +215,7 @@ export class ProcedureBuilder<
215
215
  * }))
216
216
  * .body("SELECT id, name, email FROM User WHERE id = userId");
217
217
  *
218
- * // 파라미터 없는 Procedure
218
+ * // Procedure without parameters
219
219
  * const GetAllActiveUsers = Procedure("GetAllActiveUsers")
220
220
  * .database("mydb")
221
221
  * .returns((c) => ({
@@ -19,11 +19,11 @@ import {
19
19
  /**
20
20
  * Database Table definition builder
21
21
  *
22
- * Fluent API를 통해 Table column, PK, Index, 관계를 definition
23
- * DbContext에서 queryable() 함께 사용하여 type 안전한 query 작성
22
+ * Define Table columns, PK, indexes, and relations via Fluent API
23
+ * Use with DbContext's queryable() for type-safe query composition
24
24
  *
25
25
  * @template TColumns - Column definition record type
26
- * @template TRelations - relationship definition record type
26
+ * @template TRelations - Relation definition record type
27
27
  *
28
28
  * @example
29
29
  * ```typescript
@@ -39,7 +39,7 @@ import {
39
39
  * .primaryKey("id")
40
40
  * .indexes((i) => [i.index("email").unique()]);
41
41
  *
42
- * // DbContextused in
42
+ * // Used in DbContext
43
43
  * class MyDb extends DbContext {
44
44
  * readonly user = queryable(this, User);
45
45
  * }
@@ -54,27 +54,27 @@ export class TableBuilder<
54
54
  > {
55
55
  /** Column definition (type for inference) */
56
56
  readonly $columns!: TColumns;
57
- /** relationship definition (type for inference) */
57
+ /** Relation definition (type for inference) */
58
58
  readonly $relations!: TRelations;
59
59
 
60
- /** 전체 Type inference (column + relationship) */
60
+ /** Full Type inference (column + relation) */
61
61
  readonly $inferSelect!: InferColumns<TColumns> & InferDeepRelations<TRelations>;
62
- /** column만 Type inference */
62
+ /** Column-only Type inference */
63
63
  readonly $inferColumns!: InferColumns<TColumns>;
64
- /** INSERT Type inference (autoIncrement exclude, nullable/default optional) */
64
+ /** INSERT Type inference (autoIncrement excluded, nullable/default are optional) */
65
65
  readonly $inferInsert!: InferInsertColumns<TColumns>;
66
- /** UPDATE Type inference (모든 field optional) */
66
+ /** UPDATE Type inference (all fields optional) */
67
67
  readonly $inferUpdate!: InferUpdateColumns<TColumns>;
68
68
 
69
69
  /**
70
70
  * @param meta - Table Metadata
71
- * @param meta.name - Table 이름
72
- * @param meta.description - Table description (주석)
73
- * @param meta.database - Database 이름
74
- * @param meta.schema - Schema 이름 (MSSQL/PostgreSQL)
71
+ * @param meta.name - Table name
72
+ * @param meta.description - Table description (comment)
73
+ * @param meta.database - Database name
74
+ * @param meta.schema - Schema name (MSSQL/PostgreSQL)
75
75
  * @param meta.columns - Column definition
76
76
  * @param meta.primaryKey - PK column array
77
- * @param meta.relations - relationship definition
77
+ * @param meta.relations - Relation definition
78
78
  * @param meta.indexes - Index definition
79
79
  */
80
80
  constructor(
@@ -94,7 +94,7 @@ export class TableBuilder<
94
94
  /**
95
95
  * Table set description
96
96
  *
97
- * @param desc - Table description (DDL Comment으로 사용)
97
+ * @param desc - Table description (used as DDL Comment)
98
98
  * @returns new TableBuilder instance
99
99
  */
100
100
  description(desc: string) {
@@ -104,7 +104,7 @@ export class TableBuilder<
104
104
  /**
105
105
  * Database set name
106
106
  *
107
- * @param db - Database 이름
107
+ * @param db - Database name
108
108
  * @returns new TableBuilder instance
109
109
  *
110
110
  * @example
@@ -119,9 +119,9 @@ export class TableBuilder<
119
119
  /**
120
120
  * schema set name
121
121
  *
122
- * MSSQL, PostgreSQLused in
122
+ * Used in MSSQL, PostgreSQL
123
123
  *
124
- * @param schema - Schema 이름 (MSSQL: dbo, PostgreSQL: public)
124
+ * @param schema - Schema name (MSSQL: dbo, PostgreSQL: public)
125
125
  * @returns new TableBuilder instance
126
126
  *
127
127
  * @example
@@ -138,10 +138,10 @@ export class TableBuilder<
138
138
  /**
139
139
  * Column definition
140
140
  *
141
- * column factory를 통해 type 안전한 Column definition
141
+ * Type-safe Column definition through column factory
142
142
  *
143
- * @template TNewColumnDefs - Column definition type
144
- * @param fn - Column factory 받아 Column definition를 반환하는 function
143
+ * @template TNewColumnDefs - New Column definition type
144
+ * @param fn - Function that receives a Column factory and returns Column definitions
145
145
  * @returns new TableBuilder instance
146
146
  *
147
147
  * @example
@@ -165,19 +165,19 @@ export class TableBuilder<
165
165
  }
166
166
 
167
167
  /**
168
- * Primary Key 설정
168
+ * Primary Key configuration
169
169
  *
170
- * @param columns - PK를 구성할 column name들 (복합 PK 가능)
170
+ * @param columns - Column names composing the PK (composite PK supported)
171
171
  * @returns new TableBuilder instance
172
172
  *
173
173
  * @example
174
174
  * ```typescript
175
- * // 단일 PK
175
+ * // Single PK
176
176
  * const User = Table("User")
177
177
  * .columns((c) => ({ id: c.bigint() }))
178
178
  * .primaryKey("id");
179
179
  *
180
- * // 복합 PK
180
+ * // Composite PK
181
181
  * const UserRole = Table("UserRole")
182
182
  * .columns((c) => ({
183
183
  * userId: c.bigint(),
@@ -196,7 +196,7 @@ export class TableBuilder<
196
196
  /**
197
197
  * Index definition
198
198
  *
199
- * @param fn - Index factory 받아 Index 배열을 반환하는 function
199
+ * @param fn - Function that receives an Index factory and returns an Index array
200
200
  * @returns new TableBuilder instance
201
201
  *
202
202
  * @example
@@ -225,12 +225,12 @@ export class TableBuilder<
225
225
  }
226
226
 
227
227
  /**
228
- * relationship definition
228
+ * Relation definition
229
229
  *
230
- * FK, 역참조 Table 간 relationship 설정
230
+ * Set up FK, reverse-references, and other inter-Table relations
231
231
  *
232
- * @template T - relationship definition type
233
- * @param fn - relationship factory 받아 relationship 정의를 반환하는 function
232
+ * @template T - Relation definition type
233
+ * @param fn - Function that receives a relation factory and returns relation definitions
234
234
  * @returns new TableBuilder instance
235
235
  *
236
236
  * @example
@@ -243,7 +243,7 @@ export class TableBuilder<
243
243
  * }))
244
244
  * .primaryKey("id")
245
245
  * .relations((r) => ({
246
- * // FK relationship (N:1)
246
+ * // FK relation (N:1)
247
247
  * author: r.foreignKey(["authorId"], () => User),
248
248
  * }));
249
249
  *
@@ -254,13 +254,13 @@ export class TableBuilder<
254
254
  * }))
255
255
  * .primaryKey("id")
256
256
  * .relations((r) => ({
257
- * // 역참조 (1:N)
257
+ * // Reverse-reference (1:N)
258
258
  * posts: r.foreignKeyTarget(() => Post, "author"),
259
259
  * }));
260
260
  * ```
261
261
  *
262
262
  * @see {@link ForeignKeyBuilder} FK builder
263
- * @see {@link ForeignKeyTargetBuilder} FK 역참조 builder
263
+ * @see {@link ForeignKeyTargetBuilder} FK reverse-reference builder
264
264
  */
265
265
  relations<T extends RelationBuilderRecord>(
266
266
  fn: (r: ReturnType<typeof createRelationFactory<this, keyof TColumns & string>>) => T,
@@ -277,16 +277,16 @@ export class TableBuilder<
277
277
  // ============================================
278
278
 
279
279
  /**
280
- * Table builder Generate factory function
280
+ * Table builder factory function
281
281
  *
282
- * TableBuilder 생성하여 Fluent API로 Table schema definition
282
+ * Creates a TableBuilder for defining Table schema via Fluent API
283
283
  *
284
- * @param name - Table 이름
284
+ * @param name - Table name
285
285
  * @returns TableBuilder instance
286
286
  *
287
287
  * @example
288
288
  * ```typescript
289
- * // Basic 사용
289
+ * // Basic usage
290
290
  * const User = Table("User")
291
291
  * .database("mydb")
292
292
  * .columns((c) => ({
@@ -297,7 +297,7 @@ export class TableBuilder<
297
297
  * .primaryKey("id")
298
298
  * .indexes((i) => [i.index("email").unique()]);
299
299
  *
300
- * // relationship include
300
+ * // With relations
301
301
  * const Post = Table("Post")
302
302
  * .database("mydb")
303
303
  * .columns((c) => ({
@@ -14,12 +14,12 @@ import {
14
14
  /**
15
15
  * Database View definition builder
16
16
  *
17
- * Fluent API를 통해 View query, 관계를 definition
18
- * DbContext에서 queryable() 함께 사용하여 type 안전한 query 작성
17
+ * Define View query and relations via Fluent API
18
+ * Use with DbContext's queryable() for type-safe query composition
19
19
  *
20
20
  * @template TDbContext - DbContext type
21
21
  * @template TData - View data record type
22
- * @template TRelations - relationship definition record type
22
+ * @template TRelations - Relation definition record type
23
23
  *
24
24
  * @example
25
25
  * ```typescript
@@ -38,7 +38,7 @@ import {
38
38
  * }))
39
39
  * );
40
40
  *
41
- * // DbContextused in
41
+ * // Used in DbContext
42
42
  * class MyDb extends DbContext {
43
43
  * readonly userSummary = queryable(this, UserSummary);
44
44
  * }
@@ -52,19 +52,19 @@ export class ViewBuilder<
52
52
  TData extends DataRecord,
53
53
  TRelations extends RelationBuilderRecord,
54
54
  > {
55
- /** relationship definition (type for inference) */
55
+ /** Relation definition (type for inference) */
56
56
  readonly $relations!: TRelations;
57
- /** 전체 Type inference */
57
+ /** Full Type inference */
58
58
  readonly $inferSelect!: TData;
59
59
 
60
60
  /**
61
61
  * @param meta - View Metadata
62
- * @param meta.name - View 이름
63
- * @param meta.description - View description (주석)
64
- * @param meta.database - Database 이름
65
- * @param meta.schema - Schema 이름 (MSSQL/PostgreSQL)
62
+ * @param meta.name - View name
63
+ * @param meta.description - View description (comment)
64
+ * @param meta.database - Database name
65
+ * @param meta.schema - Schema name (MSSQL/PostgreSQL)
66
66
  * @param meta.viewFn - View Query definition function
67
- * @param meta.relations - relationship definition
67
+ * @param meta.relations - Relation definition
68
68
  */
69
69
  constructor(
70
70
  readonly meta: {
@@ -80,7 +80,7 @@ export class ViewBuilder<
80
80
  /**
81
81
  * View set description
82
82
  *
83
- * @param desc - View description (DDL Comment으로 사용)
83
+ * @param desc - View description (used as DDL Comment)
84
84
  * @returns new ViewBuilder instance
85
85
  */
86
86
  description(desc: string): ViewBuilder<TDbContext, TData, TRelations> {
@@ -90,7 +90,7 @@ export class ViewBuilder<
90
90
  /**
91
91
  * Database set name
92
92
  *
93
- * @param db - Database 이름
93
+ * @param db - Database name
94
94
  * @returns new ViewBuilder instance
95
95
  *
96
96
  * @example
@@ -105,9 +105,9 @@ export class ViewBuilder<
105
105
  /**
106
106
  * schema set name
107
107
  *
108
- * MSSQL, PostgreSQLused in
108
+ * Used in MSSQL, PostgreSQL
109
109
  *
110
- * @param schema - Schema 이름 (MSSQL: dbo, PostgreSQL: public)
110
+ * @param schema - Schema name (MSSQL: dbo, PostgreSQL: public)
111
111
  * @returns new ViewBuilder instance
112
112
  */
113
113
  schema(schema: string): ViewBuilder<TDbContext, TData, TRelations> {
@@ -117,11 +117,11 @@ export class ViewBuilder<
117
117
  /**
118
118
  * View Query definition
119
119
  *
120
- * SELECT query를 통해 View data 소스 definition
120
+ * Define the View's data source through a SELECT query
121
121
  *
122
122
  * @template TViewData - View data type
123
123
  * @template TDb - DbContext type
124
- * @param viewFn - DbContext 받아 Queryable을 반환하는 function
124
+ * @param viewFn - Function that receives a DbContext and returns a Queryable
125
125
  * @returns new ViewBuilder instance
126
126
  *
127
127
  * @example
@@ -146,12 +146,12 @@ export class ViewBuilder<
146
146
  }
147
147
 
148
148
  /**
149
- * relationship definition
149
+ * Relation definition
150
150
  *
151
- * 다른 Table/View와의 relationship 설정
151
+ * Set up relations with other Tables/Views
152
152
  *
153
- * @template T - relationship definition type
154
- * @param fn - relationship factory 받아 relationship 정의를 반환하는 function
153
+ * @template T - Relation definition type
154
+ * @param fn - Function that receives a relation factory and returns relation definitions
155
155
  * @returns new ViewBuilder instance
156
156
  *
157
157
  * @example
@@ -164,13 +164,13 @@ export class ViewBuilder<
164
164
  * ```
165
165
  *
166
166
  * @see {@link ForeignKeyBuilder} FK builder
167
- * @see {@link ForeignKeyTargetBuilder} FK 역참조 builder
167
+ * @see {@link ForeignKeyTargetBuilder} FK reverse-reference builder
168
168
  */
169
169
  relations<T extends RelationBuilderRecord>(
170
170
  fn: (r: ReturnType<typeof createRelationFactory<this, keyof TData & string>>) => T,
171
171
  ): ViewBuilder<TDbContext, TData & InferDeepRelations<T>, TRelations> {
172
- // TypeScript generic Type inference 한계로 인해 캐스팅 불가피
173
- // TRelations type 파라미터와 새로 생성되는 relationship type T 간의 type 불일치 해결
172
+ // Casting is unavoidable due to TypeScript generic type inference limitations
173
+ // Resolves type mismatch between TRelations type parameter and newly created relation type T
174
174
  return new ViewBuilder({
175
175
  ...this.meta,
176
176
  relations: fn(createRelationFactory<this, keyof TData & string>(() => this)),
@@ -183,16 +183,16 @@ export class ViewBuilder<
183
183
  // ============================================
184
184
 
185
185
  /**
186
- * View builder Generate factory function
186
+ * View builder factory function
187
187
  *
188
- * ViewBuilder 생성하여 Fluent API로 View schema definition
188
+ * Creates a ViewBuilder for defining View schema via Fluent API
189
189
  *
190
- * @param name - View 이름
190
+ * @param name - View name
191
191
  * @returns ViewBuilder instance
192
192
  *
193
193
  * @example
194
194
  * ```typescript
195
- * // Basic 사용
195
+ * // Basic usage
196
196
  * const ActiveUsers = View("ActiveUsers")
197
197
  * .database("mydb")
198
198
  * .query((db: MyDb) =>