leoric 2.6.1 → 2.7.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.
package/History.md ADDED
@@ -0,0 +1,771 @@
1
+ 2.7.0 / 2022-08-24
2
+ ==================
3
+
4
+ ## What's Changed
5
+ * fix: glue code for opts.dialectModulePath by @cyjake in https://github.com/cyjake/leoric/pull/326
6
+ * fix: primaryKey in upsert values should be validate in sqlite and postgres by @JimmyDaddy in https://github.com/cyjake/leoric/pull/328
7
+ * feat: change DataTypes to ts and complete decorators type definitions by @JimmyDaddy in https://github.com/cyjake/leoric/pull/319
8
+
9
+
10
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.6.3...v2.7.0
11
+
12
+ 2.6.3 / 2022-08-04
13
+ ==================
14
+
15
+ ## What's Changed
16
+ * fix: aggregator not parse null result by @killagu in https://github.com/cyjake/leoric/pull/322
17
+ * test: switch the auth protocol of test mysql database by @cyjake in https://github.com/cyjake/leoric/pull/323
18
+ * feat: add leoric_bone meta data to Bone by @JimmyDaddy in https://github.com/cyjake/leoric/pull/324
19
+ * docs: fix declarations of findOne(primaryKey) & findOne({ $or }) by @cyjake in https://github.com/cyjake/leoric/pull/325
20
+
21
+
22
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.6.2...v2.6.3
23
+
24
+ 2.6.2 / 2022-07-12
25
+ ==================
26
+
27
+ ## What's Changed
28
+ * fix: format select with out * if use aggreator by @killagu in https://github.com/cyjake/leoric/pull/320
29
+ * fix: fix transaction typing by @killagu in https://github.com/cyjake/leoric/pull/321
30
+
31
+ ## New Contributors
32
+ * @killagu made their first contribution in https://github.com/cyjake/leoric/pull/320
33
+
34
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.6.1...v2.6.2
35
+
36
+ 2.6.1 / 2022-06-24
37
+ ==================
38
+
39
+ ## What's Changed
40
+ * build: switch to latest postgres by @cyjake in https://github.com/cyjake/leoric/pull/316
41
+ * fix: fix [bug] init models with bone class should work #317 by @JimmyDaddy in https://github.com/cyjake/leoric/pull/318
42
+
43
+
44
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.6.0...v2.6.1
45
+
46
+ 2.6.0 / 2022-06-02
47
+ ==================
48
+
49
+ ## What's Changed
50
+ * feat: support export sql query template in logger by @JimmyDaddy in https://github.com/cyjake/leoric/pull/314
51
+ * fix: fix uncast date string without milliseconds error by jsCore in Android/iOS by @JimmyDaddy in https://github.com/cyjake/leoric/pull/315
52
+
53
+
54
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.5.0...v2.6.0
55
+
56
+ 2.5.0 / 2022-05-13
57
+ ==================
58
+
59
+ ## What's Changed
60
+ * feat: support disconnect and fix timestamps init by @JimmyDaddy in https://github.com/cyjake/leoric/pull/313
61
+
62
+
63
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.4.1...v2.5.0
64
+
65
+ 2.4.1 / 2022-04-27
66
+ ==================
67
+
68
+ ## What's Changed
69
+ * fix: realm.Bone.DataTypes should be invokable, Invokable.TYPE.toSqlString() get wrong default length(1), DataType definitions by @JimmyDaddy in https://github.com/cyjake/leoric/pull/307
70
+
71
+
72
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.4.0...v2.4.1
73
+
74
+ 2.4.0 / 2022-04-24
75
+ ==================
76
+
77
+ ## What's Changed
78
+ * feat: support custom driver by @JimmyDaddy in https://github.com/cyjake/leoric/pull/304
79
+ * chore: update build status badge by @snapre in https://github.com/cyjake/leoric/pull/305
80
+ * feat: export more ts type definitions and use deep-equal module by @JimmyDaddy in https://github.com/cyjake/leoric/pull/306
81
+
82
+ ## New Contributors
83
+ * @snapre made their first contribution in https://github.com/cyjake/leoric/pull/305
84
+
85
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.3.2...v2.4.0
86
+
87
+ 2.3.2 / 2022-04-15
88
+ ==================
89
+
90
+ ## What's Changed
91
+ * fix: order by raw with mix-type array in sequelize mode by @JimmyDaddy in https://github.com/cyjake/leoric/pull/298
92
+ * docs: monthly updates and example about egg-orm usage with TypeScript by @cyjake in https://github.com/cyjake/leoric/pull/299
93
+ * docs: monthly updates in en & docmentation about typescript support by @cyjake in https://github.com/cyjake/leoric/pull/300
94
+ * fix: raw query should format replacements with extra blank by @JimmyDaddy in https://github.com/cyjake/leoric/pull/301
95
+ * docs: elaborate on querying by @cyjake in https://github.com/cyjake/leoric/pull/302
96
+ * feat: transaction should return result by @JimmyDaddy in https://github.com/cyjake/leoric/pull/303
97
+
98
+
99
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.3.1...v2.3.2
100
+
101
+ 2.3.1 / 2022-03-22
102
+ ==================
103
+
104
+ ## What's Changed
105
+ * fix: mysql2 Invalid Date compatible by @JimmyDaddy in https://github.com/cyjake/leoric/pull/291
106
+ * fix: order by raw in sequelize mode by @JimmyDaddy in https://github.com/cyjake/leoric/pull/292
107
+ * fix: bulk update query conditions duplicated in sequelize mode by @JimmyDaddy in https://github.com/cyjake/leoric/pull/293
108
+ * fix: bulk destroy query conditions duplicated in sequelize mode by @JimmyDaddy in https://github.com/cyjake/leoric/pull/295
109
+ * fix: drop column if not defined in attributes when alter table by @cyjake in https://github.com/cyjake/leoric/pull/296
110
+
111
+
112
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.3.0...v2.3.1
113
+
114
+ 2.3.0 / 2022-03-10
115
+ ==================
116
+
117
+ ## What's Changed
118
+ * feat: model declaration with decorators by @cyjake in https://github.com/cyjake/leoric/pull/287
119
+ * feat: add VIRTUAL data type by @JimmyDaddy in https://github.com/cyjake/leoric/pull/289
120
+ * fix: create instance dirty check rule fix by @JimmyDaddy in https://github.com/cyjake/leoric/pull/290
121
+
122
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.2.3...v2.3.0
123
+ 2.2.3 / 2022-03-01
124
+ ==================
125
+
126
+ ## What's Changed
127
+ * fix: normalize attribute defaultValue by @cyjake in https://github.com/cyjake/leoric/pull/285
128
+ * fix: instance beforeUpdate hooks should not modify any Raw if there are no Raw assignment in them by @JimmyDaddy in https://github.com/cyjake/leoric/pull/283
129
+
130
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.2.2...v2.2.3
131
+
132
+ 2.2.2 / 2022-02-28
133
+ ==================
134
+
135
+ ## What's Changed
136
+ * fix: tddl gives misleading information_schema.columns.table_name by @cyjake in https://github.com/cyjake/leoric/pull/284
137
+
138
+
139
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.2.1...v2.2.2
140
+
141
+ 2.2.1 / 2022-02-24
142
+ ==================
143
+
144
+ ## What's Changed
145
+ * fix: realm.DataTypes should be invokable by @cyjake in https://github.com/cyjake/leoric/pull/282
146
+
147
+
148
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.2.0...v2.2.1
149
+
150
+ 2.2.0 / 2022-02-24
151
+ ==================
152
+
153
+ ## What's Changed
154
+ * fix: add missing `password` field for `ConnectOptions` by @luckydrq in https://github.com/cyjake/leoric/pull/280
155
+ * feat: integer types (mostly mysql specific) by @cyjake in https://github.com/cyjake/leoric/pull/281
156
+
157
+
158
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.1.1...v2.2.0
159
+
160
+ 2.1.1 / 2022-02-23
161
+ ==================
162
+
163
+ ## What's Changed
164
+ * fix: fix #274 update with fields option by @JimmyDaddy in https://github.com/cyjake/leoric/pull/275
165
+ * fix: upsert should set createdAt by default while createdAt not set by @JimmyDaddy in https://github.com/cyjake/leoric/pull/277
166
+ * fix: previousChanges should check instance is new record or not while specific attributes' values were undefined by @JimmyDaddy in https://github.com/cyjake/leoric/pull/276
167
+ * docs: add types for realm by @luckydrq in https://github.com/cyjake/leoric/pull/278
168
+
169
+ ## New Contributors
170
+ * @luckydrq made their first contribution in https://github.com/cyjake/leoric/pull/278
171
+
172
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.1.0...v2.1.1
173
+
174
+ 2.1.0 / 2022-02-17
175
+ ==================
176
+
177
+ ## What's Changed
178
+ * feat: fix #270 sequelize mode bulkBuild by @JimmyDaddy in https://github.com/cyjake/leoric/pull/273
179
+ * fix: mysql delete/remove/destroy with limit and orders by @JimmyDaddy in https://github.com/cyjake/leoric/pull/272
180
+
181
+
182
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.0.4...v2.1.0
183
+
184
+ 2.0.4 / 2022-02-16
185
+ ==================
186
+
187
+ ## What's Changed
188
+ * fix: fix unit test error by @LB4027221 in https://github.com/cyjake/leoric/pull/269
189
+ * fix: attribute.defaultValue should be set when init attributes by @cyjake in https://github.com/cyjake/leoric/pull/271
190
+
191
+
192
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.0.3...v2.0.4
193
+
194
+ 2.0.3 / 2022-02-11
195
+ ==================
196
+
197
+ ## What's Changed
198
+ * fix: default updatedAt to new date if model has no createdAt by @LB4027221 in https://github.com/cyjake/leoric/pull/268
199
+
200
+ ## New Contributors
201
+ * @LB4027221 made their first contribution in https://github.com/cyjake/leoric/pull/268
202
+
203
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.0.2...v2.0.3
204
+
205
+ 2.0.2 / 2022-02-10
206
+ ==================
207
+
208
+ ## What's Changed
209
+ * fix: order by alias should not throw by @cyjake in https://github.com/cyjake/leoric/pull/255
210
+ * fix: fix #257 DataType.uncast should skip Raw type at type checking by @JimmyDaddy in https://github.com/cyjake/leoric/pull/258
211
+ * docs: async function in transaction by @cyjake in https://github.com/cyjake/leoric/pull/259
212
+ * fix: fixed #256 static create instance should check all default attri… by @JimmyDaddy in https://github.com/cyjake/leoric/pull/262
213
+ * fix: fix #260 UPDATE with LIMIT and ORDER should be formatted(mysql only) by @JimmyDaddy in https://github.com/cyjake/leoric/pull/261
214
+ * refactor: keep the UPDATE ... ORDER BY ... LIMIT to mysql driver by @cyjake in https://github.com/cyjake/leoric/pull/264
215
+ * fix: fix #263 upsert attributes should use defaultValue while there i… by @JimmyDaddy in https://github.com/cyjake/leoric/pull/265
216
+ * fix: fix restore Error `Undefined attribute "deletedAt"` by @JimmyDaddy in https://github.com/cyjake/leoric/pull/267
217
+ * fix: type checking adaption by @JimmyDaddy in https://github.com/cyjake/leoric/pull/266
218
+
219
+
220
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.0.1...v2.0.2
221
+
222
+ 2.0.1 / 2022-01-05
223
+ ==================
224
+
225
+ ## What's Changed
226
+ * fix: format numeric result by @JimmyDaddy in https://github.com/cyjake/leoric/pull/253
227
+ * fix: should still return number if value is '0.000' by @cyjake in https://github.com/cyjake/leoric/pull/254
228
+
229
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.15.1...v2.0.1
230
+
231
+ 2.0.0 / 2021-12-28
232
+ ==================
233
+
234
+ ## What's Changed
235
+ * breaking: model.sync add force/alter option by @SmartOrange in https://github.com/cyjake/leoric/pull/224
236
+ * breaking: logQueryError(err, sql, duration, options) by @cyjake in https://github.com/cyjake/leoric/pull/237
237
+ * test: add utf8mb4 test cases by @fengmk2 in https://github.com/cyjake/leoric/pull/239
238
+ * Merge 1.x changes by @cyjake in https://github.com/cyjake/leoric/pull/249
239
+
240
+ ## New Contributors
241
+ * @SmartOrange made their first contribution in https://github.com/cyjake/leoric/pull/222
242
+
243
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.15.1...v2.0.0
244
+
245
+ 1.15.1 / 2021-12-28
246
+ ===================
247
+
248
+ ## What's Changed
249
+ * fix: fix #242 date string format by @JimmyDaddy in https://github.com/cyjake/leoric/pull/243
250
+ * fix: update with empty conditions by @JimmyDaddy in https://github.com/cyjake/leoric/pull/241
251
+ * fix: silent option's priority should be lower than valueSet by @JimmyDaddy in https://github.com/cyjake/leoric/pull/244
252
+ * fix: information_schema.columns.datetime_precision by @cyjake in https://github.com/cyjake/leoric/pull/246
253
+ * fix: should not hoist subquery if query is ordered by external columns by @cyjake in https://github.com/cyjake/leoric/pull/247
254
+
255
+
256
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.15.0...v1.15.1
257
+
258
+ 1.15.0 / 2021-11-22
259
+ ===================
260
+
261
+ ## What's Changed
262
+ * feat: make duration in precise milliseconds by @fengmk2 in https://github.com/cyjake/leoric/pull/236
263
+ * fix: spell.increment() & spell.decrement() @cyjake https://github.com/cyjake/leoric/pull/234
264
+ * fix: bulkCreate should adapte empty data @JimmyDaddy https://github.com/cyjake/leoric/pull/232
265
+
266
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.14.4...v1.14.5
267
+
268
+ 1.14.4 / 2021-11-15
269
+ ===================
270
+
271
+ ## What's Changed
272
+
273
+ * test: PostgreSQL v14 test case compatibility by @cyjake https://github.com/cyjake/leoric/pull/230
274
+ * fix: turn off subquery optimization if query criteria contains other column by @cyjake https://github.com/cyjake/leoric/pull/229
275
+ * fix: bone.changed() return `false | string[]` type by @fengmk2 https://github.com/cyjake/leoric/pull/231
276
+
277
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.14.3...v1.14.4
278
+
279
+ 1.14.3 / 2021-11-12
280
+ ===================
281
+
282
+ ## What's Changed
283
+ * fix: logger.logQuery should be guarded in case of error by @SmartOrange in https://github.com/cyjake/leoric/pull/222
284
+ * fix: findOne without result should return null by @JimmyDaddy in https://github.com/cyjake/leoric/pull/225
285
+ * fix: Literal should support bigint type by @fengmk2 in https://github.com/cyjake/leoric/pull/226
286
+ * fix: select((name: string) => boolean) by @cyjake in https://github.com/cyjake/leoric/pull/227
287
+
288
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.14.2...v1.14.3
289
+
290
+ 1.14.2 / 2021-11-01
291
+ ===================
292
+
293
+ ## What's Changed
294
+ * fix: accept timestamps in snake case by @cyjake in https://github.com/cyjake/leoric/pull/221
295
+
296
+
297
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.14.1...v1.14.2
298
+
299
+ 1.14.1 / 2021-11-01
300
+ ===================
301
+
302
+ ## What's Changed
303
+ * docs: export { Collection } by @cyjake in https://github.com/cyjake/leoric/pull/220
304
+
305
+
306
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.14.0...v1.14.1
307
+
308
+ 1.14.0 / 2021-11-01
309
+ ===================
310
+
311
+ Two options regarding `Model.init()` were added in this release:
312
+
313
+ ```js
314
+ class User extends Bone {}
315
+ User.init({ name: STRING }, {
316
+ timestamps: true, // which is the default
317
+ paranoid: true, // which default to `false`
318
+ });
319
+ assert.deepEqual(Object.keys(User.attributes), [
320
+ 'id',
321
+ 'name',
322
+ 'createdAt',
323
+ 'updatedAt',
324
+ 'deletedAt',
325
+ ]);
326
+ ```
327
+
328
+ ## What's Changed
329
+ * docs: update 'primayKey' typos by @freshgum-bubbles in https://github.com/cyjake/leoric/pull/211
330
+ * docs: DataTypes definitions in d.ts by @cyjake in https://github.com/cyjake/leoric/pull/210
331
+ * fix: fix#209 sequelize mode should update all changed fields in instance update method by @JimmyDaddy in https://github.com/cyjake/leoric/pull/212
332
+ * fix: fix #213 findAndCountAll should ignore attributes by @JimmyDaddy in https://github.com/cyjake/leoric/pull/214
333
+ * fix: opts.connectTimeout by @cyjake in https://github.com/cyjake/leoric/pull/216
334
+ * fix: reload instance with sharding key should not throw by @cyjake in https://github.com/cyjake/leoric/pull/217
335
+ * feat: timestamps should be defined by default by @cyjake in https://github.com/cyjake/leoric/pull/218
336
+ * fix: instance.reload() should not rely on `static findOne()` by @cyjake in https://github.com/cyjake/leoric/pull/219
337
+
338
+ ## New Contributors
339
+ * @freshgum-bubbles made their first contribution in https://github.com/cyjake/leoric/pull/211
340
+
341
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.13.5...v1.14.0
342
+
343
+ 1.13.5 / 2021-10-26
344
+ ===================
345
+
346
+ ## What's Changed
347
+ * docs: enhance aggregation query types & fix raw query result type by @cyjake in https://github.com/cyjake/leoric/pull/208
348
+
349
+
350
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.13.4...v1.13.5
351
+
352
+ 1.13.4 / 2021-10-25
353
+ ===================
354
+
355
+ ## What's Changed
356
+ * docs: spell & model methods should be generic by @cyjake in https://github.com/cyjake/leoric/pull/206
357
+ * docs: enhance query options, instance type, and toJSON() result type by @cyjake in https://github.com/cyjake/leoric/pull/207
358
+
359
+ This version brings correct (and hopefully better) typescript definitions, with the dts checked continuously at test/types tests. With this version, users that have model types correctly pinned at Bone will get code completion including class fields. Such as:
360
+
361
+ ![image](https://user-images.githubusercontent.com/252317/138683240-98ee9e79-4b3e-449c-bc95-a449d457d64f.png)
362
+
363
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.13.3...v1.13.4
364
+
365
+ 1.13.3 / 2021-10-21
366
+ ===================
367
+
368
+ ## What's Changed
369
+ * refactor: persist edge cases of type casting in integration tests by @cyjake in https://github.com/cyjake/leoric/pull/202
370
+ * docs: renaming attributes by @cyjake in https://github.com/cyjake/leoric/pull/203
371
+ * fix: JSON.uncast(string) should not serialize twice by @cyjake in https://github.com/cyjake/leoric/pull/205
372
+
373
+
374
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.13.2...v1.13.3
375
+
376
+ 1.13.2 / 2021-10-18
377
+ ===================
378
+
379
+ ## What's Changed
380
+ * fix: attribute.uncast([]) and realm.connect with synchronized models by @cyjake in https://github.com/cyjake/leoric/pull/201
381
+
382
+
383
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.13.1...v1.13.2
384
+
385
+ 1.13.1 / 2021-10-18
386
+ ===================
387
+
388
+ ## What's Changed
389
+ * fix: skip connecting if models are synchronized already by @cyjake in https://github.com/cyjake/leoric/pull/200
390
+
391
+
392
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.13.0...v1.13.1
393
+
394
+ 1.13.0 / 2021-10-18
395
+ ===================
396
+
397
+ ## What's Changed
398
+ * docs: monthly updates of 2021.09; support dark mode by @cyjake in https://github.com/cyjake/leoric/pull/196
399
+ * feat: coerce literal values into accurate attribute type by @cyjake in https://github.com/cyjake/leoric/pull/197
400
+ * fix: dispatched result should be in attribute names by @cyjake in https://github.com/cyjake/leoric/pull/198
401
+
402
+
403
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v1.12.0...v1.13.0
404
+
405
+ 1.12.0 / 2021-10-12
406
+ ===================
407
+
408
+ * feat: support custom fields query and sequelize mode export rawAttributes (#192)
409
+ * refactor: collection format query result (#194)
410
+ * refactor: object condition parsing and expression formatting (#191)
411
+
412
+ 1.11.1 / 2021-09-28
413
+ ===================
414
+
415
+ This version fixes lots of issues regarding logical operator in object conditions.
416
+
417
+ * fix: logical operator with multiple conditions such as (#190)
418
+ * fix: sequelize mode support HAVING, and select fields raw sql support (#187)
419
+ * fix: support len validator (#188)
420
+ * fix: normalize logical operator conditions before formatting with spellbook (#186)
421
+
422
+ 1.11.0 / 2021-09-24
423
+ ===================
424
+
425
+ * feat: support BINARY(length), VARBINARY(length), and BLOB (#169)
426
+ * fix: logic operate should adapt one argument (#183)
427
+ * fix: Bone.load() should be idempotent, make sure associations is intact (#184)
428
+ * fix: selected instance isNewRecord is false (#182)
429
+ * fix: set options.busyTimeout to mitigate SQLITE_BUSY (#176)
430
+ * fix: turn on long stack trace of sqlite driver (#175)
431
+ * docs: how to contribute (#180)
432
+
433
+ 1.10.0 / 2021-09-14
434
+ ===================
435
+
436
+ * feat: SQLite driver should emit "connection" event when new connection is created (#168)
437
+ * fix: bulkCreate(...records) should recognize custom setters (#168)
438
+ * fix: attribute.equals() check should ignore defaultValue (#172)
439
+
440
+ 1.9.0 / 2021-09-04
441
+ ==================
442
+
443
+ > should've been a major release but since existing users have all migrated to the new api...
444
+
445
+ * breaking: drop the deprecated `Model.describe()` (#167)
446
+
447
+ 1.8.0 / 2021-08-30
448
+ ==================
449
+
450
+ * feat: silent option fix #164 (#165)
451
+ * feat: binary type (#166)
452
+
453
+ 1.7.1 / 2021-08-17
454
+ ==================
455
+
456
+ * revert: drop Driver#recycleConnections due to poor interoperability (#162)
457
+ * fix: validator call array arguments (#160)
458
+
459
+ 1.7.0 / 2021-08-17
460
+ =================
461
+
462
+ * feat: close connections that exceeds opts.idleTimeout (#159)
463
+ * feat: `opts.connectionLimit` support for SQLite (#159)
464
+ * feat: raw query relpacements, closes #149 (#155)
465
+ * fix: upsert created_at default (#154)
466
+ * test: validator unit test (#157)
467
+ * test: setup_hooks unit test (#158)
468
+
469
+ 1.6.7 / 2021-08-05
470
+ ==================
471
+
472
+ * fix: prevent from calling Date.prototype.toJSON (#153)
473
+
474
+ 1.6.6 / 2021-07-22
475
+ ==================
476
+
477
+ * fix: subclassing data type in dialects (#145)
478
+ * fix: where('width / height >= 16 / 9') (#144)
479
+ * docs: logging and sequelzie adapter (zh) (#142)
480
+ * test: include test/unit/utils (#143)
481
+ * test: more tests cases about sequelize adapter (#141)
482
+
483
+ 1.6.5 / 2021-07-16
484
+ ==================
485
+
486
+ * fix: define assign Bone.models #140
487
+
488
+ 1.6.4 / 2021-07-16
489
+ ==================
490
+
491
+ * refactor: connect({ Bone }) still necessary (#139)
492
+ * fix: formatting select join with subqueries should not tamper the subquery itself (#138)
493
+ * fix: describe table with more compatible syntax (#137)
494
+
495
+ 1.6.3 / 2021-07-14
496
+ ==================
497
+
498
+ * fix: transaction option passing in sequelize adapter (#136)
499
+ * fix: this.Model and proper Model.describe() (#135)
500
+
501
+ 1.6.2 / 2021-07-09
502
+ ==================
503
+
504
+ * fix: convert datetime in seconds/milliseconds back to Date (#134)
505
+ * fix: renamed attribute should remain enumerable (#133)
506
+
507
+ 1.6.1 / 2021-07-07
508
+ ==================
509
+
510
+ * fix: collection convert should handle tddl results as well (#132)
511
+
512
+ 1.6.0 / 2021-07-06
513
+ ==================
514
+
515
+ * feat: support class static attributes and hooks (#131)
516
+ * fix: names defined in Bone.attributes should always be enumerable (#128)
517
+ * chore: add quality badge to readme (#129)
518
+
519
+ 1.5.2 / 2021-07-02
520
+ ==================
521
+
522
+ * fix: leave the getter properties defined in class syntax as is (#127)
523
+
524
+ 1.5.1 / 2021-06-30
525
+ ==================
526
+
527
+ * fix: export Logger and Spell to let users intercept lower level api calls (#126)
528
+
529
+ 1.5.0 / 2021-06-30
530
+ ==================
531
+
532
+ * feat: provide Bone.pool to be backward compatible with v0.x (#124)
533
+ * feat: complete bone/spine.restore and Bone API type definitions (#125)
534
+ * feat: support more data types (mediumtext, mediumint, char, date...) (#123)
535
+
536
+ 1.4.1 / 2021-06-25
537
+ ==================
538
+
539
+ * refactor: simplify legacy timestamps support (#120)
540
+ * refactor: do not subclass Bone unless asked specifically (#120)
541
+
542
+ 1.4.0 / 2021-06-24
543
+ ==================
544
+
545
+ * feat: `realm.raw('SELECT ...')` and `Model.raw('SELECT ...')` (#94)
546
+ * feat: support multiple order rules in one single string or one-dimensional array (#92)
547
+ * feat: `Model.truncate()` now uses TRUNCATE if possible
548
+ * feat: `Model.find().optimizerHints('SET_VAR(foreign_key_checks=OFF)')`
549
+ * fix: Bone.bulkCreate() should not throw when called with non attribute (#117)
550
+ * fix: batch upsert (#108)
551
+ * fix: make sure connection is passed around in all queries carried out within transaction (#105)
552
+ * fix: update, sequelize mode get API, destroy compitable (#104)
553
+ * fix: `setDataValue` in sequelize adapter should not check prop name strictly
554
+ * refactor: spell_insert (#118)
555
+ * docs: about egg-orm & migrations (#119)
556
+ * docs: revise instructions for installing Jekyll (#111)
557
+ * docs: migrations, validations, hooks, and sequelize adapter (#103)
558
+ * docs: contributing guides
559
+
560
+ 1.3.0 / 2021-03-01
561
+ ==================
562
+
563
+ * feat: hook support
564
+ * feat: dirty check (`changes()` & `previousChanges()`)
565
+ * feat: compatible with mysql longtext conversion
566
+ * feat: NOT condition
567
+
568
+ 1.2.0 / 2020-12-10
569
+ ==================
570
+
571
+ * feat: `Realm.prototype.transaction()` with async function support
572
+ * feat: `Realm.prototype.query()` for raw queries
573
+ * feat: `logger.logQuery(sql, duration, { Model, command })`
574
+ * feat: `logger.logQueryError(sql, err, duration, { Model, command })`
575
+
576
+ 1.1.0 / 2020-11-23
577
+ ==================
578
+
579
+ * feat: JSON and JSONB data types
580
+ * feat: support `stringifyObjects` option for mysql client
581
+ * feat: aggregate functions for sequelize adapter
582
+ * feat: `Spell.prototype.nodeify()`
583
+
584
+ 1.0.3 / 2020-03-16
585
+ ==================
586
+
587
+ * fix: replace `deep-equal` (which is bloated) with `util.isDeepStrictEqual`
588
+
589
+ 1.0.2 / 2020-03-04
590
+ ==================
591
+
592
+ * fix: driver.alterTable() with multiple columns to add in SQLite
593
+
594
+ 1.0.1 / 2020-02-25
595
+ ==================
596
+
597
+ * fix: bulkCreate in sequelize shim
598
+
599
+ 1.0.0 / 2020-02-24
600
+ ==================
601
+
602
+ First major release. Let's get serious with semver.
603
+
604
+ * feat: logger.logQuery(sql, duration) & logger.logQueryError(sql, err)
605
+
606
+ 0.5.3 / 2020-02-22
607
+ ==================
608
+
609
+ * fix: `connect({ sequelize, dialect, client })` to allow mandatory sqlite client
610
+ * fix: prevent queries being performed unless model is correctly connected
611
+
612
+ 0.5.2 / 2020-02-21
613
+ ==================
614
+
615
+ * fix: drop the default and unused `require('sqlite3')`
616
+
617
+ 0.5.1 / 2020-02-21
618
+ ==================
619
+
620
+ * fix: `connect({ client: '@journeyapps/sqlcipher' })`
621
+
622
+ 0.5.0 / 2020-02-19
623
+ ==================
624
+
625
+ * feat: `Bone.sync()` to synchronize model with database
626
+ * feat: `Bone.createMigrationFile()` to create migration file
627
+ * feat: `Bone.migrate()` to run migrations
628
+ * feat: `Bone.bulkCreate()` to bulk insert records
629
+ * feat: `require('leoric')` now exports `Realm` to connect with multiple databases
630
+ * feat: `realm.define()` to define models in an old fashioned way
631
+ * feat: `realm.connect()` to connect with database
632
+ * feat: SQLite support without hacking node-sqlite3
633
+ * feat: `Bone.DataTypes` for type references
634
+ * feat: `Bone.init()` to initialize models
635
+ * feat: an adaptor to use Leoric in (partially) Sequelize complaint API
636
+ * refactor: a complete re-write of JOIN queries
637
+ * refactor: added `Bone.driver` to better encapsulate and planish database nuances
638
+
639
+ 0.4.5 / 2019-12-14
640
+ ==================
641
+
642
+ * fix: prevent primary key from being overridden with incorrect `LAST_INSERT_ID()`
643
+
644
+ 0.4.4 / 2019-07-15
645
+ ==================
646
+
647
+ * fix: append default scope when declaring relations, fixes #10
648
+
649
+ 0.4.3 / 2019-05-09
650
+ ==================
651
+
652
+ * fix: prevent Bone.dispatch from creating duplicated records of main table
653
+
654
+ 0.4.2 / 2019-04-26
655
+ ==================
656
+
657
+ * feat: `Spell#orWhere()` and `Spell#orHaving()`
658
+ * feat: arithmetic operators
659
+ * feat: unary operators such as unary minus `-` and bit invertion `~`
660
+ * fix: unset attribute should be overwritable
661
+ * fix: `attributeChanged()` should be false if attribute is unset and not overwritten
662
+ * fix: subclass with incomplete getter/setter should be complemented
663
+ * fix: sharding key validation on `Bone.update()` and `Bone.save()`
664
+ * fix: sharding key should be along with primary key on `bone.remove()`
665
+ * fix: `Bone.cast()` should leave `null` as is
666
+ * fix: `INSERT ... UPDATE` with `id = LAST_INSERT_ID(id)` in MySQL
667
+ * fix: `Model.find({ name: { $op1, $op2 } })` object conditions with multiple operators
668
+ * fix: prefixing result set with qualifiers if query contains join relations and is not dispatchable
669
+ * fix: `Spell#$get(index)` with LIMIT
670
+ * doc: `Model.transaction()`
671
+ * doc: definition types with `index.d.ts`
672
+
673
+ 0.4.1 / 2019-03-21
674
+ ==================
675
+
676
+ * feat: premature sharding key validation
677
+ * fix: output complete SQL instead of parameterized query with values.
678
+ * fix: both `connect({ model })` and `connect({ models })` are allowed.
679
+ * doc: no more `.findOrCreate()`, just `.upsert()`
680
+ * doc: table of contents with kramdown's `{:toc}`
681
+ * chore: droped experimental sqlite3 support
682
+
683
+ 0.4.0 / 2018-11-05
684
+ ==================
685
+
686
+ * feat: PostgreSQL support
687
+ * feat: Transaction support
688
+ * upgrade: (forked) SQLite client updated to SQLite 3.24
689
+
690
+
691
+ 0.3.0 / 2018-10-31
692
+ ==================
693
+
694
+ * feat: SQLite support with a [forked sqlite3](https://github.com/cyjake/node-sqlite3)
695
+ * feat: mysql2 support (which is trivial since both mysql and mysql2 share the same API)
696
+ * refactor: Spell now formats SQL with the literals separated, which gets escaped by the corresponding client itself later on.
697
+
698
+ 0.2.0 / 2018-01-03
699
+ ==================
700
+
701
+ * breaking: renaming
702
+
703
+ 0.1.8 / 2017-12-31
704
+ ==================
705
+
706
+ * fix: implement `query.batch()` as async iterator
707
+ * fix: `NOT (expr)`
708
+ * fix: `IFNULL(foo, default)`
709
+ * fix: support `.select(name[])`, `.select(name => {})`, and `.select("...name")`
710
+ * doc: `Model => className` in association options
711
+ * doc: use [jsdoc](http://usejsdoc.org) to generate docs/api
712
+ * doc: `.include()`
713
+
714
+ 0.1.7 / 2017-12-22
715
+ ==================
716
+
717
+ * refactor: `{ type: 'op', name: 'as' }` renamed to `{ type: 'alias' }`
718
+ * feat: `{ type: 'mod' }` for modifier, currently only `DISTINCT` is recognized
719
+ * feat: unary operators like `!` and `NOT`
720
+ * feat: `IS` and `IS NOT`
721
+ * fix: logic operator precendences
722
+ * fix: polymorphic hasMany({ through }) relations
723
+ * fix: dispatching multiple results with joins correctly
724
+
725
+ 0.1.6 / 2017-12-21
726
+ ==================
727
+
728
+ * feat: proper `.first`, `.last`, `.all`, and `.get(index)`
729
+ * fix: accept `Date`, `boolean`, and `Set` values
730
+ * fix: `Model.unscoped`
731
+ * fix: `Model.remove({}, true)` should be unscoped
732
+
733
+ 0.1.5 / 2017-12-20
734
+ ==================
735
+
736
+ * refactor: encapsulate column names. Keep them from the users even if the query results can not be dispatched.
737
+ * fix: complicated groups with joins should discard the use of subquery.
738
+ * fix: camelCase should replace globally
739
+ * fix: avoid missing attribtue exception when toJSON/toObject
740
+
741
+ 0.1.4 / 2017-12-18
742
+ ==================
743
+
744
+ * fix: should format condition arrays by hand instead of hand it over to formatExpr
745
+ * fix: whereConditions of subquery should retain the order of the whereConditions in major query
746
+ * fix: calculated columns should be kept in the final columns when sorting out the attributes
747
+ * fix: doesn't depend on co anymore
748
+
749
+ 0.1.3 / 2017-12-17
750
+ ==================
751
+
752
+ * fix: `select distict foo from table`;
753
+ * fix: `where (a = 1 or a = 2) and b = 3`;
754
+ * doc: a syntax table to provide a better glance over the querying ability.
755
+
756
+ 0.1.2 / 2017-12-14
757
+ ==================
758
+
759
+ * fix: copy left table's orders into subquery to make order/limit work when combined.
760
+ * fix: errors should be thrown when accessing attributes that weren't selected at the first place.
761
+
762
+ 0.1.1 / 2017-12-13
763
+ ==================
764
+
765
+ * refactor: automatic versioning on spells. When client calls query methods with chaining, new versions of spell gets duplicated. Makes reuse of spells possible.
766
+ * doc: english verion is almost complete <http://cyj.me/leoric>.
767
+
768
+ 0.1.0 / 2017-12-09
769
+ ==================
770
+
771
+ * Initial version, covers basic usage such as model authoring, database connection, query interface, and association.