litedbmodel 2.2.7 → 2.2.8

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 (120) hide show
  1. package/README.md +2 -1
  2. package/dist/Column.d.ts +13 -2
  3. package/dist/Column.d.ts.map +1 -1
  4. package/dist/Column.js +30 -10
  5. package/dist/Column.js.map +1 -1
  6. package/dist/DBModel.d.ts +15 -2
  7. package/dist/DBModel.d.ts.map +1 -1
  8. package/dist/DBModel.js +40 -25
  9. package/dist/DBModel.js.map +1 -1
  10. package/dist/TypeCast.d.ts +2 -2
  11. package/dist/TypeCast.d.ts.map +1 -1
  12. package/dist/TypeCast.js +7 -9
  13. package/dist/TypeCast.js.map +1 -1
  14. package/dist/decorators.d.ts +8 -0
  15. package/dist/decorators.d.ts.map +1 -1
  16. package/dist/decorators.js +29 -18
  17. package/dist/decorators.js.map +1 -1
  18. package/dist/drivers/MysqlHelper.d.ts +3 -3
  19. package/dist/drivers/MysqlHelper.d.ts.map +1 -1
  20. package/dist/drivers/MysqlHelper.js +3 -17
  21. package/dist/drivers/MysqlHelper.js.map +1 -1
  22. package/dist/drivers/MysqlSqlBuilder.d.ts.map +1 -1
  23. package/dist/drivers/MysqlSqlBuilder.js +2 -13
  24. package/dist/drivers/MysqlSqlBuilder.js.map +1 -1
  25. package/dist/drivers/PostgresHelper.d.ts +3 -2
  26. package/dist/drivers/PostgresHelper.d.ts.map +1 -1
  27. package/dist/drivers/PostgresHelper.js +3 -16
  28. package/dist/drivers/PostgresHelper.js.map +1 -1
  29. package/dist/drivers/PostgresSqlBuilder.d.ts.map +1 -1
  30. package/dist/drivers/PostgresSqlBuilder.js +2 -14
  31. package/dist/drivers/PostgresSqlBuilder.js.map +1 -1
  32. package/dist/drivers/SqliteHelper.d.ts +4 -2
  33. package/dist/drivers/SqliteHelper.d.ts.map +1 -1
  34. package/dist/drivers/SqliteHelper.js +4 -2
  35. package/dist/drivers/SqliteHelper.js.map +1 -1
  36. package/dist/drivers/SqliteSqlBuilder.d.ts.map +1 -1
  37. package/dist/drivers/SqliteSqlBuilder.js +2 -13
  38. package/dist/drivers/SqliteSqlBuilder.js.map +1 -1
  39. package/dist/index.cjs +666 -687
  40. package/dist/scp/decorator-adapter.d.ts +1 -0
  41. package/dist/scp/decorator-adapter.d.ts.map +1 -1
  42. package/dist/scp/decorator-adapter.js +2 -0
  43. package/dist/scp/decorator-adapter.js.map +1 -1
  44. package/dist/scp/index.cjs +63 -52
  45. package/dist/scp/index.mjs +63 -52
  46. package/docs/BENCHMARK.md +1 -1
  47. package/docs/COMPARISON.md +1 -1
  48. package/docs/api/README.md +1 -1
  49. package/docs/api/classes/Conditions.md +10 -10
  50. package/docs/api/classes/DBHandler.md +1 -1
  51. package/docs/api/classes/DBModel.md +81 -81
  52. package/docs/api/classes/LimitExceededError.md +1 -1
  53. package/docs/api/classes/Middleware.md +1 -1
  54. package/docs/api/classes/SqlRaw.md +1 -1
  55. package/docs/api/classes/SqlRef.md +1 -1
  56. package/docs/api/classes/Values.md +6 -6
  57. package/docs/api/classes/WriteInReadOnlyContextError.md +1 -1
  58. package/docs/api/classes/WriteOutsideTransactionError.md +1 -1
  59. package/docs/api/functions/belongsTo.md +2 -2
  60. package/docs/api/functions/closeAllPools.md +1 -1
  61. package/docs/api/functions/condsToRecord.md +4 -3
  62. package/docs/api/functions/createMiddleware.md +1 -1
  63. package/docs/api/functions/createPostgresDriver.md +1 -1
  64. package/docs/api/functions/createSqliteDriver.md +1 -1
  65. package/docs/api/functions/dbCast.md +1 -1
  66. package/docs/api/functions/dbCastIn.md +1 -1
  67. package/docs/api/functions/dbDynamic.md +1 -1
  68. package/docs/api/functions/dbFalse.md +1 -1
  69. package/docs/api/functions/dbImmediate.md +1 -1
  70. package/docs/api/functions/dbIn.md +1 -1
  71. package/docs/api/functions/dbNotNull.md +1 -1
  72. package/docs/api/functions/dbNow.md +1 -1
  73. package/docs/api/functions/dbNull.md +1 -1
  74. package/docs/api/functions/dbRaw.md +1 -1
  75. package/docs/api/functions/dbTrue.md +1 -1
  76. package/docs/api/functions/dbUuid.md +1 -1
  77. package/docs/api/functions/dbUuidIn.md +1 -1
  78. package/docs/api/functions/formatLocalDate.md +2 -2
  79. package/docs/api/functions/formatUTCDate.md +2 -2
  80. package/docs/api/functions/getDBConfig.md +1 -1
  81. package/docs/api/functions/getDBHandler.md +1 -1
  82. package/docs/api/functions/getTransactionConnection.md +2 -2
  83. package/docs/api/functions/getTransactionContext.md +2 -2
  84. package/docs/api/functions/hasMany.md +2 -2
  85. package/docs/api/functions/hasOne.md +2 -2
  86. package/docs/api/functions/initDBHandler.md +1 -1
  87. package/docs/api/functions/isAnySqlFragment.md +1 -1
  88. package/docs/api/functions/isConnectionError.md +1 -1
  89. package/docs/api/functions/isSqlCondition.md +1 -1
  90. package/docs/api/functions/isSqlFragment.md +1 -1
  91. package/docs/api/functions/isSqlRaw.md +1 -1
  92. package/docs/api/functions/isSqlRef.md +1 -1
  93. package/docs/api/functions/isSqlTypedFragment.md +1 -1
  94. package/docs/api/functions/model.md +4 -4
  95. package/docs/api/functions/parentRef.md +1 -1
  96. package/docs/api/functions/sql.md +1 -1
  97. package/docs/api/globals.md +24 -21
  98. package/docs/api/interfaces/Column.md +32 -31
  99. package/docs/api/interfaces/ColumnDecorator.md +1 -1
  100. package/docs/api/interfaces/ColumnOptions.md +1 -1
  101. package/docs/api/interfaces/CreatedMiddlewareClass.md +1 -1
  102. package/docs/api/interfaces/DBConfig.md +1 -1
  103. package/docs/api/interfaces/DBConfigOptions.md +1 -1
  104. package/docs/api/interfaces/DeleteOptions.md +1 -1
  105. package/docs/api/interfaces/InsertOptions.md +1 -1
  106. package/docs/api/interfaces/LimitConfig.md +1 -1
  107. package/docs/api/interfaces/MiddlewareConfig.md +1 -1
  108. package/docs/api/interfaces/ModelClassDecorator.md +4 -4
  109. package/docs/api/interfaces/ModelOptions.md +1 -1
  110. package/docs/api/interfaces/PkeyResult.md +1 -1
  111. package/docs/api/interfaces/RelationDecorator.md +1 -1
  112. package/docs/api/interfaces/SelectOptions.md +1 -1
  113. package/docs/api/interfaces/SqlCondition.md +1 -1
  114. package/docs/api/interfaces/SqlFragment.md +1 -1
  115. package/docs/api/interfaces/SqlTypedFragment.md +1 -1
  116. package/docs/api/interfaces/TransactionOptions.md +1 -1
  117. package/docs/api/interfaces/UpdateManyOptions.md +1 -1
  118. package/docs/api/interfaces/UpdateOptions.md +1 -1
  119. package/docs/architecture.md +12 -8
  120. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: Column()\<ValueType, ModelType\>
8
8
 
9
- Defined in: [Column.ts:144](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L144)
9
+ Defined in: [Column.ts:145](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L145)
10
10
 
11
11
  Type-safe column reference as a callable function.
12
12
 
@@ -21,7 +21,7 @@ Type-safe column reference as a callable function.
21
21
  Column(): string;
22
22
  ```
23
23
 
24
- Defined in: [Column.ts:146](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L146)
24
+ Defined in: [Column.ts:147](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L147)
25
25
 
26
26
  Call to get column name as string (for computed property keys)
27
27
 
@@ -33,13 +33,14 @@ Call to get column name as string (for computed property keys)
33
33
 
34
34
  | Property | Modifier | Type | Description | Defined in |
35
35
  | ------ | ------ | ------ | ------ | ------ |
36
- | <a id="columnname"></a> `columnName` | `readonly` | `string` | The database column name | [Column.ts:149](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L149) |
37
- | <a id="propertyname"></a> `propertyName` | `readonly` | `string` | The property name on the model class (may differ from columnName) | [Column.ts:152](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L152) |
38
- | <a id="tablename"></a> `tableName` | `readonly` | `string` | The database table name | [Column.ts:155](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L155) |
39
- | <a id="modelname"></a> `modelName` | `readonly` | `string` | The model class name (for debugging and static analysis) | [Column.ts:158](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L158) |
40
- | <a id="_brand"></a> `_brand` | `readonly` | `"Column"` | Brand for type discrimination - enables static analysis to distinguish from regular variables | [Column.ts:161](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L161) |
41
- | <a id="sqlcast"></a> `sqlCast?` | `readonly` | `string` | SQL type for automatic casting in conditions (e.g., 'uuid') | [Column.ts:164](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L164) |
42
- | <a id="__model"></a> `__model?` | `readonly` | `ModelType` | Phantom type for model association (compile-time only, not used at runtime) | [Column.ts:167](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L167) |
36
+ | <a id="columnname"></a> `columnName` | `readonly` | `string` | The database column name | [Column.ts:150](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L150) |
37
+ | <a id="propertyname"></a> `propertyName` | `readonly` | `string` | The property name on the model class (may differ from columnName) | [Column.ts:153](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L153) |
38
+ | <a id="tablename"></a> `tableName` | `readonly` | `string` | The database table name | [Column.ts:156](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L156) |
39
+ | <a id="modelname"></a> `modelName` | `readonly` | `string` | The model class name (for debugging and static analysis) | [Column.ts:159](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L159) |
40
+ | <a id="_brand"></a> `_brand` | `readonly` | `"Column"` | Brand for type discrimination - enables static analysis to distinguish from regular variables | [Column.ts:162](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L162) |
41
+ | <a id="sqlcast"></a> `sqlCast?` | `readonly` | `string` | SQL type for automatic casting in conditions (e.g., 'uuid') | [Column.ts:165](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L165) |
42
+ | <a id="serialize"></a> `serialize?` | `readonly` | (`value`: `unknown`, `typeCast?`: `DriverTypeCast`) => `unknown` | The column family's serializer: a condition value binds exactly as a written value does | [Column.ts:168](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L168) |
43
+ | <a id="__model"></a> `__model?` | `readonly` | `ModelType` | Phantom type for model association (compile-time only, not used at runtime) | [Column.ts:171](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L171) |
43
44
 
44
45
  ## Methods
45
46
 
@@ -49,7 +50,7 @@ Call to get column name as string (for computed property keys)
49
50
  eq(value: ValueType): Record<string, ValueType | DBCast>;
50
51
  ```
51
52
 
52
- Defined in: [Column.ts:177](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L177)
53
+ Defined in: [Column.ts:181](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L181)
53
54
 
54
55
  Equal condition (column = value)
55
56
 
@@ -77,7 +78,7 @@ User.id.eq(1) → { id: 1 }
77
78
  ne(value: ValueType): Record<string, ValueType | DBCast>;
78
79
  ```
79
80
 
80
- Defined in: [Column.ts:183](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L183)
81
+ Defined in: [Column.ts:187](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L187)
81
82
 
82
83
  Not equal condition (column != value)
83
84
 
@@ -105,7 +106,7 @@ User.status.ne('deleted') → { 'status != ?': 'deleted' }
105
106
  gt(value: ValueType): Record<string, ValueType | DBCast>;
106
107
  ```
107
108
 
108
- Defined in: [Column.ts:189](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L189)
109
+ Defined in: [Column.ts:193](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L193)
109
110
 
110
111
  Greater than condition (column > value)
111
112
 
@@ -133,7 +134,7 @@ User.age.gt(18) → { 'age > ?': 18 }
133
134
  gte(value: ValueType): Record<string, ValueType | DBCast>;
134
135
  ```
135
136
 
136
- Defined in: [Column.ts:195](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L195)
137
+ Defined in: [Column.ts:199](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L199)
137
138
 
138
139
  Greater than or equal condition (column >= value)
139
140
 
@@ -161,7 +162,7 @@ User.age.gte(18) → { 'age >= ?': 18 }
161
162
  lt(value: ValueType): Record<string, ValueType | DBCast>;
162
163
  ```
163
164
 
164
- Defined in: [Column.ts:201](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L201)
165
+ Defined in: [Column.ts:205](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L205)
165
166
 
166
167
  Less than condition (column < value)
167
168
 
@@ -189,7 +190,7 @@ User.age.lt(65) → { 'age < ?': 65 }
189
190
  lte(value: ValueType): Record<string, ValueType | DBCast>;
190
191
  ```
191
192
 
192
- Defined in: [Column.ts:207](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L207)
193
+ Defined in: [Column.ts:211](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L211)
193
194
 
194
195
  Less than or equal condition (column <= value)
195
196
 
@@ -217,7 +218,7 @@ User.age.lte(65) → { 'age <= ?': 65 }
217
218
  like(pattern: string): Record<string, string>;
218
219
  ```
219
220
 
220
- Defined in: [Column.ts:213](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L213)
221
+ Defined in: [Column.ts:217](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L217)
221
222
 
222
223
  LIKE condition (column LIKE pattern)
223
224
 
@@ -245,7 +246,7 @@ User.name.like('%test%') → { 'name LIKE ?': '%test%' }
245
246
  notLike(pattern: string): Record<string, string>;
246
247
  ```
247
248
 
248
- Defined in: [Column.ts:219](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L219)
249
+ Defined in: [Column.ts:223](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L223)
249
250
 
250
251
  NOT LIKE condition (column NOT LIKE pattern)
251
252
 
@@ -273,7 +274,7 @@ User.name.notLike('%test%') → { 'name NOT LIKE ?': '%test%' }
273
274
  ilike(pattern: string): Record<string, string>;
274
275
  ```
275
276
 
276
- Defined in: [Column.ts:225](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L225)
277
+ Defined in: [Column.ts:229](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L229)
277
278
 
278
279
  ILIKE condition (case-insensitive LIKE, PostgreSQL specific)
279
280
 
@@ -301,7 +302,7 @@ User.name.ilike('%TEST%') → { 'name ILIKE ?': '%TEST%' }
301
302
  between(from: ValueType, to: ValueType): Record<string, [ValueType, ValueType]>;
302
303
  ```
303
304
 
304
- Defined in: [Column.ts:231](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L231)
305
+ Defined in: [Column.ts:235](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L235)
305
306
 
306
307
  BETWEEN condition (column BETWEEN from AND to)
307
308
 
@@ -330,7 +331,7 @@ User.age.between(18, 65) → { 'age BETWEEN ? AND ?': [18, 65] }
330
331
  in(values: ValueType[]): Record<string, ValueType[] | DBCastArray>;
331
332
  ```
332
333
 
333
- Defined in: [Column.ts:238](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L238)
334
+ Defined in: [Column.ts:242](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L242)
334
335
 
335
336
  IN condition (column IN (values))
336
337
  Note: Arrays are automatically converted to IN clause by litedbmodel
@@ -359,7 +360,7 @@ User.status.in(['active', 'pending']) → { status: ['active', 'pending'] }
359
360
  notIn(values: ValueType[]): Record<string, ValueType[] | DBCastArray>;
360
361
  ```
361
362
 
362
- Defined in: [Column.ts:244](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L244)
363
+ Defined in: [Column.ts:248](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L248)
363
364
 
364
365
  NOT IN condition (column NOT IN (values))
365
366
 
@@ -387,7 +388,7 @@ User.status.notIn(['deleted', 'banned'])
387
388
  isNull(): Record<string, null>;
388
389
  ```
389
390
 
390
- Defined in: [Column.ts:250](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L250)
391
+ Defined in: [Column.ts:254](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L254)
391
392
 
392
393
  IS NULL condition
393
394
 
@@ -409,7 +410,7 @@ User.deleted_at.isNull() → { deleted_at: null }
409
410
  isNotNull(): Record<string, DBNotNullValue>;
410
411
  ```
411
412
 
412
- Defined in: [Column.ts:256](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L256)
413
+ Defined in: [Column.ts:260](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L260)
413
414
 
414
415
  IS NOT NULL condition
415
416
 
@@ -431,7 +432,7 @@ User.email.isNotNull() → { email: DBNotNullValue }
431
432
  asc(): OrderColumn<ModelType>;
432
433
  ```
433
434
 
434
- Defined in: [Column.ts:266](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L266)
435
+ Defined in: [Column.ts:270](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L270)
435
436
 
436
437
  Ascending order
437
438
 
@@ -453,7 +454,7 @@ User.created_at.asc() → OrderColumn('created_at', 'ASC')
453
454
  desc(): OrderColumn<ModelType>;
454
455
  ```
455
456
 
456
- Defined in: [Column.ts:272](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L272)
457
+ Defined in: [Column.ts:276](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L276)
457
458
 
458
459
  Descending order
459
460
 
@@ -475,7 +476,7 @@ User.created_at.desc() → OrderColumn('created_at', 'DESC')
475
476
  ascNullsFirst(): OrderColumn<ModelType>;
476
477
  ```
477
478
 
478
- Defined in: [Column.ts:278](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L278)
479
+ Defined in: [Column.ts:282](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L282)
479
480
 
480
481
  Ascending order with NULLS FIRST
481
482
 
@@ -497,7 +498,7 @@ User.updated_at.ascNullsFirst() → OrderColumn with NULLS FIRST
497
498
  ascNullsLast(): OrderColumn<ModelType>;
498
499
  ```
499
500
 
500
- Defined in: [Column.ts:284](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L284)
501
+ Defined in: [Column.ts:288](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L288)
501
502
 
502
503
  Ascending order with NULLS LAST
503
504
 
@@ -519,7 +520,7 @@ User.updated_at.ascNullsLast() → OrderColumn with NULLS LAST
519
520
  descNullsFirst(): OrderColumn<ModelType>;
520
521
  ```
521
522
 
522
- Defined in: [Column.ts:290](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L290)
523
+ Defined in: [Column.ts:294](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L294)
523
524
 
524
525
  Descending order with NULLS FIRST
525
526
 
@@ -541,7 +542,7 @@ User.updated_at.descNullsFirst() → OrderColumn with NULLS FIRST
541
542
  descNullsLast(): OrderColumn<ModelType>;
542
543
  ```
543
544
 
544
- Defined in: [Column.ts:296](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L296)
545
+ Defined in: [Column.ts:300](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L300)
545
546
 
546
547
  Descending order with NULLS LAST
547
548
 
@@ -563,7 +564,7 @@ User.updated_at.descNullsLast() → OrderColumn with NULLS LAST
563
564
  toString(): string;
564
565
  ```
565
566
 
566
- Defined in: [Column.ts:306](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L306)
567
+ Defined in: [Column.ts:310](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Column.ts#L310)
567
568
 
568
569
  Returns column name (for template literals)
569
570
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: ModelClassDecorator()
8
8
 
9
- Defined in: [decorators.ts:1125](https://github.com/foo-ogawa/litedbmodel/blob/main/src/decorators.ts#L1125)
9
+ Defined in: [decorators.ts:1143](https://github.com/foo-ogawa/litedbmodel/blob/main/src/decorators.ts#L1143)
10
10
 
11
11
  A class decorator that works under both protocols.
12
12
 
@@ -16,7 +16,7 @@ A class decorator that works under both protocols.
16
16
  ModelClassDecorator<T>(constructor: T): T;
17
17
  ```
18
18
 
19
- Defined in: [decorators.ts:1126](https://github.com/foo-ogawa/litedbmodel/blob/main/src/decorators.ts#L1126)
19
+ Defined in: [decorators.ts:1144](https://github.com/foo-ogawa/litedbmodel/blob/main/src/decorators.ts#L1144)
20
20
 
21
21
  A class decorator that works under both protocols.
22
22
 
@@ -42,7 +42,7 @@ A class decorator that works under both protocols.
42
42
  ModelClassDecorator<T>(value: T, context: ClassDecoratorContext): T;
43
43
  ```
44
44
 
45
- Defined in: [decorators.ts:1127](https://github.com/foo-ogawa/litedbmodel/blob/main/src/decorators.ts#L1127)
45
+ Defined in: [decorators.ts:1145](https://github.com/foo-ogawa/litedbmodel/blob/main/src/decorators.ts#L1145)
46
46
 
47
47
  A class decorator that works under both protocols.
48
48
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -1,4 +1,4 @@
1
- [**litedbmodel v2.2.7**](../README.md)
1
+ [**litedbmodel v2.2.8**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -207,15 +207,19 @@ nullability は基底スカラと直交する(`` `sqlTypeIsNotNull` (`src/scp/
207
207
 
208
208
  **TS 読み出しの materialization(`sqlTypeToMaterializeClass` / `materializeCell`)**
209
209
 
210
- bc outType(可搬型)に加え、TS/driver の読み経路では `int` スカラを SQL 幅で分割し、`date`/`bool` を
211
- 正確な JS 形へ矯正する(JS `number` は i64 を保持できず、driver は `string` outType に反する `Date`/`0|1`
212
- を返し得るため)。クラスは `` `MaterializeClass` (`src/scp/coltype.ts`) ``:
213
-
214
- - `int32`(INT/INTEGER/SMALLINT/…)→ JS `number`(範囲が収まる)。
215
- - `int64`(BIGINT/INT8/BIGSERIAL)→ **値保存の10進文字列**(JS number は 2^53 超で丸む・JSON 安全)。
216
- - `date`(DATE/TIMESTAMP/…)→ **TZ 付き文字列**(`string` outType に整合。全言語同一、TS も Date にしない)。
210
+ bc outType(可搬型)に加え、TS/driver の読み経路では `int`/`date`/`bool` を正確な JS 形へ矯正する
211
+ (JS `number` は i64 を保持できず、driver は `string` outType に反する `Date`/`0|1` を返し得るため)。
212
+ クラスは `` `MaterializeClass` (`src/scp/coltype.ts`) ``:
213
+
214
+ - `int`(INTEGER / INT / SMALLINT / TINYINT / MEDIUMINT / BIGINT / INT2 / INT4 / INT8 / SERIAL 系)→
215
+ **JS `bigint`**(checked i64)。bc の整数型は `int` 1 つなので幅で分けない(幅は列制約であって別の読み型
216
+ ではない)。driver が返す `bigint`・整数の10進文字列・安全な整数の `number` を受け、2^53 を超える
217
+ `number`(読み出しの前に精度が失われている)は throw する。
218
+ - `date`(DATE / TIMESTAMP / TIMESTAMPTZ / DATETIME / TIME)→ **TZ 付き文字列**(`string` outType に整合。
219
+ 全言語同一、TS も Date にしない)。
217
220
  - `bool` → JS `boolean`。
218
- - `passthrough`(float / text / decimal→string / json / uuid / 配列列)→ 無変換。
221
+ - `passthrough`(float / decimal→string / text / json / uuid / 配列列)→ 無変換。配列列は driver の配列
222
+ typeCast が要素を宣言型どおりに解いた JS 配列をそのまま返す(要素の基底型は検証する)。
219
223
 
220
224
  読み出しは fail-closed の resolver(`` `failClosedMaterializeResolverFromColumnMap` (`src/scp/coltype.ts`) ``)
221
225
  で常時 de-box され、宣言されていない列は throw する(未型付き列を silent に box しない)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "litedbmodel",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "description": "A lightweight TypeScript ORM for PostgreSQL, MySQL, and SQLite with Active Record pattern",
5
5
  "main": "dist/index.cjs",
6
6
  "types": "dist/index.d.ts",