ts-prorm-orm 1.2.3 → 2.1.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 (204) hide show
  1. package/CHANGELOG.md +331 -1
  2. package/README.md +32 -24
  3. package/dist/compliance/data-classifier.d.ts +6 -0
  4. package/dist/compliance/data-classifier.js +6 -0
  5. package/dist/compliance/data-lineage.d.ts +4 -0
  6. package/dist/compliance/data-lineage.js +4 -0
  7. package/dist/compliance/data-masker.d.ts +4 -0
  8. package/dist/compliance/data-masker.js +4 -0
  9. package/dist/compliance/index.d.ts +4 -0
  10. package/dist/compliance/index.js +15 -1
  11. package/dist/compliance/pseudonymization.d.ts +4 -0
  12. package/dist/compliance/pseudonymization.js +4 -0
  13. package/dist/compliance/query-firewall.d.ts +9 -9
  14. package/dist/compliance/query-firewall.js +9 -9
  15. package/dist/compliance/rate-limiter.d.ts +4 -0
  16. package/dist/compliance/rate-limiter.js +4 -0
  17. package/dist/compliance/row-level-security.d.ts +2 -0
  18. package/dist/compliance/row-level-security.js +2 -0
  19. package/dist/compliance/security-decorator.d.ts +8 -0
  20. package/dist/compliance/security-decorator.js +8 -0
  21. package/dist/compliance/session-isolation.d.ts +4 -0
  22. package/dist/compliance/session-isolation.js +4 -0
  23. package/dist/compliance/worm-storage.d.ts +4 -0
  24. package/dist/compliance/worm-storage.js +4 -0
  25. package/dist/connection-manager.js +13 -1
  26. package/dist/core/expressions.d.ts +58 -0
  27. package/dist/core/expressions.js +83 -0
  28. package/dist/core/hooks-manager.d.ts +179 -0
  29. package/dist/core/hooks-manager.js +291 -0
  30. package/dist/core/types.d.ts +235 -0
  31. package/dist/core/types.js +9 -0
  32. package/dist/decorators/audit.d.ts +3 -1
  33. package/dist/decorators/audit.js +3 -1
  34. package/dist/decorators/check.d.ts +15 -15
  35. package/dist/decorators/check.js +15 -15
  36. package/dist/decorators/collate.d.ts +16 -0
  37. package/dist/decorators/collate.js +16 -0
  38. package/dist/decorators/comment.d.ts +3 -1
  39. package/dist/decorators/comment.js +3 -1
  40. package/dist/decorators/database-settings.d.ts +6 -0
  41. package/dist/decorators/database-settings.js +6 -0
  42. package/dist/decorators/default.d.ts +2 -0
  43. package/dist/decorators/default.js +2 -0
  44. package/dist/decorators/encryption.d.ts +7 -1
  45. package/dist/decorators/encryption.js +7 -1
  46. package/dist/decorators/engine.d.ts +4 -0
  47. package/dist/decorators/engine.js +4 -0
  48. package/dist/decorators/fk-constraints.d.ts +32 -32
  49. package/dist/decorators/fk-constraints.js +32 -32
  50. package/dist/decorators/foreign-table.d.ts +1 -1
  51. package/dist/decorators/generated.d.ts +8 -0
  52. package/dist/decorators/generated.js +8 -0
  53. package/dist/decorators/hstore.d.ts +6 -0
  54. package/dist/decorators/hstore.js +6 -0
  55. package/dist/decorators/index.d.ts +2 -0
  56. package/dist/decorators/index.js +11 -1
  57. package/dist/decorators/json-column.d.ts +2 -0
  58. package/dist/decorators/json-column.js +2 -0
  59. package/dist/decorators/jsonb.d.ts +6 -0
  60. package/dist/decorators/jsonb.js +6 -0
  61. package/dist/decorators/permissions.d.ts +12 -0
  62. package/dist/decorators/permissions.js +12 -0
  63. package/dist/decorators/procedure.d.ts +4 -2
  64. package/dist/decorators/procedure.js +4 -2
  65. package/dist/decorators/query-options.d.ts +24 -0
  66. package/dist/decorators/query-options.js +24 -0
  67. package/dist/decorators/range.d.ts +8 -0
  68. package/dist/decorators/range.js +8 -0
  69. package/dist/decorators/set-column.d.ts +2 -0
  70. package/dist/decorators/set-column.js +2 -0
  71. package/dist/decorators/spatial.d.ts +2 -0
  72. package/dist/decorators/spatial.js +2 -0
  73. package/dist/decorators/storage.d.ts +24 -0
  74. package/dist/decorators/storage.js +24 -0
  75. package/dist/decorators/timezone.d.ts +7 -7
  76. package/dist/decorators/timezone.js +7 -7
  77. package/dist/decorators/trigger.d.ts +3 -1
  78. package/dist/decorators/trigger.js +3 -1
  79. package/dist/decorators/uuid.d.ts +6 -0
  80. package/dist/decorators/uuid.js +6 -0
  81. package/dist/decorators/view.d.ts +7 -1
  82. package/dist/decorators/view.js +7 -1
  83. package/dist/diagrams/chen-diagram.d.ts +15 -12
  84. package/dist/diagrams/chen-diagram.js +76 -85
  85. package/dist/diagrams/class-diagram.d.ts +9 -8
  86. package/dist/diagrams/class-diagram.js +60 -82
  87. package/dist/diagrams/core/index.d.ts +13 -0
  88. package/dist/diagrams/core/index.js +33 -0
  89. package/dist/diagrams/core/layout.d.ts +104 -0
  90. package/dist/diagrams/core/layout.js +223 -0
  91. package/dist/diagrams/{svg-dom.d.ts → core/svg.d.ts} +8 -20
  92. package/dist/diagrams/{svg-dom.js → core/svg.js} +21 -29
  93. package/dist/diagrams/core/theme.d.ts +84 -0
  94. package/dist/diagrams/core/theme.js +62 -0
  95. package/dist/diagrams/dependency-diagram.d.ts +15 -14
  96. package/dist/diagrams/dependency-diagram.js +71 -105
  97. package/dist/diagrams/er-diagram.d.ts +13 -26
  98. package/dist/diagrams/er-diagram.js +180 -259
  99. package/dist/diagrams/flow-diagram.d.ts +16 -11
  100. package/dist/diagrams/flow-diagram.js +96 -91
  101. package/dist/diagrams/gantt-diagram.d.ts +10 -5
  102. package/dist/diagrams/gantt-diagram.js +77 -103
  103. package/dist/diagrams/index-diagram.d.ts +10 -10
  104. package/dist/diagrams/index-diagram.js +106 -116
  105. package/dist/diagrams/index.d.ts +6 -9
  106. package/dist/diagrams/index.js +9 -24
  107. package/dist/diagrams/migration-diagram.d.ts +8 -4
  108. package/dist/diagrams/migration-diagram.js +189 -161
  109. package/dist/diagrams/model-diagram.d.ts +34 -34
  110. package/dist/diagrams/model-diagram.js +106 -485
  111. package/dist/diagrams/package-diagram.d.ts +9 -6
  112. package/dist/diagrams/package-diagram.js +64 -101
  113. package/dist/diagrams/relational-diagram.d.ts +12 -10
  114. package/dist/diagrams/relational-diagram.js +87 -114
  115. package/dist/diagrams/schemadoc-diagram.d.ts +8 -8
  116. package/dist/diagrams/schemadoc-diagram.js +71 -93
  117. package/dist/diagrams/sequence-diagram.d.ts +10 -10
  118. package/dist/diagrams/sequence-diagram.js +64 -89
  119. package/dist/diagrams/state-diagram.d.ts +10 -9
  120. package/dist/diagrams/state-diagram.js +69 -92
  121. package/dist/diagrams/tree-diagram.d.ts +11 -5
  122. package/dist/diagrams/tree-diagram.js +41 -65
  123. package/dist/dialects/clickhouse/index.js +15 -0
  124. package/dist/dialects/cockroachdb/index.d.ts +1 -1
  125. package/dist/dialects/cockroachdb/index.js +32 -63
  126. package/dist/dialects/db2/index.js +23 -8
  127. package/dist/dialects/dialect.d.ts +141 -5
  128. package/dist/dialects/duckdb/index.js +9 -2
  129. package/dist/dialects/hana/index.js +22 -5
  130. package/dist/dialects/lock-clause-helper.d.ts +167 -0
  131. package/dist/dialects/lock-clause-helper.js +316 -0
  132. package/dist/dialects/mariadb/index.d.ts +7 -4
  133. package/dist/dialects/mariadb/index.js +36 -60
  134. package/dist/dialects/mssql/index.js +34 -3
  135. package/dist/dialects/mysql/index.d.ts +1 -1
  136. package/dist/dialects/mysql/index.js +17 -45
  137. package/dist/dialects/oracle/index.d.ts +14 -3
  138. package/dist/dialects/oracle/index.js +66 -36
  139. package/dist/dialects/order-expression-helper.d.ts +72 -0
  140. package/dist/dialects/order-expression-helper.js +154 -0
  141. package/dist/dialects/partial-index.d.ts +52 -0
  142. package/dist/dialects/partial-index.js +251 -0
  143. package/dist/dialects/postgres/index.d.ts +1 -1
  144. package/dist/dialects/postgres/index.js +43 -68
  145. package/dist/dialects/redshift/index.js +9 -2
  146. package/dist/dialects/snowflake/index.js +17 -0
  147. package/dist/dialects/spanner/index.js +7 -2
  148. package/dist/dialects/sqlite/driver.d.ts +55 -0
  149. package/dist/dialects/sqlite/driver.js +102 -0
  150. package/dist/dialects/sqlite/index.d.ts +1 -1
  151. package/dist/dialects/sqlite/index.js +49 -27
  152. package/dist/external-fields/decorator.d.ts +2 -0
  153. package/dist/external-fields/decorator.js +2 -0
  154. package/dist/graph/base-graph-dialect.d.ts +24 -3
  155. package/dist/graph/base-graph-dialect.js +43 -2
  156. package/dist/graph/dgraph/index.js +6 -0
  157. package/dist/graph/gremlin/index.d.ts +6 -0
  158. package/dist/graph/gremlin/index.js +12 -1
  159. package/dist/graph/index.d.ts +1 -1
  160. package/dist/graph/neo4j/index.d.ts +2 -0
  161. package/dist/graph/neo4j/index.js +6 -1
  162. package/dist/graph/types.d.ts +12 -1
  163. package/dist/index.d.ts +12 -3
  164. package/dist/index.js +53 -7
  165. package/dist/logging/index.d.ts +10 -0
  166. package/dist/logging/index.js +23 -0
  167. package/dist/logging/query-logging.d.ts +82 -0
  168. package/dist/logging/query-logging.js +102 -0
  169. package/dist/models/associations.d.ts +38 -0
  170. package/dist/models/associations.js +16 -0
  171. package/dist/models/decorators.d.ts +55 -19
  172. package/dist/models/decorators.js +95 -19
  173. package/dist/models/eager-load.d.ts +99 -0
  174. package/dist/models/eager-load.js +348 -5
  175. package/dist/models/indexes.d.ts +3 -2
  176. package/dist/models/indexes.js +7 -1
  177. package/dist/models/model.js +69 -43
  178. package/dist/prorm.d.ts +175 -409
  179. package/dist/prorm.js +1132 -553
  180. package/dist/query-builders/order-limit-builder.js +12 -10
  181. package/dist/query-builders/sql-compiler.d.ts +10 -3
  182. package/dist/query-builders/sql-compiler.js +14 -43
  183. package/dist/query-interface.d.ts +2 -1
  184. package/dist/schema-objects.d.ts +42 -0
  185. package/dist/schema-objects.js +28 -0
  186. package/dist/sql-constants.d.ts +44 -0
  187. package/dist/sql-constants.js +138 -1
  188. package/dist/types/index.d.ts +387 -17
  189. package/dist/types/index.js +10 -15
  190. package/dist/types/query-types.d.ts +26 -0
  191. package/dist/types/query-types.js +30 -0
  192. package/package.json +39 -8
  193. package/dist/decorators/belongs-to-many.js +0 -115
  194. package/dist/decorators/belongs-to.js +0 -115
  195. package/dist/decorators/has-many.js +0 -127
  196. package/dist/decorators/has-one.js +0 -116
  197. package/dist/diagrams/palette.d.ts +0 -138
  198. package/dist/diagrams/palette.js +0 -194
  199. package/dist/hooks/hooks-manager.d.ts +0 -189
  200. package/dist/hooks/hooks-manager.js +0 -350
  201. package/dist/hooks/index.d.ts +0 -8
  202. package/dist/hooks/index.js +0 -37
  203. /package/dist/{logging.d.ts → logging/logger.d.ts} +0 -0
  204. /package/dist/{logging.js → logging/logger.js} +0 -0
@@ -14,6 +14,7 @@
14
14
  *
15
15
  * Usage:
16
16
  *
17
+ * ```ts
17
18
  * // Index hints
18
19
  * @UseIndex('idx_name')
19
20
  * @ForceIndex('idx_name')
@@ -40,6 +41,7 @@
40
41
  * // TABLESAMPLE
41
42
  * @Tablesample({ method: 'BERNOULLI', percentage: 50 })
42
43
  * async *getSampleUsers() { ... }
44
+ * ```
43
45
  */
44
46
  Object.defineProperty(exports, "__esModule", { value: true });
45
47
  exports.DistinctOn = void 0;
@@ -88,9 +90,11 @@ const DISTINCT_KEY = Symbol('prorm:distinct');
88
90
  *
89
91
  * Usage:
90
92
  *
93
+ * ```ts
91
94
  * @UseIndex('idx_user_email')
92
95
  * @UseIndex(['idx_user_email', 'idx_user_status'])
93
96
  * class User extends Model {}
97
+ * ```
94
98
  *
95
99
  * @param index - Index name or array of index names
96
100
  */
@@ -108,8 +112,10 @@ function UseIndex(index) {
108
112
  *
109
113
  * Usage:
110
114
  *
115
+ * ```ts
111
116
  * @ForceIndex('idx_user_email')
112
117
  * class User extends Model {}
118
+ * ```
113
119
  *
114
120
  * @param index - Index name
115
121
  */
@@ -127,8 +133,10 @@ function ForceIndex(index) {
127
133
  *
128
134
  * Usage:
129
135
  *
136
+ * ```ts
130
137
  * @IgnoreIndex('idx_user_email')
131
138
  * class User extends Model {}
139
+ * ```
132
140
  *
133
141
  * @param index - Index name
134
142
  */
@@ -146,11 +154,13 @@ function IgnoreIndex(index) {
146
154
  *
147
155
  * Usage:
148
156
  *
157
+ * ```ts
149
158
  * @Tablesample({ method: 'BERNOULLI', percentage: 50 })
150
159
  * class User extends Model {}
151
160
  *
152
161
  * @Tablesample({ method: 'SYSTEM', pages: 100 })
153
162
  * class User extends Model {}
163
+ * ```
154
164
  *
155
165
  * @param options - Tablesample options
156
166
  */
@@ -164,11 +174,13 @@ function Tablesample(options) {
164
174
  *
165
175
  * Usage:
166
176
  *
177
+ * ```ts
167
178
  * @Distinct
168
179
  * class User extends Model {}
169
180
  *
170
181
  * @DistinctOn(['email'])
171
182
  * class User extends Model {}
183
+ * ```
172
184
  *
173
185
  * @param columns - Columns for DISTINCT ON (optional)
174
186
  */
@@ -193,11 +205,13 @@ exports.DistinctOn = Distinct;
193
205
  *
194
206
  * Usage:
195
207
  *
208
+ * ```ts
196
209
  * @WithLock({ mode: 'UPDATE', timeout: 5000, skipLocked: true })
197
210
  * async processOrder(id: number) {
198
211
  * const order = await Order.findByPk(id, { lock: 'UPDATE' });
199
212
  * // process order
200
213
  * }
214
+ * ```
201
215
  *
202
216
  * @param options - Lock options
203
217
  */
@@ -226,10 +240,12 @@ function WithLock(options = {}) {
226
240
  *
227
241
  * Usage:
228
242
  *
243
+ * ```ts
229
244
  * @StatementTimeout(30000) // 30 seconds
230
245
  * async runLongQuery() {
231
246
  * return await this.query('SELECT * FROM large_table');
232
247
  * }
248
+ * ```
233
249
  *
234
250
  * @param timeout - Timeout in milliseconds
235
251
  */
@@ -252,10 +268,12 @@ function StatementTimeout(timeout) {
252
268
  *
253
269
  * Usage:
254
270
  *
271
+ * ```ts
255
272
  * @IdleInTransactionTimeout(60000) // 1 minute
256
273
  * async runTransaction() {
257
274
  * // long running transaction
258
275
  * }
276
+ * ```
259
277
  *
260
278
  * @param timeout - Timeout in milliseconds
261
279
  */
@@ -271,12 +289,14 @@ function IdleInTransactionTimeout(timeout) {
271
289
  *
272
290
  * Usage:
273
291
  *
292
+ * ```ts
274
293
  * @Cursor({ holdable: true })
275
294
  * async *getAllUsers() {
276
295
  * for await (const user of this.findAll({ cursor: true })) {
277
296
  * yield user;
278
297
  * }
279
298
  * }
299
+ * ```
280
300
  *
281
301
  * @param options - Cursor options
282
302
  */
@@ -297,10 +317,12 @@ function Cursor(options = {}) {
297
317
  *
298
318
  * Usage:
299
319
  *
320
+ * ```ts
300
321
  * @Fetch(100)
301
322
  * async *getTopUsers() {
302
323
  * return await User.findAll({ limit: 100 });
303
324
  * }
325
+ * ```
304
326
  *
305
327
  * @param limit - Number of rows to fetch
306
328
  */
@@ -316,10 +338,12 @@ function Fetch(limit) {
316
338
  *
317
339
  * Usage:
318
340
  *
341
+ * ```ts
319
342
  * @Fetch({ first: 100, offset: 50 })
320
343
  * async *getPageUsers() {
321
344
  * return await User.findAll({ offset: 50, limit: 100 });
322
345
  * }
346
+ * ```
323
347
  *
324
348
  * @param options - Fetch options with limit and optional offset
325
349
  */
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * Usage:
8
8
  *
9
+ * ```ts
9
10
  * // Timestamp range
10
11
  * @Range('tsrange')
11
12
  * duration: [Date, Date];
@@ -17,6 +18,7 @@
17
18
  * // Date range
18
19
  * @Range('daterange')
19
20
  * dates: [string, string];
21
+ * ```
20
22
  */
21
23
  import type { RangeSubtype } from '../types';
22
24
  /**
@@ -52,20 +54,26 @@ export interface RangeMetadata {
52
54
  * @example
53
55
  * // Timestamp range
54
56
  * class Reservation extends Model {
57
+ * ```ts
55
58
  * @Range({ subtype: 'tsrange' })
56
59
  * during: [Date, Date];
60
+ * ```
57
61
  * }
58
62
  *
59
63
  * // Date range
60
64
  * class Event extends Model {
65
+ * ```ts
61
66
  * @Range({ subtype: 'daterange' })
62
67
  * dates: [string, string];
68
+ * ```
63
69
  * }
64
70
  *
65
71
  * // Integer range
66
72
  * class Inventory extends Model {
73
+ * ```ts
67
74
  * @Range({ subtype: 'int4range', allowNull: false })
68
75
  * quantity: [number, number];
76
+ * ```
69
77
  * }
70
78
  */
71
79
  export declare function Range(options: RangeDecoratorOptions): PropertyDecorator;
@@ -7,6 +7,7 @@
7
7
  *
8
8
  * Usage:
9
9
  *
10
+ * ```ts
10
11
  * // Timestamp range
11
12
  * @Range('tsrange')
12
13
  * duration: [Date, Date];
@@ -18,6 +19,7 @@
18
19
  * // Date range
19
20
  * @Range('daterange')
20
21
  * dates: [string, string];
22
+ * ```
21
23
  */
22
24
  Object.defineProperty(exports, "__esModule", { value: true });
23
25
  exports.Range = Range;
@@ -38,20 +40,26 @@ const rangeMetadataMap = new Map();
38
40
  * @example
39
41
  * // Timestamp range
40
42
  * class Reservation extends Model {
43
+ * ```ts
41
44
  * @Range({ subtype: 'tsrange' })
42
45
  * during: [Date, Date];
46
+ * ```
43
47
  * }
44
48
  *
45
49
  * // Date range
46
50
  * class Event extends Model {
51
+ * ```ts
47
52
  * @Range({ subtype: 'daterange' })
48
53
  * dates: [string, string];
54
+ * ```
49
55
  * }
50
56
  *
51
57
  * // Integer range
52
58
  * class Inventory extends Model {
59
+ * ```ts
53
60
  * @Range({ subtype: 'int4range', allowNull: false })
54
61
  * quantity: [number, number];
62
+ * ```
55
63
  * }
56
64
  */
57
65
  function Range(options) {
@@ -3,11 +3,13 @@
3
3
  *
4
4
  * @example
5
5
  * class Options extends Model {
6
+ * ```ts
6
7
  * @SetColumn(['red', 'green', 'blue'])
7
8
  * colors: DataTypes.SET;
8
9
  *
9
10
  * @SetColumn('a', 'b', 'c')
10
11
  * flags: DataTypes.SET;
12
+ * ```
11
13
  * }
12
14
  */
13
15
  import { SetColumnOptions } from '../types';
@@ -4,11 +4,13 @@
4
4
  *
5
5
  * @example
6
6
  * class Options extends Model {
7
+ * ```ts
7
8
  * @SetColumn(['red', 'green', 'blue'])
8
9
  * colors: DataTypes.SET;
9
10
  *
10
11
  * @SetColumn('a', 'b', 'c')
11
12
  * flags: DataTypes.SET;
13
+ * ```
12
14
  * }
13
15
  */
14
16
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,11 +3,13 @@
3
3
  *
4
4
  * @example
5
5
  * class Location extends Model {
6
+ * ```ts
6
7
  * @Spatial('POINT', 4326)
7
8
  * point: DataTypes.POINT;
8
9
  *
9
10
  * @Spatial('POLYGON')
10
11
  * area: DataTypes.POLYGON;
12
+ * ```
11
13
  * }
12
14
  */
13
15
  import { SpatialType } from '../types';
@@ -4,11 +4,13 @@
4
4
  *
5
5
  * @example
6
6
  * class Location extends Model {
7
+ * ```ts
7
8
  * @Spatial('POINT', 4326)
8
9
  * point: DataTypes.POINT;
9
10
  *
10
11
  * @Spatial('POLYGON')
11
12
  * area: DataTypes.POLYGON;
13
+ * ```
12
14
  * }
13
15
  */
14
16
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -14,6 +14,7 @@
14
14
  *
15
15
  * Usage:
16
16
  *
17
+ * ```ts
17
18
  * // MySQL/MariaDB storage engine
18
19
  * @Storage({ engine: 'InnoDB', rowFormat: 'DYNAMIC' })
19
20
  * class Order extends Model {}
@@ -40,6 +41,7 @@
40
41
  * // PostgreSQL replica identity
41
42
  * @ReplicaIdentity('FULL')
42
43
  * class SensitiveData extends Model {}
44
+ * ```
43
45
  */
44
46
  import 'reflect-metadata';
45
47
  /**
@@ -270,11 +272,13 @@ export interface ColumnStorageOptions {
270
272
  *
271
273
  * Usage:
272
274
  *
275
+ * ```ts
273
276
  * @Storage({ engine: 'InnoDB', rowFormat: 'DYNAMIC' })
274
277
  * class Order extends Model {}
275
278
  *
276
279
  * @Storage({ engine: 'MyISAM', rowFormat: 'FIXED' })
277
280
  * class LogData extends Model {}
281
+ * ```
278
282
  *
279
283
  * @param options - Storage configuration options
280
284
  */
@@ -284,9 +288,11 @@ export declare function Storage(options?: StorageOptions): ClassDecorator;
284
288
  *
285
289
  * Usage:
286
290
  *
291
+ * ```ts
287
292
  * @Tablespace('fast_storage')
288
293
  * @Table
289
294
  * class LargeTable extends Model {}
295
+ * ```
290
296
  *
291
297
  * @param name - Tablespace name
292
298
  */
@@ -296,9 +302,11 @@ export declare function Tablespace(name: string): ClassDecorator;
296
302
  *
297
303
  * Usage:
298
304
  *
305
+ * ```ts
299
306
  * @Tablespace({ name: 'fast_storage', indexTablespace: 'idx_space' })
300
307
  * @Table
301
308
  * class LargeTable extends Model {}
309
+ * ```
302
310
  *
303
311
  * @param options - Tablespace options
304
312
  */
@@ -308,6 +316,7 @@ export declare function TablespaceOptions(options: TablespaceOptions): ClassDeco
308
316
  *
309
317
  * Usage:
310
318
  *
319
+ * ```ts
311
320
  * @Clustered(true)
312
321
  * @Index({ columns: ['id'] })
313
322
  * class Data extends Model {}
@@ -315,6 +324,7 @@ export declare function TablespaceOptions(options: TablespaceOptions): ClassDeco
315
324
  * @Clustered({ type: 'nonclustered', include: ['name', 'email'] })
316
325
  * @Index({ columns: ['id'] })
317
326
  * class UserData extends Model {}
327
+ * ```
318
328
  *
319
329
  * @param options - Cluster options
320
330
  */
@@ -324,9 +334,11 @@ export declare function Clustered(options?: boolean | ClusteredOptions): ClassDe
324
334
  *
325
335
  * Usage:
326
336
  *
337
+ * ```ts
327
338
  * @Compression({ algorithm: 'lz4', level: 6 })
328
339
  * @Table
329
340
  * class LargeTable extends Model {}
341
+ * ```
330
342
  *
331
343
  * @param options - Compression options
332
344
  */
@@ -336,11 +348,13 @@ export declare function Compression(options?: CompressionOptions): ClassDecorato
336
348
  *
337
349
  * Usage:
338
350
  *
351
+ * ```ts
339
352
  * @ReplicaIdentity('FULL')
340
353
  * class SensitiveData extends Model {}
341
354
  *
342
355
  * @ReplicaIdentity({ type: 'INDEX', index: 'idx_user_email' })
343
356
  * class UserData extends Model {}
357
+ * ```
344
358
  *
345
359
  * @param options - Replica identity type or options
346
360
  */
@@ -350,9 +364,11 @@ export declare function ReplicaIdentity(options: string | ReplicaIdentityOptions
350
364
  *
351
365
  * Usage:
352
366
  *
367
+ * ```ts
353
368
  * @Statistics({ for: 'columns', target: 500 })
354
369
  * @Table
355
370
  * class UserData extends Model {}
371
+ * ```
356
372
  *
357
373
  * @param options - Statistics options
358
374
  */
@@ -362,9 +378,11 @@ export declare function Statistics(options?: StatisticsOptions): ClassDecorator;
362
378
  *
363
379
  * Usage:
364
380
  *
381
+ * ```ts
365
382
  * @OnCommit('PRESERVE ROWS')
366
383
  * @Table({ temporary: true })
367
384
  * class TempData extends Model {}
385
+ * ```
368
386
  *
369
387
  * @param option - ON COMMIT option
370
388
  */
@@ -374,11 +392,13 @@ export declare function OnCommit(option: OnCommitOption): ClassDecorator;
374
392
  *
375
393
  * Usage:
376
394
  *
395
+ * ```ts
377
396
  * @Inherits('parent_table')
378
397
  * class ChildTable extends Model {}
379
398
  *
380
399
  * @Inherits({ parentTable: 'parent', only: true })
381
400
  * class ChildOnlyTable extends Model {}
401
+ * ```
382
402
  *
383
403
  * @param options - Inheritance options (table name string or options object)
384
404
  */
@@ -388,6 +408,7 @@ export declare function Inherits(options: string | InheritsOptions): ClassDecora
388
408
  *
389
409
  * Usage:
390
410
  *
411
+ * ```ts
391
412
  * // Range partition by date
392
413
  * @Partition({ type: 'range', column: 'order_date' })
393
414
  * @Table
@@ -402,6 +423,7 @@ export declare function Inherits(options: string | InheritsOptions): ClassDecora
402
423
  * @Partition({ type: 'hash', column: 'id' })
403
424
  * @Table
404
425
  * class Log extends Model {}
426
+ * ```
405
427
  *
406
428
  * @param options - Partition configuration options
407
429
  */
@@ -411,9 +433,11 @@ export declare function Partition(options: PartitionOptionsInternal): ClassDecor
411
433
  *
412
434
  * Usage:
413
435
  *
436
+ * ```ts
414
437
  * @Column(DataTypes.BLOB)
415
438
  * @ColumnStorage({ compression: 'pglz' })
416
439
  * blobData: Buffer;
440
+ * ```
417
441
  *
418
442
  * @param options - Column storage options
419
443
  */
@@ -15,6 +15,7 @@
15
15
  *
16
16
  * Usage:
17
17
  *
18
+ * ```ts
18
19
  * // MySQL/MariaDB storage engine
19
20
  * @Storage({ engine: 'InnoDB', rowFormat: 'DYNAMIC' })
20
21
  * class Order extends Model {}
@@ -41,6 +42,7 @@
41
42
  * // PostgreSQL replica identity
42
43
  * @ReplicaIdentity('FULL')
43
44
  * class SensitiveData extends Model {}
45
+ * ```
44
46
  */
45
47
  Object.defineProperty(exports, "__esModule", { value: true });
46
48
  exports.Storage = Storage;
@@ -91,11 +93,13 @@ const PARTITION_KEY = Symbol('prorm:partition');
91
93
  *
92
94
  * Usage:
93
95
  *
96
+ * ```ts
94
97
  * @Storage({ engine: 'InnoDB', rowFormat: 'DYNAMIC' })
95
98
  * class Order extends Model {}
96
99
  *
97
100
  * @Storage({ engine: 'MyISAM', rowFormat: 'FIXED' })
98
101
  * class LogData extends Model {}
102
+ * ```
99
103
  *
100
104
  * @param options - Storage configuration options
101
105
  */
@@ -119,9 +123,11 @@ function Storage(options = {}) {
119
123
  *
120
124
  * Usage:
121
125
  *
126
+ * ```ts
122
127
  * @Tablespace('fast_storage')
123
128
  * @Table
124
129
  * class LargeTable extends Model {}
130
+ * ```
125
131
  *
126
132
  * @param name - Tablespace name
127
133
  */
@@ -135,9 +141,11 @@ function Tablespace(name) {
135
141
  *
136
142
  * Usage:
137
143
  *
144
+ * ```ts
138
145
  * @Tablespace({ name: 'fast_storage', indexTablespace: 'idx_space' })
139
146
  * @Table
140
147
  * class LargeTable extends Model {}
148
+ * ```
141
149
  *
142
150
  * @param options - Tablespace options
143
151
  */
@@ -151,6 +159,7 @@ function TablespaceOptions(options) {
151
159
  *
152
160
  * Usage:
153
161
  *
162
+ * ```ts
154
163
  * @Clustered(true)
155
164
  * @Index({ columns: ['id'] })
156
165
  * class Data extends Model {}
@@ -158,6 +167,7 @@ function TablespaceOptions(options) {
158
167
  * @Clustered({ type: 'nonclustered', include: ['name', 'email'] })
159
168
  * @Index({ columns: ['id'] })
160
169
  * class UserData extends Model {}
170
+ * ```
161
171
  *
162
172
  * @param options - Cluster options
163
173
  */
@@ -172,9 +182,11 @@ function Clustered(options = true) {
172
182
  *
173
183
  * Usage:
174
184
  *
185
+ * ```ts
175
186
  * @Compression({ algorithm: 'lz4', level: 6 })
176
187
  * @Table
177
188
  * class LargeTable extends Model {}
189
+ * ```
178
190
  *
179
191
  * @param options - Compression options
180
192
  */
@@ -192,11 +204,13 @@ function Compression(options = {}) {
192
204
  *
193
205
  * Usage:
194
206
  *
207
+ * ```ts
195
208
  * @ReplicaIdentity('FULL')
196
209
  * class SensitiveData extends Model {}
197
210
  *
198
211
  * @ReplicaIdentity({ type: 'INDEX', index: 'idx_user_email' })
199
212
  * class UserData extends Model {}
213
+ * ```
200
214
  *
201
215
  * @param options - Replica identity type or options
202
216
  */
@@ -211,9 +225,11 @@ function ReplicaIdentity(options) {
211
225
  *
212
226
  * Usage:
213
227
  *
228
+ * ```ts
214
229
  * @Statistics({ for: 'columns', target: 500 })
215
230
  * @Table
216
231
  * class UserData extends Model {}
232
+ * ```
217
233
  *
218
234
  * @param options - Statistics options
219
235
  */
@@ -231,9 +247,11 @@ function Statistics(options = {}) {
231
247
  *
232
248
  * Usage:
233
249
  *
250
+ * ```ts
234
251
  * @OnCommit('PRESERVE ROWS')
235
252
  * @Table({ temporary: true })
236
253
  * class TempData extends Model {}
254
+ * ```
237
255
  *
238
256
  * @param option - ON COMMIT option
239
257
  */
@@ -247,11 +265,13 @@ function OnCommit(option) {
247
265
  *
248
266
  * Usage:
249
267
  *
268
+ * ```ts
250
269
  * @Inherits('parent_table')
251
270
  * class ChildTable extends Model {}
252
271
  *
253
272
  * @Inherits({ parentTable: 'parent', only: true })
254
273
  * class ChildOnlyTable extends Model {}
274
+ * ```
255
275
  *
256
276
  * @param options - Inheritance options (table name string or options object)
257
277
  */
@@ -266,6 +286,7 @@ function Inherits(options) {
266
286
  *
267
287
  * Usage:
268
288
  *
289
+ * ```ts
269
290
  * // Range partition by date
270
291
  * @Partition({ type: 'range', column: 'order_date' })
271
292
  * @Table
@@ -280,6 +301,7 @@ function Inherits(options) {
280
301
  * @Partition({ type: 'hash', column: 'id' })
281
302
  * @Table
282
303
  * class Log extends Model {}
304
+ * ```
283
305
  *
284
306
  * @param options - Partition configuration options
285
307
  */
@@ -294,9 +316,11 @@ function Partition(options) {
294
316
  *
295
317
  * Usage:
296
318
  *
319
+ * ```ts
297
320
  * @Column(DataTypes.BLOB)
298
321
  * @ColumnStorage({ compression: 'pglz' })
299
322
  * blobData: Buffer;
323
+ * ```
300
324
  *
301
325
  * @param options - Column storage options
302
326
  */
@@ -7,21 +7,21 @@
7
7
  * Usage:
8
8
  *
9
9
  * // Column-level timezone
10
- * @Timezone('UTC') // Store as UTC, convert on read/write
10
+ * `@Timezone`('UTC') // Store as UTC, convert on read/write
11
11
  * createdAt: Date;
12
12
  *
13
- * @Timezone('America/New_York') // Eastern time
13
+ * `@Timezone`('America/New_York') // Eastern time
14
14
  * orderPlacedAt: Date;
15
15
  *
16
- * @Timezone('Europe/London') // British time
16
+ * `@Timezone`('Europe/London') // British time
17
17
  * updatedAt: Date;
18
18
  *
19
19
  * // Auto-detect from user context
20
- * @Timezone({ from: 'user' })
20
+ * `@Timezone`({ from: 'user' })
21
21
  * lastLoginAt: Date;
22
22
  *
23
23
  * // With format options
24
- * @Timezone({
24
+ * `@Timezone`({
25
25
  * zone: 'UTC',
26
26
  * format: 'ISO', // 'ISO', 'DATE', 'DATETIME', 'TIMESTAMP'
27
27
  * storeAs: 'utc' // 'utc', 'local', 'string'
@@ -29,11 +29,11 @@
29
29
  * timestamp: Date;
30
30
  *
31
31
  * // Table-level default timezone
32
- * @Table({ timezone: 'America/Los_Angeles' })
32
+ * `@Table`({ timezone: 'America/Los_Angeles' })
33
33
  * class WestCoastOrder extends Model {}
34
34
  *
35
35
  * // Database-level timezone setting
36
- * @DatabaseSetting('timezone', 'UTC')
36
+ * `@DatabaseSetting`('timezone', 'UTC')
37
37
  */
38
38
  import 'reflect-metadata';
39
39
  /**
@@ -8,21 +8,21 @@
8
8
  * Usage:
9
9
  *
10
10
  * // Column-level timezone
11
- * @Timezone('UTC') // Store as UTC, convert on read/write
11
+ * `@Timezone`('UTC') // Store as UTC, convert on read/write
12
12
  * createdAt: Date;
13
13
  *
14
- * @Timezone('America/New_York') // Eastern time
14
+ * `@Timezone`('America/New_York') // Eastern time
15
15
  * orderPlacedAt: Date;
16
16
  *
17
- * @Timezone('Europe/London') // British time
17
+ * `@Timezone`('Europe/London') // British time
18
18
  * updatedAt: Date;
19
19
  *
20
20
  * // Auto-detect from user context
21
- * @Timezone({ from: 'user' })
21
+ * `@Timezone`({ from: 'user' })
22
22
  * lastLoginAt: Date;
23
23
  *
24
24
  * // With format options
25
- * @Timezone({
25
+ * `@Timezone`({
26
26
  * zone: 'UTC',
27
27
  * format: 'ISO', // 'ISO', 'DATE', 'DATETIME', 'TIMESTAMP'
28
28
  * storeAs: 'utc' // 'utc', 'local', 'string'
@@ -30,11 +30,11 @@
30
30
  * timestamp: Date;
31
31
  *
32
32
  * // Table-level default timezone
33
- * @Table({ timezone: 'America/Los_Angeles' })
33
+ * `@Table`({ timezone: 'America/Los_Angeles' })
34
34
  * class WestCoastOrder extends Model {}
35
35
  *
36
36
  * // Database-level timezone setting
37
- * @DatabaseSetting('timezone', 'UTC')
37
+ * `@DatabaseSetting`('timezone', 'UTC')
38
38
  */
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
40
  exports.TimezoneEnum = void 0;