@simplysm/orm-common 13.0.82 → 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 (80) hide show
  1. package/README.md +106 -0
  2. package/dist/ddl/initialize.d.ts +2 -2
  3. package/dist/ddl/initialize.js +1 -1
  4. package/dist/ddl/initialize.js.map +1 -1
  5. package/dist/ddl/table-ddl.d.ts +1 -1
  6. package/dist/exec/queryable.d.ts +115 -115
  7. package/dist/exec/queryable.js +68 -68
  8. package/dist/exec/queryable.js.map +1 -1
  9. package/dist/expr/expr.d.ts +248 -248
  10. package/dist/expr/expr.js +250 -250
  11. package/dist/query-builder/base/expr-renderer-base.d.ts +7 -7
  12. package/dist/query-builder/mssql/mssql-expr-renderer.d.ts +3 -3
  13. package/dist/query-builder/mssql/mssql-expr-renderer.d.ts.map +1 -1
  14. package/dist/query-builder/mssql/mssql-expr-renderer.js +5 -5
  15. package/dist/query-builder/mssql/mssql-query-builder.d.ts +2 -2
  16. package/dist/query-builder/mssql/mssql-query-builder.d.ts.map +1 -1
  17. package/dist/query-builder/mssql/mssql-query-builder.js +7 -7
  18. package/dist/query-builder/mysql/mysql-expr-renderer.d.ts +2 -2
  19. package/dist/query-builder/mysql/mysql-expr-renderer.d.ts.map +1 -1
  20. package/dist/query-builder/mysql/mysql-expr-renderer.js +4 -4
  21. package/dist/query-builder/mysql/mysql-query-builder.d.ts +10 -10
  22. package/dist/query-builder/mysql/mysql-query-builder.d.ts.map +1 -1
  23. package/dist/query-builder/mysql/mysql-query-builder.js +4 -4
  24. package/dist/query-builder/postgresql/postgresql-expr-renderer.d.ts +2 -2
  25. package/dist/query-builder/postgresql/postgresql-expr-renderer.d.ts.map +1 -1
  26. package/dist/query-builder/postgresql/postgresql-expr-renderer.js +4 -4
  27. package/dist/query-builder/postgresql/postgresql-query-builder.d.ts +8 -8
  28. package/dist/query-builder/postgresql/postgresql-query-builder.d.ts.map +1 -1
  29. package/dist/query-builder/postgresql/postgresql-query-builder.js +7 -7
  30. package/dist/query-builder/query-builder.d.ts +1 -1
  31. package/dist/schema/factory/column-builder.d.ts +46 -46
  32. package/dist/schema/factory/column-builder.js +25 -25
  33. package/dist/schema/factory/index-builder.d.ts +22 -22
  34. package/dist/schema/factory/index-builder.js +14 -14
  35. package/dist/schema/factory/relation-builder.d.ts +93 -93
  36. package/dist/schema/factory/relation-builder.d.ts.map +1 -1
  37. package/dist/schema/factory/relation-builder.js +37 -37
  38. package/dist/schema/procedure-builder.d.ts +38 -38
  39. package/dist/schema/procedure-builder.d.ts.map +1 -1
  40. package/dist/schema/procedure-builder.js +26 -26
  41. package/dist/schema/table-builder.d.ts +38 -38
  42. package/dist/schema/table-builder.d.ts.map +1 -1
  43. package/dist/schema/table-builder.js +29 -29
  44. package/dist/schema/view-builder.d.ts +26 -26
  45. package/dist/schema/view-builder.d.ts.map +1 -1
  46. package/dist/schema/view-builder.js +18 -18
  47. package/dist/types/db.d.ts +40 -40
  48. package/dist/types/expr.d.ts +75 -75
  49. package/dist/types/expr.d.ts.map +1 -1
  50. package/dist/types/query-def.d.ts +32 -32
  51. package/dist/types/query-def.d.ts.map +1 -1
  52. package/docs/db-context.md +238 -0
  53. package/docs/expressions.md +413 -0
  54. package/docs/query-builder.md +198 -0
  55. package/docs/queryable.md +420 -0
  56. package/docs/schema-builders.md +216 -0
  57. package/docs/types-and-utilities.md +353 -0
  58. package/package.json +4 -3
  59. package/src/ddl/initialize.ts +16 -16
  60. package/src/ddl/table-ddl.ts +1 -1
  61. package/src/exec/queryable.ts +163 -163
  62. package/src/expr/expr.ts +257 -257
  63. package/src/query-builder/base/expr-renderer-base.ts +8 -8
  64. package/src/query-builder/mssql/mssql-expr-renderer.ts +20 -20
  65. package/src/query-builder/mssql/mssql-query-builder.ts +28 -28
  66. package/src/query-builder/mysql/mysql-expr-renderer.ts +22 -22
  67. package/src/query-builder/mysql/mysql-query-builder.ts +65 -65
  68. package/src/query-builder/postgresql/postgresql-expr-renderer.ts +15 -15
  69. package/src/query-builder/postgresql/postgresql-query-builder.ts +43 -43
  70. package/src/query-builder/query-builder.ts +1 -1
  71. package/src/schema/factory/column-builder.ts +48 -48
  72. package/src/schema/factory/index-builder.ts +22 -22
  73. package/src/schema/factory/relation-builder.ts +95 -95
  74. package/src/schema/procedure-builder.ts +38 -38
  75. package/src/schema/table-builder.ts +38 -38
  76. package/src/schema/view-builder.ts +28 -28
  77. package/src/types/db.ts +41 -41
  78. package/src/types/expr.ts +79 -79
  79. package/src/types/query-def.ts +37 -37
  80. package/tests/ddl/basic.expected.ts +8 -8
@@ -5,12 +5,12 @@ import { createRelationFactory, type InferDeepRelations, type RelationBuilderRec
5
5
  /**
6
6
  * Database View definition builder
7
7
  *
8
- * Fluent API를 통해 View query, 관계를 definition
9
- * DbContext에서 queryable() 함께 사용하여 type 안전한 query 작성
8
+ * Define View query and relations via Fluent API
9
+ * Use with DbContext's queryable() for type-safe query composition
10
10
  *
11
11
  * @template TDbContext - DbContext type
12
12
  * @template TData - View data record type
13
- * @template TRelations - relationship definition record type
13
+ * @template TRelations - Relation definition record type
14
14
  *
15
15
  * @example
16
16
  * ```typescript
@@ -29,7 +29,7 @@ import { createRelationFactory, type InferDeepRelations, type RelationBuilderRec
29
29
  * }))
30
30
  * );
31
31
  *
32
- * // DbContextused in
32
+ * // Used in DbContext
33
33
  * class MyDb extends DbContext {
34
34
  * readonly userSummary = queryable(this, UserSummary);
35
35
  * }
@@ -47,18 +47,18 @@ export declare class ViewBuilder<TDbContext extends DbContextBase, TData extends
47
47
  viewFn?: (db: TDbContext) => Queryable<TData, any>;
48
48
  relations?: TRelations;
49
49
  };
50
- /** relationship definition (type for inference) */
50
+ /** Relation definition (type for inference) */
51
51
  readonly $relations: TRelations;
52
- /** 전체 Type inference */
52
+ /** Full Type inference */
53
53
  readonly $inferSelect: TData;
54
54
  /**
55
55
  * @param meta - View Metadata
56
- * @param meta.name - View 이름
57
- * @param meta.description - View description (주석)
58
- * @param meta.database - Database 이름
59
- * @param meta.schema - Schema 이름 (MSSQL/PostgreSQL)
56
+ * @param meta.name - View name
57
+ * @param meta.description - View description (comment)
58
+ * @param meta.database - Database name
59
+ * @param meta.schema - Schema name (MSSQL/PostgreSQL)
60
60
  * @param meta.viewFn - View Query definition function
61
- * @param meta.relations - relationship definition
61
+ * @param meta.relations - Relation definition
62
62
  */
63
63
  constructor(meta: {
64
64
  name: string;
@@ -71,14 +71,14 @@ export declare class ViewBuilder<TDbContext extends DbContextBase, TData extends
71
71
  /**
72
72
  * View set description
73
73
  *
74
- * @param desc - View description (DDL Comment으로 사용)
74
+ * @param desc - View description (used as DDL Comment)
75
75
  * @returns new ViewBuilder instance
76
76
  */
77
77
  description(desc: string): ViewBuilder<TDbContext, TData, TRelations>;
78
78
  /**
79
79
  * Database set name
80
80
  *
81
- * @param db - Database 이름
81
+ * @param db - Database name
82
82
  * @returns new ViewBuilder instance
83
83
  *
84
84
  * @example
@@ -90,20 +90,20 @@ export declare class ViewBuilder<TDbContext extends DbContextBase, TData extends
90
90
  /**
91
91
  * schema set name
92
92
  *
93
- * MSSQL, PostgreSQLused in
93
+ * Used in MSSQL, PostgreSQL
94
94
  *
95
- * @param schema - Schema 이름 (MSSQL: dbo, PostgreSQL: public)
95
+ * @param schema - Schema name (MSSQL: dbo, PostgreSQL: public)
96
96
  * @returns new ViewBuilder instance
97
97
  */
98
98
  schema(schema: string): ViewBuilder<TDbContext, TData, TRelations>;
99
99
  /**
100
100
  * View Query definition
101
101
  *
102
- * SELECT query를 통해 View data 소스 definition
102
+ * Define the View's data source through a SELECT query
103
103
  *
104
104
  * @template TViewData - View data type
105
105
  * @template TDb - DbContext type
106
- * @param viewFn - DbContext 받아 Queryable을 반환하는 function
106
+ * @param viewFn - Function that receives a DbContext and returns a Queryable
107
107
  * @returns new ViewBuilder instance
108
108
  *
109
109
  * @example
@@ -123,12 +123,12 @@ export declare class ViewBuilder<TDbContext extends DbContextBase, TData extends
123
123
  */
124
124
  query<TViewData extends DataRecord, TDb extends DbContextBase>(viewFn: (db: TDb) => Queryable<TViewData, any>): ViewBuilder<TDb, TViewData, TRelations>;
125
125
  /**
126
- * relationship definition
126
+ * Relation definition
127
127
  *
128
- * 다른 Table/View와의 relationship 설정
128
+ * Set up relations with other Tables/Views
129
129
  *
130
- * @template T - relationship definition type
131
- * @param fn - relationship factory 받아 relationship 정의를 반환하는 function
130
+ * @template T - Relation definition type
131
+ * @param fn - Function that receives a relation factory and returns relation definitions
132
132
  * @returns new ViewBuilder instance
133
133
  *
134
134
  * @example
@@ -141,21 +141,21 @@ export declare class ViewBuilder<TDbContext extends DbContextBase, TData extends
141
141
  * ```
142
142
  *
143
143
  * @see {@link ForeignKeyBuilder} FK builder
144
- * @see {@link ForeignKeyTargetBuilder} FK 역참조 builder
144
+ * @see {@link ForeignKeyTargetBuilder} FK reverse-reference builder
145
145
  */
146
146
  relations<T extends RelationBuilderRecord>(fn: (r: ReturnType<typeof createRelationFactory<this, keyof TData & string>>) => T): ViewBuilder<TDbContext, TData & InferDeepRelations<T>, TRelations>;
147
147
  }
148
148
  /**
149
- * View builder Generate factory function
149
+ * View builder factory function
150
150
  *
151
- * ViewBuilder 생성하여 Fluent API로 View schema definition
151
+ * Creates a ViewBuilder for defining View schema via Fluent API
152
152
  *
153
- * @param name - View 이름
153
+ * @param name - View name
154
154
  * @returns ViewBuilder instance
155
155
  *
156
156
  * @example
157
157
  * ```typescript
158
- * // Basic 사용
158
+ * // Basic usage
159
159
  * const ActiveUsers = View("ActiveUsers")
160
160
  * .database("mydb")
161
161
  * .query((db: MyDb) =>
@@ -1 +1 @@
1
- {"version":3,"file":"view-builder.d.ts","sourceRoot":"","sources":["..\\..\\src\\schema\\view-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAA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,SAAS,CAAC,SAAS,EAAE,GAAG,CAAC,GAC7C,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC;IAI1C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,SAAS,CAAC,CAAC,SAAS,qBAAqB,EACvC,EAAE,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,GACjF,WAAW,CAAC,UAAU,EAAE,KAAK,GAAG,kBAAkB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;CAQtE;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,iEAEhC"}
@@ -4,24 +4,24 @@ import {
4
4
  class ViewBuilder {
5
5
  /**
6
6
  * @param meta - View Metadata
7
- * @param meta.name - View 이름
8
- * @param meta.description - View description (주석)
9
- * @param meta.database - Database 이름
10
- * @param meta.schema - Schema 이름 (MSSQL/PostgreSQL)
7
+ * @param meta.name - View name
8
+ * @param meta.description - View description (comment)
9
+ * @param meta.database - Database name
10
+ * @param meta.schema - Schema name (MSSQL/PostgreSQL)
11
11
  * @param meta.viewFn - View Query definition function
12
- * @param meta.relations - relationship definition
12
+ * @param meta.relations - Relation definition
13
13
  */
14
14
  constructor(meta) {
15
15
  this.meta = meta;
16
16
  }
17
- /** relationship definition (type for inference) */
17
+ /** Relation definition (type for inference) */
18
18
  $relations;
19
- /** 전체 Type inference */
19
+ /** Full Type inference */
20
20
  $inferSelect;
21
21
  /**
22
22
  * View set description
23
23
  *
24
- * @param desc - View description (DDL Comment으로 사용)
24
+ * @param desc - View description (used as DDL Comment)
25
25
  * @returns new ViewBuilder instance
26
26
  */
27
27
  description(desc) {
@@ -30,7 +30,7 @@ class ViewBuilder {
30
30
  /**
31
31
  * Database set name
32
32
  *
33
- * @param db - Database 이름
33
+ * @param db - Database name
34
34
  * @returns new ViewBuilder instance
35
35
  *
36
36
  * @example
@@ -44,9 +44,9 @@ class ViewBuilder {
44
44
  /**
45
45
  * schema set name
46
46
  *
47
- * MSSQL, PostgreSQLused in
47
+ * Used in MSSQL, PostgreSQL
48
48
  *
49
- * @param schema - Schema 이름 (MSSQL: dbo, PostgreSQL: public)
49
+ * @param schema - Schema name (MSSQL: dbo, PostgreSQL: public)
50
50
  * @returns new ViewBuilder instance
51
51
  */
52
52
  schema(schema) {
@@ -55,11 +55,11 @@ class ViewBuilder {
55
55
  /**
56
56
  * View Query definition
57
57
  *
58
- * SELECT query를 통해 View data 소스 definition
58
+ * Define the View's data source through a SELECT query
59
59
  *
60
60
  * @template TViewData - View data type
61
61
  * @template TDb - DbContext type
62
- * @param viewFn - DbContext 받아 Queryable을 반환하는 function
62
+ * @param viewFn - Function that receives a DbContext and returns a Queryable
63
63
  * @returns new ViewBuilder instance
64
64
  *
65
65
  * @example
@@ -81,12 +81,12 @@ class ViewBuilder {
81
81
  return new ViewBuilder({ ...this.meta, viewFn });
82
82
  }
83
83
  /**
84
- * relationship definition
84
+ * Relation definition
85
85
  *
86
- * 다른 Table/View와의 relationship 설정
86
+ * Set up relations with other Tables/Views
87
87
  *
88
- * @template T - relationship definition type
89
- * @param fn - relationship factory 받아 relationship 정의를 반환하는 function
88
+ * @template T - Relation definition type
89
+ * @param fn - Function that receives a relation factory and returns relation definitions
90
90
  * @returns new ViewBuilder instance
91
91
  *
92
92
  * @example
@@ -99,7 +99,7 @@ class ViewBuilder {
99
99
  * ```
100
100
  *
101
101
  * @see {@link ForeignKeyBuilder} FK builder
102
- * @see {@link ForeignKeyTargetBuilder} FK 역참조 builder
102
+ * @see {@link ForeignKeyTargetBuilder} FK reverse-reference builder
103
103
  */
104
104
  relations(fn) {
105
105
  return new ViewBuilder({
@@ -2,7 +2,7 @@ import type { ColumnPrimitive, ColumnPrimitiveStr } from "./column";
2
2
  import type { QueryDef } from "./query-def";
3
3
  import type { DbContextBase, DbContextDdlMethods } from "./db-context-def";
4
4
  /**
5
- * 지원하는 Database 방언
5
+ * Supported Database dialects
6
6
  *
7
7
  * - `mysql`: MySQL 8.0.14+
8
8
  * - `mssql`: Microsoft SQL Server 2012+
@@ -10,9 +10,9 @@ import type { DbContextBase, DbContextDdlMethods } from "./db-context-def";
10
10
  */
11
11
  export type Dialect = "mysql" | "mssql" | "postgresql";
12
12
  /**
13
- * 지원하는 모든 Database 방언 목록
13
+ * List of all supported Database dialects
14
14
  *
15
- * testing에서 dialect Validation 사용
15
+ * Used for per-dialect validation in testing
16
16
  *
17
17
  * @example
18
18
  * ```typescript
@@ -26,14 +26,14 @@ export declare const dialects: Dialect[];
26
26
  /**
27
27
  * QueryBuilder.build() return type
28
28
  *
29
- * 빌드된 SQL 문자열과 다중 결과셋 processing를 위한 Metadata
29
+ * Built SQL string and metadata for multiple result set processing
30
30
  *
31
- * @property sql - 빌드된 SQL 문자열
32
- * @property resultSetIndex - Result 가져올 결과셋 Index (Basic: 0)
33
- * - MySQL INSERT with OUTPUT: 1 (INSERT + SELECT 중 SELECT)
34
- * @property resultSetStride - 다중 결과에서 N번째마다 결과셋 추출
35
- * - 예: index=1, stride=2 1, 3, 5, 7... 의 결과셋 return
36
- * - MySQL 다중 INSERT: INSERT;SELECT; × N 1, 3, 5...
31
+ * @property sql - Built SQL string
32
+ * @property resultSetIndex - Result set index to fetch results from (default: 0)
33
+ * - MySQL INSERT with OUTPUT: 1 (SELECT from INSERT + SELECT)
34
+ * @property resultSetStride - Extract every Nth result set from multiple results
35
+ * - Example: index=1, stride=2 -> returns result sets 1, 3, 5, 7...
36
+ * - MySQL multiple INSERT: INSERT;SELECT; x N -> 1, 3, 5...
37
37
  */
38
38
  export interface QueryBuildResult {
39
39
  sql: string;
@@ -43,23 +43,23 @@ export interface QueryBuildResult {
43
43
  /**
44
44
  * Transaction isolation level
45
45
  *
46
- * - `READ_UNCOMMITTED`: commit되지 않은 data read 가능 (Dirty Read)
47
- * - `READ_COMMITTED`: commit된 data read (default)
48
- * - `REPEATABLE_READ`: Transaction 동일 query 동일 result 보장
49
- * - `SERIALIZABLE`: 완전 serialize (가장 엄격)
46
+ * - `READ_UNCOMMITTED`: Can read uncommitted data (Dirty Read)
47
+ * - `READ_COMMITTED`: Read only committed data (default)
48
+ * - `REPEATABLE_READ`: Guarantees same query returns same result within transaction
49
+ * - `SERIALIZABLE`: Full serialization (most strict)
50
50
  */
51
51
  export type IsolationLevel = "READ_UNCOMMITTED" | "READ_COMMITTED" | "REPEATABLE_READ" | "SERIALIZABLE";
52
52
  /**
53
53
  * Query result data record type
54
54
  *
55
- * 재귀적 structure로 중첩 관계(include) result 표현
55
+ * Represents nested relation (include) results with recursive structure
56
56
  *
57
57
  * @example
58
58
  * ```typescript
59
- * // 단순 레코드
59
+ * // Simple record
60
60
  * type User = { id: number; name: string; }
61
61
  *
62
- * // 중첩 relationship include
62
+ * // Nested relation include
63
63
  * type UserWithPosts = {
64
64
  * id: number;
65
65
  * name: string;
@@ -72,14 +72,14 @@ export type DataRecord = {
72
72
  [key: string]: ColumnPrimitive | DataRecord | DataRecord[];
73
73
  };
74
74
  /**
75
- * DbContext 실행기 interface
75
+ * DbContext executor interface
76
76
  *
77
- * 실제 DB 연결과 Execute query 담당
78
- * NodeDbContextExecutor (서버) 또는 SdOrmServiceClientDbContextExecutor (클라이언트) 구현
77
+ * Responsible for actual DB connection and query execution
78
+ * Implemented by NodeDbContextExecutor (server) or SdOrmServiceClientDbContextExecutor (client)
79
79
  *
80
80
  * @example
81
81
  * ```typescript
82
- * // 서버 구현 예시
82
+ * // Server-side implementation example
83
83
  * class NodeDbContextExecutor implements IDbContextExecutor {
84
84
  * async connect(): Promise<void> {
85
85
  * await this.connection.connect();
@@ -88,48 +88,48 @@ export type DataRecord = {
88
88
  * }
89
89
  * ```
90
90
  *
91
- * @see {@link DbContext} DbContextused in
91
+ * @see {@link DbContext} Used in DbContext
92
92
  */
93
93
  export interface DbContextExecutor {
94
94
  /**
95
- * DB 연결 수립
95
+ * Establish DB connection
96
96
  */
97
97
  connect(): Promise<void>;
98
98
  /**
99
- * DB 연결 end
99
+ * Close DB connection
100
100
  */
101
101
  close(): Promise<void>;
102
102
  /**
103
- * Transaction start
103
+ * Begin transaction
104
104
  *
105
- * @param isolationLevel - isolation level (Select)
105
+ * @param isolationLevel - Isolation level (optional)
106
106
  */
107
107
  beginTransaction(isolationLevel?: IsolationLevel): Promise<void>;
108
108
  /**
109
- * Transaction commit
109
+ * Commit transaction
110
110
  */
111
111
  commitTransaction(): Promise<void>;
112
112
  /**
113
- * Transaction rollback
113
+ * Rollback transaction
114
114
  */
115
115
  rollbackTransaction(): Promise<void>;
116
116
  /**
117
- * QueryDef array 실행
117
+ * Execute QueryDef array
118
118
  *
119
119
  * @template T - Result record type
120
- * @param defs - Execute할 QueryDef array
121
- * @param resultMetas - Result Transform을 위한 Metadata (Select)
122
- * @returns QueryDef별 result 배열의 array
120
+ * @param defs - QueryDef array to execute
121
+ * @param resultMetas - Metadata for result transformation (optional)
122
+ * @returns Array of result arrays per QueryDef
123
123
  */
124
124
  executeDefs<T = DataRecord>(defs: QueryDef[], resultMetas?: (ResultMeta | undefined)[]): Promise<T[][]>;
125
125
  }
126
126
  /**
127
- * Query result Transform을 위한 Metadata
127
+ * Metadata for query result transformation
128
128
  *
129
- * SELECT 결과를 TypeScript 객체로 Transform 사용
129
+ * Used when transforming SELECT results into TypeScript objects
130
130
  *
131
- * @property columns - Column ColumnPrimitiveStr Mapping
132
- * @property joins - JOIN 별칭 단일/array 여부
131
+ * @property columns - Column name -> ColumnPrimitiveStr mapping
132
+ * @property joins - JOIN alias -> single/array indicator
133
133
  */
134
134
  export interface ResultMeta {
135
135
  columns: Record<string, ColumnPrimitiveStr>;
@@ -140,10 +140,10 @@ export interface ResultMeta {
140
140
  /**
141
141
  * Database migration definition
142
142
  *
143
- * schema 변경을 version control
143
+ * Version-control schema changes
144
144
  *
145
- * @property name - Migration 고유 이름 (타임스탬프 권장)
146
- * @property up - Migration 실행 function
145
+ * @property name - Unique Migration name (timestamp recommended)
146
+ * @property up - Migration execution function
147
147
  *
148
148
  * @example
149
149
  * ```typescript
@@ -166,7 +166,7 @@ export interface ResultMeta {
166
166
  * ];
167
167
  * ```
168
168
  *
169
- * @see {@link DbContext.initialize} migration 실행
169
+ * @see {@link DbContext.initialize} migration execution
170
170
  */
171
171
  export interface Migration {
172
172
  name: string;