bigal 13.0.7 → 13.0.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.
- package/.markdownlintignore +1 -0
- package/.textlintignore +1 -0
- package/CHANGELOG.md +121 -121
- package/CONTRIBUTING.md +19 -16
- package/dist/index.cjs +13 -39
- package/dist/index.mjs +13 -39
- package/package.json +34 -33
- package/release.config.mjs +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CHANGELOG.md
|
package/.textlintignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CHANGELOG.md
|
package/CHANGELOG.md
CHANGED
|
@@ -1,160 +1,160 @@
|
|
|
1
|
-
|
|
1
|
+
## [13.0.8](https://github.com/bigalorm/bigal/compare/v13.0.7...v13.0.8) (2025-04-07)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# 13.0.7 - 2024-03-10
|
|
4
4
|
|
|
5
5
|
- Update npms
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# 13.0.6 - 2024-01-08
|
|
8
8
|
|
|
9
9
|
- Update npms
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
# 13.0.5 - 2024-12-17
|
|
12
12
|
|
|
13
13
|
- Update npms
|
|
14
14
|
- Use node protocol for built-in modules
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
# 13.0.4 - 2024-11-29
|
|
17
17
|
|
|
18
18
|
- Update npms
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
# 13.0.3 - 2024-09-30
|
|
21
21
|
|
|
22
22
|
- Update npms
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
# 13.0.2 - 2024-08-26
|
|
25
25
|
|
|
26
26
|
- Update npms
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
# 13.0.1 - 2024-07-02
|
|
29
29
|
|
|
30
30
|
- Update postgres-pool npm
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
# 13.0.0 - 2024-07-02
|
|
33
33
|
|
|
34
34
|
- Publish as CJS and ESM
|
|
35
35
|
- Upgrade eslint to flat config
|
|
36
36
|
- Update npms and dependencies
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
## BREAKING CHANGES
|
|
39
39
|
|
|
40
40
|
- Consolidated exports for /decorators, /errors, /metadata, /query, and /types to root
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
# 12.1.5 - 2024-05-13
|
|
43
43
|
|
|
44
44
|
- Update npms
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
# 12.1.4 - 2024-04-08
|
|
47
47
|
|
|
48
48
|
- Update npms
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
# 12.1.3 - 2024-03-11
|
|
51
51
|
|
|
52
52
|
- Update npms
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
# 12.1.2 - 2024-02-07
|
|
55
55
|
|
|
56
56
|
- Update npms
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
# 12.1.1 - 2024-01-12
|
|
59
59
|
|
|
60
60
|
- Handle `null` and `undefined` for columns with maxLength. #90 Thanks @tyler-neal!
|
|
61
61
|
- Update npms
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
# 12.1.0 - 2024-01-05
|
|
64
64
|
|
|
65
65
|
- Added support for optional maxLength constraint when inserting/updating string fields. #89 Thanks @tyler-neal!
|
|
66
66
|
- Update npms
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
# 12.0.2 - 2023-11-28
|
|
69
69
|
|
|
70
70
|
- Update npms
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
# 12.0.1 - 2023-10-27
|
|
73
73
|
|
|
74
74
|
- Update npms
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
# 12.0.0 - 2023-10-04
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
## BREAKING CHANGES (12.0.0)
|
|
79
79
|
|
|
80
80
|
- Drop support for Node.js 16
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
## NON-BREAKING CHANGES (12.0.0)
|
|
83
83
|
|
|
84
84
|
- Throw `QueryError`, with additional metadata
|
|
85
85
|
- Throw error if query has an empty `or` statement
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
## MAINTENANCE (12.0.0)
|
|
88
88
|
|
|
89
89
|
- Update npms
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
# 11.0.2 - 2023-07-18
|
|
92
92
|
|
|
93
93
|
- Update npms
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
# 11.0.1 - 2023-04-17
|
|
96
96
|
|
|
97
97
|
- Update npms
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
# 11.0.0 - 2023-02-07
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
## BREAKING CHANGES (11.0.0)
|
|
102
102
|
|
|
103
103
|
- Drop support for Node.js 14
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
## MAINTENANCE (11.0.0)
|
|
106
106
|
|
|
107
107
|
- Update npms
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
# 10.4.2 - 2023-01-03
|
|
110
110
|
|
|
111
111
|
- Update npms
|
|
112
112
|
- Enable noUncheckedIndexedAccess compiler option
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
# 10.4.1 - 2022-12-06
|
|
115
115
|
|
|
116
116
|
- Update npms
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
# 10.4.0 - 2022-11-03
|
|
119
119
|
|
|
120
120
|
- Fix string comparison where constraint with union values
|
|
121
121
|
- Update npms
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
# 10.3.4 - 2022-10-11
|
|
124
124
|
|
|
125
125
|
- Update npms
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
# 10.3.3 - 2022-08-30
|
|
128
128
|
|
|
129
129
|
- Update npms
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
# 10.3.2 - 2022-06-29
|
|
132
132
|
|
|
133
133
|
- Update npms
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
# 10.3.1 - 2022-05-23
|
|
136
136
|
|
|
137
137
|
- Update npms
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
# 10.3.0 - 2022-04-25
|
|
140
140
|
|
|
141
141
|
- Add where clause for conflict resolution. Thanks @shortstuffsushi!
|
|
142
142
|
- Update npms
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
# 10.2.0 - 2022-04-13
|
|
145
145
|
|
|
146
146
|
- Add `onConflict` options to `create()` to support `ON CONFLICT DO NOTHING` and `ON CONFLICT DO UPDATE`
|
|
147
147
|
- Update npms
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
# 10.1.1 - 2022-03-22
|
|
150
150
|
|
|
151
151
|
- Update npms
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
# 10.1.0 - 2022-03-15
|
|
154
154
|
|
|
155
155
|
- Add ability to override db pool for `count()`
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
# 10.0.3 - 2022-03-15
|
|
158
158
|
|
|
159
159
|
- Update npms
|
|
160
160
|
- Fix string comparison operators with arrays. Wildcard characters in array values passed to `startsWith`, `contains`,
|
|
@@ -162,98 +162,98 @@
|
|
|
162
162
|
using `ilike`
|
|
163
163
|
- Remove unnecessary `await` operators from `then()` functions
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
# 10.0.2 - 2022-03-02
|
|
166
166
|
|
|
167
167
|
- Update npms
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
# 10.0.1 - 2022-02-22
|
|
170
170
|
|
|
171
171
|
- Update npms
|
|
172
172
|
- Update husky to support Apple silicon homebrew package links
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
# 10.0.0 - 2022-01-07
|
|
175
175
|
|
|
176
176
|
- Fix populated entities to be QueryResult
|
|
177
177
|
- Improve return types when doing partial selects
|
|
178
178
|
- Be less restrictive with dependency versions
|
|
179
179
|
- Drop node 12 support
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
# 9.2.4 - 2021-12-28
|
|
182
182
|
|
|
183
183
|
- Fix PromiseLike signatures. Remove ChainablePromiseLike
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
# 9.2.3 - 2021-12-27
|
|
186
186
|
|
|
187
187
|
- Update npms
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
# 9.2.2 - 2021-12-27
|
|
190
190
|
|
|
191
191
|
- Fix to always include populate column names in select query
|
|
192
192
|
- Use readonly arrays where possible when building sql
|
|
193
193
|
- Update npms
|
|
194
194
|
|
|
195
|
-
|
|
195
|
+
# 9.2.1 - 2021-11-16
|
|
196
196
|
|
|
197
197
|
- Update npms
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
# 9.2.0 - 2021-11-16
|
|
200
200
|
|
|
201
201
|
- Update npms
|
|
202
202
|
- Add ability to override db pool for `find()` and `findOne()`
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
# 9.1.6 - 2021-10-29
|
|
205
205
|
|
|
206
206
|
- Update npms
|
|
207
207
|
- Format markdown files
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
# 9.1.5 - 2021-09-14
|
|
210
210
|
|
|
211
211
|
- Update npms
|
|
212
212
|
- Lint markdown files
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
# 9.1.4
|
|
215
215
|
|
|
216
216
|
- Update npms
|
|
217
217
|
- Set sourceRoot when transpiling Typescript, to help with sourcemap paths
|
|
218
218
|
|
|
219
|
-
|
|
219
|
+
# 9.1.3
|
|
220
220
|
|
|
221
221
|
- Fix deprecated faker.js usage
|
|
222
222
|
|
|
223
|
-
|
|
223
|
+
# 9.1.2
|
|
224
224
|
|
|
225
225
|
- Update npms
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
# 9.1.1
|
|
228
228
|
|
|
229
229
|
- Update npms
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
# 9.1.0
|
|
232
232
|
|
|
233
233
|
- Add beforeCreate and beforeUpdate static method definitions to Entity.
|
|
234
234
|
- Enable typescript lint check: [`noImplicitOverride`](https://www.typescriptlang.org/tsconfig#noImplicitOverride)
|
|
235
235
|
- Update npms
|
|
236
236
|
|
|
237
|
-
|
|
237
|
+
# 9.0.2
|
|
238
238
|
|
|
239
239
|
- Update npms
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
# 9.0.1
|
|
242
242
|
|
|
243
243
|
- Update npms
|
|
244
244
|
- Add Node.js v16 to CI tests
|
|
245
245
|
|
|
246
|
-
|
|
246
|
+
# 9.0.0
|
|
247
247
|
|
|
248
248
|
- Drop Node.js 10 support
|
|
249
249
|
- Enable consistent indexed object style lint rule
|
|
250
250
|
|
|
251
|
-
|
|
251
|
+
# 8.1.1
|
|
252
252
|
|
|
253
253
|
- Throw error when trying to populate a one-to-many relationship from `find()` with specific select columns and not including the
|
|
254
254
|
relation column.
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
# 8.1.0
|
|
257
257
|
|
|
258
258
|
- Allow chaining `populate()` with `find()` calls :tada:
|
|
259
259
|
- Add `UNSAFE_withOriginalFieldType()` helper method to `find()` and `findOne()` to retain the original type for a field.
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
being forced to strictly `string`.
|
|
262
262
|
- Add `UNSAFE_withFieldValue()` helper method to `findOne()` to manually set a field value.
|
|
263
263
|
|
|
264
|
-
|
|
264
|
+
# 8.0.0
|
|
265
265
|
|
|
266
266
|
- Constrain types for create(), update(), and selects
|
|
267
267
|
- Exclude instance functions and entity collections
|
|
@@ -273,17 +273,17 @@
|
|
|
273
273
|
|
|
274
274
|
**Breaking Change:** The change to create and update values expects a property called `id` on subclasses of `Entity`.
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
# 7.1.2
|
|
277
277
|
|
|
278
278
|
- Make sort argument optional for chained calls
|
|
279
279
|
|
|
280
|
-
|
|
280
|
+
# 7.1.1
|
|
281
281
|
|
|
282
282
|
- Allow sort() argument to be undefined
|
|
283
283
|
- Fix object notation for sort() to have properties be optional
|
|
284
284
|
- Make `__bigAlEntity` be optional on Entity to avoid undefined errors when using objects as model data
|
|
285
285
|
|
|
286
|
-
|
|
286
|
+
# 7.1.0
|
|
287
287
|
|
|
288
288
|
- Fix `select` typings for populate() calls
|
|
289
289
|
- Changed `Entity` to be an abstract class rather than an interface
|
|
@@ -291,259 +291,259 @@
|
|
|
291
291
|
NOTE: This is a pretty big breaking change, but v7.0.0 was less than 24h old and was broken, so leaving this as a
|
|
292
292
|
minor version change.
|
|
293
293
|
|
|
294
|
-
|
|
294
|
+
# 7.0.0
|
|
295
295
|
|
|
296
296
|
- Add generic types to select and where. #72 Thanks @krislefeber!
|
|
297
297
|
- Add debug environment variable to print sql to console. #73 Thanks @krislefeber!
|
|
298
298
|
- Add generic types to returnSelect and sort arguments
|
|
299
299
|
- Update npms
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
# 6.0.2
|
|
302
302
|
|
|
303
303
|
- Update npms
|
|
304
304
|
- Sort union/intersection members
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
# 6.0.1
|
|
307
307
|
|
|
308
308
|
- Fix jsdocs for create and update
|
|
309
309
|
|
|
310
|
-
|
|
310
|
+
# 6.0.0
|
|
311
311
|
|
|
312
312
|
- Update npms
|
|
313
313
|
- Change `.destroy()` to not return records by default. Use `.destroy({}, { returnRecords: true })` for previous behavior
|
|
314
314
|
- Return `void` instead of `boolean` when not returning records
|
|
315
315
|
|
|
316
|
-
|
|
316
|
+
# 5.0.3
|
|
317
317
|
|
|
318
318
|
- Update npms
|
|
319
319
|
|
|
320
|
-
|
|
320
|
+
# 5.0.2
|
|
321
321
|
|
|
322
322
|
- Update npms
|
|
323
323
|
|
|
324
|
-
|
|
324
|
+
# 5.0.1
|
|
325
325
|
|
|
326
326
|
- Update npms
|
|
327
327
|
|
|
328
|
-
|
|
328
|
+
# 5.0.0
|
|
329
329
|
|
|
330
330
|
- Update npms
|
|
331
331
|
- Use prettier to format files
|
|
332
332
|
- Create interfaces for Repository and ReadonlyRepository
|
|
333
333
|
- Remove interfaces for RepositoriesByModelName and RepositoriesByModelNameLowered
|
|
334
334
|
|
|
335
|
-
|
|
335
|
+
# 4.1.1
|
|
336
336
|
|
|
337
337
|
- Update npms
|
|
338
338
|
- Use prettier to format files
|
|
339
339
|
|
|
340
|
-
|
|
340
|
+
# 4.1.0
|
|
341
341
|
|
|
342
342
|
- Fix issues with `like` and array containing null or empty string.
|
|
343
343
|
Specifically support negated array type value with null and empty string.
|
|
344
344
|
- Fix `like` constraint with null value
|
|
345
345
|
|
|
346
|
-
|
|
346
|
+
# 4.0.2
|
|
347
347
|
|
|
348
348
|
- Update npms
|
|
349
349
|
|
|
350
|
-
|
|
350
|
+
# 4.0.1
|
|
351
351
|
|
|
352
352
|
- Update npms
|
|
353
353
|
|
|
354
|
-
|
|
354
|
+
# 4.0.0
|
|
355
355
|
|
|
356
356
|
- Tightened up type definitions for "object" to Record<string, unknown> or more strict definition
|
|
357
357
|
- Do not return a string from .count() if the number is greater than safe int
|
|
358
358
|
- Update npms & fix lint issues
|
|
359
359
|
|
|
360
|
-
|
|
360
|
+
# 3.4.1
|
|
361
361
|
|
|
362
362
|
- Update npms
|
|
363
363
|
|
|
364
|
-
|
|
364
|
+
# 3.4.0
|
|
365
365
|
|
|
366
366
|
- Update npms
|
|
367
367
|
- Fix jsdoc comments for .populate()
|
|
368
368
|
|
|
369
|
-
|
|
369
|
+
# 3.3.4
|
|
370
370
|
|
|
371
371
|
- Update npms
|
|
372
372
|
|
|
373
|
-
|
|
373
|
+
# 3.3.3
|
|
374
374
|
|
|
375
375
|
- Update npms
|
|
376
376
|
|
|
377
|
-
|
|
377
|
+
# 3.3.2
|
|
378
378
|
|
|
379
379
|
- Update npms
|
|
380
380
|
|
|
381
|
-
|
|
381
|
+
# 3.3.1
|
|
382
382
|
|
|
383
383
|
- Update npms
|
|
384
384
|
|
|
385
|
-
|
|
385
|
+
# 3.3.0
|
|
386
386
|
|
|
387
387
|
- Make typescript lint rules more strict
|
|
388
388
|
- Update npms
|
|
389
389
|
|
|
390
|
-
|
|
390
|
+
# 3.2.0
|
|
391
391
|
|
|
392
392
|
- Fix CreateUpdateDelete type to be strict about either returnRecords=false or defined returnSelect
|
|
393
393
|
- Update npms
|
|
394
394
|
|
|
395
|
-
|
|
395
|
+
# 3.1.1
|
|
396
396
|
|
|
397
397
|
- Throw error when invalid propertyName in query projection
|
|
398
398
|
- Update npms
|
|
399
399
|
|
|
400
|
-
|
|
400
|
+
# 3.1.0
|
|
401
401
|
|
|
402
402
|
- Update postgres-pool to v2.0.0
|
|
403
403
|
- Update npms
|
|
404
404
|
|
|
405
|
-
|
|
405
|
+
# 3.0.1
|
|
406
406
|
|
|
407
407
|
- Remove returnSelect requirement when returnRecords=false
|
|
408
408
|
|
|
409
|
-
|
|
409
|
+
# 3.0.0
|
|
410
410
|
|
|
411
411
|
- Use classes and decorators to define database models
|
|
412
412
|
- Allow repositories to be strongly typed to their database model
|
|
413
413
|
- Split readonly repository functionality into a separate class from writeable repository functionality
|
|
414
414
|
|
|
415
|
-
|
|
415
|
+
# 2.2.1
|
|
416
416
|
|
|
417
417
|
- Update npms
|
|
418
418
|
|
|
419
|
-
|
|
419
|
+
# 2.2.0
|
|
420
420
|
|
|
421
421
|
- Add readonly property to schemas to limit access to create(), update(), destroy() methods
|
|
422
422
|
- Update npms
|
|
423
423
|
|
|
424
|
-
|
|
424
|
+
# 2.1.3
|
|
425
425
|
|
|
426
426
|
- Fix querying array columns with `like` operator
|
|
427
427
|
- Add additional array types: string[], integer[], float[], boolean[]
|
|
428
428
|
|
|
429
|
-
|
|
429
|
+
# 2.1.2
|
|
430
430
|
|
|
431
431
|
- Fix casing issues with generated Repository and SqlHelper
|
|
432
432
|
- Revert explicit export of interfaces/classes: Entity, Model, ModelClassesByGlobalId, and Repository
|
|
433
433
|
|
|
434
|
-
|
|
434
|
+
# 2.1.1
|
|
435
435
|
|
|
436
436
|
- Explicit export of interfaces/classes: Entity, Model, ModelClassesByGlobalId, and Repository
|
|
437
437
|
|
|
438
|
-
|
|
438
|
+
# 2.1.0
|
|
439
439
|
|
|
440
440
|
- Fix publish path to remove "dist"
|
|
441
441
|
- Add type definitions to "dependencies"
|
|
442
442
|
|
|
443
|
-
|
|
443
|
+
# 2.0.8
|
|
444
444
|
|
|
445
445
|
- Add binary data type
|
|
446
446
|
|
|
447
|
-
|
|
447
|
+
# 2.0.7
|
|
448
448
|
|
|
449
449
|
- Add additional array types as type for defaultsTo
|
|
450
450
|
|
|
451
|
-
|
|
451
|
+
# 2.0.6
|
|
452
452
|
|
|
453
453
|
- Add array as type for defaultsTo
|
|
454
454
|
- Fix generic type issues due to Typescript 3.5
|
|
455
455
|
- Update npms
|
|
456
456
|
|
|
457
|
-
|
|
457
|
+
# 2.0.5
|
|
458
458
|
|
|
459
459
|
- Allow .findOne(), .find(), .count(), .update(), and .destroy() to be used in an iterable promise (eg. Promise.all())
|
|
460
460
|
|
|
461
|
-
|
|
461
|
+
# 2.0.4
|
|
462
462
|
|
|
463
463
|
- Fix return type for .findOne(), .find(), .count(), .destroy() to not include `undefined`
|
|
464
464
|
|
|
465
|
-
|
|
465
|
+
# 2.0.3
|
|
466
466
|
|
|
467
467
|
- Update npm dependencies
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
# 2.0.2
|
|
470
470
|
|
|
471
471
|
- Add boolean types as acceptable values for a where clause
|
|
472
472
|
|
|
473
|
-
|
|
473
|
+
# 2.0.1
|
|
474
474
|
|
|
475
475
|
- Fix case of import module for initialization function
|
|
476
476
|
|
|
477
|
-
|
|
477
|
+
# 2.0.0
|
|
478
478
|
|
|
479
479
|
- Typescript ftw! The API is the same as BigAl v1.x. BigAl v2 is a rewrite in typescript, to provide strong type support. It should be a drop in update to go to v2.
|
|
480
480
|
|
|
481
|
-
|
|
481
|
+
# 1.2.1
|
|
482
482
|
|
|
483
483
|
- Use husky to enforce precommit hook for development
|
|
484
484
|
|
|
485
|
-
|
|
485
|
+
# 1.2.0
|
|
486
486
|
|
|
487
487
|
- Add `connections` property to initialize method
|
|
488
488
|
- Use `connection` on model schema to optionally set specific connection pools for each model
|
|
489
489
|
- Update dependencies
|
|
490
490
|
|
|
491
|
-
|
|
491
|
+
# 1.1.6
|
|
492
492
|
|
|
493
493
|
- Update dependencies
|
|
494
494
|
|
|
495
|
-
|
|
495
|
+
# 1.1.5
|
|
496
496
|
|
|
497
497
|
- Throw exception when find, update, findOne, and destroy queries receive a string parameter instead of object.
|
|
498
498
|
|
|
499
|
-
|
|
499
|
+
# 1.1.4
|
|
500
500
|
|
|
501
501
|
- Fix: Results for model queries should share the same inherited base
|
|
502
502
|
|
|
503
|
-
|
|
503
|
+
# 1.1.3
|
|
504
504
|
|
|
505
505
|
- Fix: Querying array types
|
|
506
506
|
- Fix: Explicitly cast array values
|
|
507
507
|
|
|
508
|
-
|
|
508
|
+
# 1.1.2
|
|
509
509
|
|
|
510
510
|
- Fix: Try to convert float and integer column data to numbers when fetching records
|
|
511
511
|
|
|
512
|
-
|
|
512
|
+
# 1.1.1
|
|
513
513
|
|
|
514
514
|
- Fix: Checking if array column equals an empty array
|
|
515
515
|
|
|
516
|
-
|
|
516
|
+
# 1.1.0
|
|
517
517
|
|
|
518
518
|
- Allow array values for: like, contains, startsWith, and endsWith
|
|
519
519
|
|
|
520
|
-
|
|
520
|
+
# 1.0.8
|
|
521
521
|
|
|
522
522
|
- Fix: Prevent trying to save when create() is called with an empty array
|
|
523
523
|
|
|
524
|
-
|
|
524
|
+
# 1.0.7
|
|
525
525
|
|
|
526
526
|
- Fix: Add additional stack trace data when an exception occurs
|
|
527
527
|
|
|
528
|
-
|
|
528
|
+
# 1.0.6
|
|
529
529
|
|
|
530
530
|
- Fix: "invalid input syntax for type json" error when setting jsonb column value to an array. See <https://github.com/brianc/node-postgres/issues/442>
|
|
531
531
|
- Update npms to latest versions
|
|
532
532
|
|
|
533
|
-
|
|
533
|
+
# 1.0.5
|
|
534
534
|
|
|
535
535
|
- Fix: AND constraint after an OR constraint caused exception
|
|
536
536
|
|
|
537
|
-
|
|
537
|
+
# 1.0.4
|
|
538
538
|
|
|
539
539
|
- Fix: Querying date values was not working
|
|
540
540
|
- Fix: Querying a property with columnName that is the same as the property name would result in unnecessary sql syntax
|
|
541
541
|
|
|
542
|
-
|
|
542
|
+
# 1.0.3
|
|
543
543
|
|
|
544
544
|
- Fix: A query with an empty array should return 0 records. Negated queries with empty arrays will return all records.
|
|
545
545
|
|
|
546
|
-
|
|
546
|
+
# 1.0.2
|
|
547
547
|
|
|
548
548
|
- Organize schemas by case-insensitive global id
|
|
549
549
|
- Expose schema attributes collection on model instance
|
|
@@ -551,10 +551,10 @@ minor version change.
|
|
|
551
551
|
- Ensure .count() returns number instead of a string (default data type for bigint)
|
|
552
552
|
- Fix queries for empty arrays
|
|
553
553
|
|
|
554
|
-
|
|
554
|
+
# 1.0.1
|
|
555
555
|
|
|
556
556
|
- Add .count() method
|
|
557
557
|
|
|
558
|
-
|
|
558
|
+
# 1.0.0
|
|
559
559
|
|
|
560
560
|
- Initial release
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Contributing Guidelines
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Pull Request Format
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- Do not checkin build output (dist)
|
|
7
|
-
- Do not checkin node_modules
|
|
5
|
+
The title of your PR should match the following format:
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
```text
|
|
8
|
+
<type>: <short description>
|
|
9
|
+
```
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
This step ensures that formatting and checkin rules are followed. To make sure Husky runs correctly, please use the
|
|
13
|
-
following workflow:
|
|
11
|
+
### Types
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
- **docs** - Documentation changes only
|
|
14
|
+
- **feat** - Any new functionality additions
|
|
15
|
+
- **fix** - Bugfixes that don't add new functionality
|
|
16
|
+
- **test** - Test changes only
|
|
17
|
+
- **chore** - Anything else
|
|
18
|
+
|
|
19
|
+
Within the body of your PR, make sure you reference the issue that you have worked on, as well as pointing out anything
|
|
20
|
+
of note you wish us to look at during our review.
|
|
21
|
+
|
|
22
|
+
### Commits
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
We do not care about the number, or style of commits in your history, because we squash merge every PR into main.
|
|
25
|
+
Feel free to commit in whatever style you feel comfortable with.
|
package/dist/index.cjs
CHANGED
|
@@ -2135,21 +2135,15 @@ ${stack}`;
|
|
|
2135
2135
|
|
|
2136
2136
|
function column(dbColumnNameOrOptions, options) {
|
|
2137
2137
|
return function columnDecorator(object, propertyName) {
|
|
2138
|
-
|
|
2139
|
-
dbColumnNameOrOptions = ___default.snakeCase(propertyName);
|
|
2140
|
-
}
|
|
2138
|
+
dbColumnNameOrOptions ??= ___default.snakeCase(propertyName);
|
|
2141
2139
|
let dbColumnName;
|
|
2142
2140
|
if (typeof dbColumnNameOrOptions === "string") {
|
|
2143
2141
|
dbColumnName = dbColumnNameOrOptions;
|
|
2144
2142
|
} else {
|
|
2145
2143
|
options = dbColumnNameOrOptions;
|
|
2146
2144
|
}
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
}
|
|
2150
|
-
if (!dbColumnName) {
|
|
2151
|
-
dbColumnName = options.name ?? ___default.snakeCase(propertyName);
|
|
2152
|
-
}
|
|
2145
|
+
options ??= {};
|
|
2146
|
+
dbColumnName ??= options.name ?? ___default.snakeCase(propertyName);
|
|
2153
2147
|
const metadataStorage = getMetadataStorage();
|
|
2154
2148
|
const columnCollectionOptions = options;
|
|
2155
2149
|
if (columnCollectionOptions.collection || columnCollectionOptions.via) {
|
|
@@ -2208,12 +2202,8 @@ function createDateColumn(dbColumnNameOrOptions, options) {
|
|
|
2208
2202
|
options = dbColumnNameOrOptions;
|
|
2209
2203
|
}
|
|
2210
2204
|
if (dbColumnNameOrOptions) {
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
}
|
|
2214
|
-
if (!dbColumnName) {
|
|
2215
|
-
dbColumnName = options.name ?? ___default.snakeCase(propertyName);
|
|
2216
|
-
}
|
|
2205
|
+
options ??= {};
|
|
2206
|
+
dbColumnName ??= options.name ?? ___default.snakeCase(propertyName);
|
|
2217
2207
|
metadataStorage.columns.push(
|
|
2218
2208
|
new ColumnTypeMetadata({
|
|
2219
2209
|
target: object.constructor.name,
|
|
@@ -2246,12 +2236,8 @@ function primaryColumn(dbColumnNameOrOptions, options) {
|
|
|
2246
2236
|
options = dbColumnNameOrOptions;
|
|
2247
2237
|
}
|
|
2248
2238
|
if (dbColumnNameOrOptions) {
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
}
|
|
2252
|
-
if (!dbColumnName) {
|
|
2253
|
-
dbColumnName = options.name ?? ___default.snakeCase(propertyName);
|
|
2254
|
-
}
|
|
2239
|
+
options ??= {};
|
|
2240
|
+
dbColumnName ??= options.name ?? ___default.snakeCase(propertyName);
|
|
2255
2241
|
const { type } = options;
|
|
2256
2242
|
const { model } = options;
|
|
2257
2243
|
const metadataStorage = getMetadataStorage();
|
|
@@ -2302,12 +2288,8 @@ function table(dbNameOrTableOptions, options) {
|
|
|
2302
2288
|
} else {
|
|
2303
2289
|
options = dbNameOrTableOptions;
|
|
2304
2290
|
}
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
}
|
|
2308
|
-
if (!options.name) {
|
|
2309
|
-
options.name = dbTableName ?? ___default.snakeCase(className);
|
|
2310
|
-
}
|
|
2291
|
+
options ??= {};
|
|
2292
|
+
options.name ??= dbTableName ?? ___default.snakeCase(className);
|
|
2311
2293
|
const metadataStorage = getMetadataStorage();
|
|
2312
2294
|
const modelMetadata = new ModelMetadata({
|
|
2313
2295
|
name: className,
|
|
@@ -2329,12 +2311,8 @@ function updateDateColumn(dbColumnNameOrOptions, options) {
|
|
|
2329
2311
|
options = dbColumnNameOrOptions;
|
|
2330
2312
|
}
|
|
2331
2313
|
if (dbColumnNameOrOptions) {
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
}
|
|
2335
|
-
if (!dbColumnName) {
|
|
2336
|
-
dbColumnName = options.name ?? ___default.snakeCase(propertyName);
|
|
2337
|
-
}
|
|
2314
|
+
options ??= {};
|
|
2315
|
+
dbColumnName ??= options.name ?? ___default.snakeCase(propertyName);
|
|
2338
2316
|
const metadataStorage = getMetadataStorage();
|
|
2339
2317
|
metadataStorage.columns.push(
|
|
2340
2318
|
new ColumnTypeMetadata({
|
|
@@ -2369,12 +2347,8 @@ function versionColumn(dbColumnNameOrOptions, options) {
|
|
|
2369
2347
|
options = dbColumnNameOrOptions;
|
|
2370
2348
|
}
|
|
2371
2349
|
if (dbColumnNameOrOptions) {
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
}
|
|
2375
|
-
if (!dbColumnName) {
|
|
2376
|
-
dbColumnName = options.name ?? ___default.snakeCase(propertyName);
|
|
2377
|
-
}
|
|
2350
|
+
options ??= {};
|
|
2351
|
+
dbColumnName ??= options.name ?? ___default.snakeCase(propertyName);
|
|
2378
2352
|
const metadataStorage = getMetadataStorage();
|
|
2379
2353
|
metadataStorage.columns.push(
|
|
2380
2354
|
new ColumnTypeMetadata({
|
package/dist/index.mjs
CHANGED
|
@@ -2129,21 +2129,15 @@ ${stack}`;
|
|
|
2129
2129
|
|
|
2130
2130
|
function column(dbColumnNameOrOptions, options) {
|
|
2131
2131
|
return function columnDecorator(object, propertyName) {
|
|
2132
|
-
|
|
2133
|
-
dbColumnNameOrOptions = _.snakeCase(propertyName);
|
|
2134
|
-
}
|
|
2132
|
+
dbColumnNameOrOptions ??= _.snakeCase(propertyName);
|
|
2135
2133
|
let dbColumnName;
|
|
2136
2134
|
if (typeof dbColumnNameOrOptions === "string") {
|
|
2137
2135
|
dbColumnName = dbColumnNameOrOptions;
|
|
2138
2136
|
} else {
|
|
2139
2137
|
options = dbColumnNameOrOptions;
|
|
2140
2138
|
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
}
|
|
2144
|
-
if (!dbColumnName) {
|
|
2145
|
-
dbColumnName = options.name ?? _.snakeCase(propertyName);
|
|
2146
|
-
}
|
|
2139
|
+
options ??= {};
|
|
2140
|
+
dbColumnName ??= options.name ?? _.snakeCase(propertyName);
|
|
2147
2141
|
const metadataStorage = getMetadataStorage();
|
|
2148
2142
|
const columnCollectionOptions = options;
|
|
2149
2143
|
if (columnCollectionOptions.collection || columnCollectionOptions.via) {
|
|
@@ -2202,12 +2196,8 @@ function createDateColumn(dbColumnNameOrOptions, options) {
|
|
|
2202
2196
|
options = dbColumnNameOrOptions;
|
|
2203
2197
|
}
|
|
2204
2198
|
if (dbColumnNameOrOptions) {
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
}
|
|
2208
|
-
if (!dbColumnName) {
|
|
2209
|
-
dbColumnName = options.name ?? _.snakeCase(propertyName);
|
|
2210
|
-
}
|
|
2199
|
+
options ??= {};
|
|
2200
|
+
dbColumnName ??= options.name ?? _.snakeCase(propertyName);
|
|
2211
2201
|
metadataStorage.columns.push(
|
|
2212
2202
|
new ColumnTypeMetadata({
|
|
2213
2203
|
target: object.constructor.name,
|
|
@@ -2240,12 +2230,8 @@ function primaryColumn(dbColumnNameOrOptions, options) {
|
|
|
2240
2230
|
options = dbColumnNameOrOptions;
|
|
2241
2231
|
}
|
|
2242
2232
|
if (dbColumnNameOrOptions) {
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
}
|
|
2246
|
-
if (!dbColumnName) {
|
|
2247
|
-
dbColumnName = options.name ?? _.snakeCase(propertyName);
|
|
2248
|
-
}
|
|
2233
|
+
options ??= {};
|
|
2234
|
+
dbColumnName ??= options.name ?? _.snakeCase(propertyName);
|
|
2249
2235
|
const { type } = options;
|
|
2250
2236
|
const { model } = options;
|
|
2251
2237
|
const metadataStorage = getMetadataStorage();
|
|
@@ -2296,12 +2282,8 @@ function table(dbNameOrTableOptions, options) {
|
|
|
2296
2282
|
} else {
|
|
2297
2283
|
options = dbNameOrTableOptions;
|
|
2298
2284
|
}
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
}
|
|
2302
|
-
if (!options.name) {
|
|
2303
|
-
options.name = dbTableName ?? _.snakeCase(className);
|
|
2304
|
-
}
|
|
2285
|
+
options ??= {};
|
|
2286
|
+
options.name ??= dbTableName ?? _.snakeCase(className);
|
|
2305
2287
|
const metadataStorage = getMetadataStorage();
|
|
2306
2288
|
const modelMetadata = new ModelMetadata({
|
|
2307
2289
|
name: className,
|
|
@@ -2323,12 +2305,8 @@ function updateDateColumn(dbColumnNameOrOptions, options) {
|
|
|
2323
2305
|
options = dbColumnNameOrOptions;
|
|
2324
2306
|
}
|
|
2325
2307
|
if (dbColumnNameOrOptions) {
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
}
|
|
2329
|
-
if (!dbColumnName) {
|
|
2330
|
-
dbColumnName = options.name ?? _.snakeCase(propertyName);
|
|
2331
|
-
}
|
|
2308
|
+
options ??= {};
|
|
2309
|
+
dbColumnName ??= options.name ?? _.snakeCase(propertyName);
|
|
2332
2310
|
const metadataStorage = getMetadataStorage();
|
|
2333
2311
|
metadataStorage.columns.push(
|
|
2334
2312
|
new ColumnTypeMetadata({
|
|
@@ -2363,12 +2341,8 @@ function versionColumn(dbColumnNameOrOptions, options) {
|
|
|
2363
2341
|
options = dbColumnNameOrOptions;
|
|
2364
2342
|
}
|
|
2365
2343
|
if (dbColumnNameOrOptions) {
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
}
|
|
2369
|
-
if (!dbColumnName) {
|
|
2370
|
-
dbColumnName = options.name ?? _.snakeCase(propertyName);
|
|
2371
|
-
}
|
|
2344
|
+
options ??= {};
|
|
2345
|
+
dbColumnName ??= options.name ?? _.snakeCase(propertyName);
|
|
2372
2346
|
const metadataStorage = getMetadataStorage();
|
|
2373
2347
|
metadataStorage.columns.push(
|
|
2374
2348
|
new ColumnTypeMetadata({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bigal",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.8",
|
|
4
4
|
"description": "A fast and lightweight orm for postgres and node.js, written in typescript.",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -33,32 +33,39 @@
|
|
|
33
33
|
"node": ">=18"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@types/pg": "
|
|
37
|
-
"lodash": "
|
|
38
|
-
"pg": "
|
|
39
|
-
"postgres-pool": "
|
|
36
|
+
"@types/pg": "8.11.11",
|
|
37
|
+
"lodash": "4.17.21",
|
|
38
|
+
"pg": "8.14.1",
|
|
39
|
+
"postgres-pool": "10.1.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@faker-js/faker": "
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
42
|
+
"@faker-js/faker": "9.6.0",
|
|
43
|
+
"@semantic-release/changelog": "6.0.3",
|
|
44
|
+
"@semantic-release/commit-analyzer": "13.0.1",
|
|
45
|
+
"@semantic-release/git": "10.0.1",
|
|
46
|
+
"@semantic-release/github": "11.0.1",
|
|
47
|
+
"@semantic-release/npm": "12.0.1",
|
|
48
|
+
"@semantic-release/release-notes-generator": "14.0.3",
|
|
49
|
+
"@types/chai": "5.2.1",
|
|
50
|
+
"@types/lodash": "4.17.16",
|
|
45
51
|
"@types/mocha": "10.0.10",
|
|
46
|
-
"@types/node": "
|
|
47
|
-
"chai": "
|
|
48
|
-
"eslint": "
|
|
49
|
-
"eslint-config-decent": "
|
|
50
|
-
"husky": "
|
|
51
|
-
"lint-staged": "
|
|
52
|
-
"markdownlint-cli": "
|
|
53
|
-
"mocha": "
|
|
54
|
-
"npm-run-
|
|
55
|
-
"pinst": "
|
|
56
|
-
"prettier": "
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"ts-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
52
|
+
"@types/node": "22.14.0",
|
|
53
|
+
"chai": "5.2.0",
|
|
54
|
+
"eslint": "9.24.0",
|
|
55
|
+
"eslint-config-decent": "2.6.4",
|
|
56
|
+
"husky": "9.1.7",
|
|
57
|
+
"lint-staged": "15.5.0",
|
|
58
|
+
"markdownlint-cli": "0.44.0",
|
|
59
|
+
"mocha": "11.1.0",
|
|
60
|
+
"npm-run-all2": "7.0.2",
|
|
61
|
+
"pinst": "3.0.0",
|
|
62
|
+
"prettier": "3.5.3",
|
|
63
|
+
"semantic-release": "24.2.3",
|
|
64
|
+
"strict-event-emitter-types": "2.0.0",
|
|
65
|
+
"ts-mockito": "2.6.1",
|
|
66
|
+
"ts-node": "10.9.2",
|
|
67
|
+
"typescript": "5.8.3",
|
|
68
|
+
"unbuild": "3.5.0"
|
|
62
69
|
},
|
|
63
70
|
"scripts": {
|
|
64
71
|
"build": "unbuild",
|
|
@@ -78,17 +85,11 @@
|
|
|
78
85
|
"prettier --write --cache",
|
|
79
86
|
"markdownlint --config=.github/linters/.markdown-lint.yml --fix"
|
|
80
87
|
],
|
|
81
|
-
"*.js": [
|
|
88
|
+
"*.{js,cjs,mjs,ts}": [
|
|
82
89
|
"eslint --fix"
|
|
83
90
|
],
|
|
84
|
-
"*.
|
|
85
|
-
"
|
|
86
|
-
],
|
|
87
|
-
"*.mjs": [
|
|
88
|
-
"eslint --fix"
|
|
89
|
-
],
|
|
90
|
-
"*.ts": [
|
|
91
|
-
"eslint --fix"
|
|
91
|
+
"*.{json5,yml}": [
|
|
92
|
+
"prettier --write"
|
|
92
93
|
]
|
|
93
94
|
},
|
|
94
95
|
"repository": {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
branches: ['main', 'beta'],
|
|
3
|
+
plugins: [
|
|
4
|
+
[
|
|
5
|
+
'@semantic-release/commit-analyzer',
|
|
6
|
+
{
|
|
7
|
+
preset: 'angular',
|
|
8
|
+
releaseRules: [
|
|
9
|
+
{ type: 'docs', release: 'patch' },
|
|
10
|
+
{ type: 'feat', release: 'minor' },
|
|
11
|
+
{ type: 'fix', release: 'patch' },
|
|
12
|
+
{ type: 'test', release: 'patch' },
|
|
13
|
+
{ type: 'chore', release: 'patch' },
|
|
14
|
+
],
|
|
15
|
+
parserOpts: {
|
|
16
|
+
headerPattern: /^(\w*): (.*)$/,
|
|
17
|
+
headerCorrespondence: ['type', 'subject'],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
'@semantic-release/release-notes-generator',
|
|
22
|
+
[
|
|
23
|
+
'@semantic-release/changelog',
|
|
24
|
+
{
|
|
25
|
+
changelogFile: 'CHANGELOG.md',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
'@semantic-release/npm',
|
|
29
|
+
[
|
|
30
|
+
'@semantic-release/github',
|
|
31
|
+
{
|
|
32
|
+
assets: [],
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
'@semantic-release/git',
|
|
37
|
+
{
|
|
38
|
+
assets: ['CHANGELOG.md', 'package.json', 'package-lock.json'],
|
|
39
|
+
message: `chore: release \${nextRelease.version} [skip ci]\n\n\${nextRelease.notes}`,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
],
|
|
43
|
+
};
|