tspace-mysql 1.2.9 → 1.3.1
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/README.md +64 -14
- package/dist/cli/dump/db.d.ts +4 -4
- package/dist/cli/dump/db.js +25 -25
- package/dist/cli/generate/make.d.ts +4 -4
- package/dist/cli/generate/make.js +45 -45
- package/dist/cli/generate/model.d.ts +2 -2
- package/dist/cli/generate/model.js +6 -6
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +58 -58
- package/dist/cli/migrate/make.d.ts +4 -4
- package/dist/cli/migrate/make.js +30 -30
- package/dist/cli/models/make.d.ts +4 -4
- package/dist/cli/models/make.js +51 -51
- package/dist/cli/models/model.d.ts +2 -2
- package/dist/cli/models/model.js +20 -11
- package/dist/cli/query/index.d.ts +4 -4
- package/dist/cli/query/index.js +7 -7
- package/dist/cli/tables/make.d.ts +4 -4
- package/dist/cli/tables/make.js +26 -26
- package/dist/cli/tables/table.d.ts +2 -2
- package/dist/cli/tables/table.js +6 -6
- package/dist/lib/connection/index.d.ts +30 -30
- package/dist/lib/connection/index.js +144 -143
- package/dist/lib/connection/options.d.ts +15 -4
- package/dist/lib/connection/options.js +43 -42
- package/dist/lib/constants/index.d.ts +5 -8
- package/dist/lib/constants/index.js +162 -158
- package/dist/lib/index.d.ts +8 -8
- package/dist/lib/index.js +36 -36
- package/dist/lib/tspace/{AbstractDatabase.d.ts → AbstractBuilder.d.ts} +124 -116
- package/dist/lib/tspace/{AbstractDatabase.js → AbstractBuilder.js} +36 -34
- package/dist/lib/tspace/AbstractDB.d.ts +18 -18
- package/dist/lib/tspace/AbstractDB.js +11 -11
- package/dist/lib/tspace/AbstractModel.d.ts +41 -41
- package/dist/lib/tspace/AbstractModel.js +11 -11
- package/dist/lib/tspace/Blueprint.d.ts +136 -136
- package/dist/lib/tspace/Blueprint.js +228 -228
- package/dist/lib/tspace/{Database.d.ts → Builder.d.ts} +833 -706
- package/dist/lib/tspace/{Database.js → Builder.js} +2556 -2363
- package/dist/lib/tspace/DB.d.ts +152 -126
- package/dist/lib/tspace/DB.js +373 -264
- package/dist/lib/tspace/Interface.d.ts +110 -109
- package/dist/lib/tspace/Interface.js +2 -2
- package/dist/lib/tspace/Logger.d.ts +8 -8
- package/dist/lib/tspace/Logger.js +49 -49
- package/dist/lib/tspace/Model.d.ts +708 -609
- package/dist/lib/tspace/Model.js +2520 -2477
- package/dist/lib/tspace/ProxyHandler.d.ts +14 -14
- package/dist/lib/tspace/ProxyHandler.js +31 -31
- package/dist/lib/tspace/Schema.d.ts +8 -8
- package/dist/lib/tspace/Schema.js +45 -44
- package/dist/lib/tspace/index.d.ts +15 -15
- package/dist/lib/tspace/index.js +20 -20
- package/dist/lib/utils/index.d.ts +15 -15
- package/dist/lib/utils/index.js +155 -165
- package/package.json +2 -4
|
@@ -1,609 +1,708 @@
|
|
|
1
|
-
import { AbstractModel } from './AbstractModel';
|
|
2
|
-
import { Relation, Pagination, RelationQuery } from './Interface';
|
|
3
|
-
declare class Model extends AbstractModel {
|
|
4
|
-
constructor();
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* define for initialize of models
|
|
8
|
-
* @return {void} void
|
|
9
|
-
*/
|
|
10
|
-
protected define(): void;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* @return {
|
|
15
|
-
*/
|
|
16
|
-
protected
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* Assign
|
|
20
|
-
* @return {this} this
|
|
21
|
-
*/
|
|
22
|
-
protected
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @return {this} this
|
|
27
|
-
*/
|
|
28
|
-
protected
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* @return {this} this
|
|
39
|
-
*/
|
|
40
|
-
protected
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* @
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* @
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* @
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
*
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
*
|
|
107
|
-
* @param {
|
|
108
|
-
* @return {
|
|
109
|
-
|
|
110
|
-
protected
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
*
|
|
118
|
-
* @param
|
|
119
|
-
* @
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
*
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* @
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
*
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
*
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
*
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
*
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
*
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* @
|
|
194
|
-
* @
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
*
|
|
201
|
-
* @param
|
|
202
|
-
* @
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* @
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
* @
|
|
216
|
-
* @
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
*
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
*
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* @
|
|
231
|
-
* @
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
*
|
|
237
|
-
* @
|
|
238
|
-
* @
|
|
239
|
-
* @property {class} model
|
|
240
|
-
* @property {string
|
|
241
|
-
* @property {string
|
|
242
|
-
* @property {string
|
|
243
|
-
* @
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
*
|
|
251
|
-
* @
|
|
252
|
-
* @
|
|
253
|
-
* @property {
|
|
254
|
-
* @property {string
|
|
255
|
-
* @
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
*
|
|
260
|
-
* @
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
*
|
|
265
|
-
* @
|
|
266
|
-
* @
|
|
267
|
-
* @
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
*
|
|
272
|
-
* @
|
|
273
|
-
* @
|
|
274
|
-
* @
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
*
|
|
279
|
-
* @
|
|
280
|
-
* @
|
|
281
|
-
* @
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
*
|
|
286
|
-
* @
|
|
287
|
-
* @
|
|
288
|
-
* @
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
*
|
|
293
|
-
* @
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
*
|
|
303
|
-
* @
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
*
|
|
308
|
-
* @
|
|
309
|
-
* @return
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
*
|
|
314
|
-
* @
|
|
315
|
-
* @
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
*
|
|
320
|
-
* @
|
|
321
|
-
* @
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
*
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
*
|
|
332
|
-
* @
|
|
333
|
-
* @
|
|
334
|
-
* @
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
*
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
*
|
|
347
|
-
* @
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
*
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
*
|
|
360
|
-
* @
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
*
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
*
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
*
|
|
392
|
-
* @
|
|
393
|
-
* @return {promise<
|
|
394
|
-
*/
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
*
|
|
400
|
-
* @
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
*
|
|
406
|
-
* @
|
|
407
|
-
* @return {promise<
|
|
408
|
-
*/
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
*
|
|
426
|
-
* @
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
*
|
|
432
|
-
* @
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
*
|
|
438
|
-
* @
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
*
|
|
445
|
-
* @
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
*
|
|
453
|
-
* @
|
|
454
|
-
* @return {promise<
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
*
|
|
474
|
-
* @
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
*
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
*
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
*
|
|
491
|
-
* @
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
*
|
|
497
|
-
* @
|
|
498
|
-
* @
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
*
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
*
|
|
539
|
-
*
|
|
540
|
-
* @
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
*
|
|
556
|
-
* @
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
*
|
|
565
|
-
* @
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
|
|
1
|
+
import { AbstractModel } from './AbstractModel';
|
|
2
|
+
import { Relation, Pagination, RelationQuery } from './Interface';
|
|
3
|
+
declare class Model extends AbstractModel {
|
|
4
|
+
constructor();
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* define for initialize of models
|
|
8
|
+
* @return {void} void
|
|
9
|
+
*/
|
|
10
|
+
protected define(): void;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* boot for initialize of models
|
|
14
|
+
* @return {void} void
|
|
15
|
+
*/
|
|
16
|
+
protected boot(): void;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* Assign function callback in model
|
|
20
|
+
* @return {this} this
|
|
21
|
+
*/
|
|
22
|
+
protected useRegistry(): this;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* Assign model calling all relationships in model
|
|
26
|
+
* @return {this} this
|
|
27
|
+
*/
|
|
28
|
+
protected useLoadRelationInRegistry(): this;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* Assign model built-in relation functions to a results
|
|
32
|
+
* @return {this} this
|
|
33
|
+
*/
|
|
34
|
+
protected useBuiltInRelationFunctions(): this;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* Assign primary column in model
|
|
38
|
+
* @return {this} this
|
|
39
|
+
*/
|
|
40
|
+
protected usePrimaryKey(primary: string): this;
|
|
41
|
+
/**
|
|
42
|
+
* Assign generate uuid when creating in model
|
|
43
|
+
* @param {string?} column [column=uuid] make new name column for custom column replace uuid with this
|
|
44
|
+
* @return {this} this
|
|
45
|
+
*/
|
|
46
|
+
protected useUUID(column?: string): this;
|
|
47
|
+
/**
|
|
48
|
+
* Assign in model console.log raw sql when fetching query statement
|
|
49
|
+
* @return {this} this
|
|
50
|
+
*/
|
|
51
|
+
protected useDebug(): this;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* Assign in model use pattern [snake_case , camelCase]
|
|
55
|
+
* @param {string} pattern
|
|
56
|
+
* @return {this} this
|
|
57
|
+
*/
|
|
58
|
+
protected usePattern(pattern: string): this;
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* Assign in model show data not be deleted
|
|
62
|
+
* Relations has reference this method
|
|
63
|
+
* @param {string?} column
|
|
64
|
+
* @return {this} this
|
|
65
|
+
*/
|
|
66
|
+
protected useSoftDelete(column?: string): this;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* Assign timestamp when insert || updated created_at and update_at in table
|
|
70
|
+
* @param {object} timestampFormat
|
|
71
|
+
* @property {string} timestampFormat.createdAt - change new name column replace by default [created at]
|
|
72
|
+
* @property {string} timestampFormat.updatedAt - change new name column replace by default updated at
|
|
73
|
+
* @return {this} this
|
|
74
|
+
*/
|
|
75
|
+
protected useTimestamp(timestampFormat?: {
|
|
76
|
+
createdAt: string;
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
}): this;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* Assign table name in model
|
|
82
|
+
* @param {string} table table name in database
|
|
83
|
+
* @return {this} this
|
|
84
|
+
*/
|
|
85
|
+
protected useTable(table: string): this;
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
* Assign table name in model with signgular pattern
|
|
89
|
+
* @return {this} this
|
|
90
|
+
*/
|
|
91
|
+
protected useTableSingular(): this;
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* Assign table name in model with pluarl pattern
|
|
95
|
+
* @return {this} this
|
|
96
|
+
*/
|
|
97
|
+
protected useTablePlural(): this;
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* Assign schema column in model for validation data types
|
|
101
|
+
* @param {Object<Function>} schema types (String Number and Date)
|
|
102
|
+
* @return {this} this
|
|
103
|
+
*/
|
|
104
|
+
protected useSchema(schema: Record<string, Function>): this;
|
|
105
|
+
/**
|
|
106
|
+
* Assign hook function when execute returned results to callback function
|
|
107
|
+
* @param {Function} arrayFunction function for callback result
|
|
108
|
+
* @return {this}
|
|
109
|
+
*/
|
|
110
|
+
protected useHook(functions: Array<Function>): this;
|
|
111
|
+
/**
|
|
112
|
+
* exceptColumns for method except
|
|
113
|
+
* @return {promise<string>} string
|
|
114
|
+
*/
|
|
115
|
+
protected exceptColumns(): Promise<string>;
|
|
116
|
+
/**
|
|
117
|
+
* Build method for relation in model
|
|
118
|
+
* @param {string} name name relation registry in your model
|
|
119
|
+
* @param {Function} callback query callback
|
|
120
|
+
* @return {this} this
|
|
121
|
+
*/
|
|
122
|
+
protected buildMethodRelation(name: string, callback?: Function): this;
|
|
123
|
+
/**
|
|
124
|
+
*
|
|
125
|
+
* Clone instance of model
|
|
126
|
+
* @param {Model} instance instance of model
|
|
127
|
+
* @return {this} this
|
|
128
|
+
*/
|
|
129
|
+
protected clone(instance: Model): this;
|
|
130
|
+
/**
|
|
131
|
+
*
|
|
132
|
+
* Copy an instance of model
|
|
133
|
+
* @param {Model} instance instance of model
|
|
134
|
+
* @param {Object} options keep data
|
|
135
|
+
* @return {Model} Model
|
|
136
|
+
*/
|
|
137
|
+
protected copyModel(instance: Model, options?: {
|
|
138
|
+
update?: boolean;
|
|
139
|
+
insert?: boolean;
|
|
140
|
+
delete?: boolean;
|
|
141
|
+
where?: boolean;
|
|
142
|
+
}): Model;
|
|
143
|
+
/**
|
|
144
|
+
* Assign ignore delete_at in model
|
|
145
|
+
* @param {boolean} condition
|
|
146
|
+
* @return {this} this
|
|
147
|
+
*/
|
|
148
|
+
ignoreSoftDelete(condition?: boolean): this;
|
|
149
|
+
/**
|
|
150
|
+
* Assign table name
|
|
151
|
+
* @param {string} table table name
|
|
152
|
+
* @return {this} this
|
|
153
|
+
*/
|
|
154
|
+
tableName(table: string): this;
|
|
155
|
+
/**
|
|
156
|
+
* Assign ignore delete_at in model
|
|
157
|
+
* @param {boolean} condition
|
|
158
|
+
* @return {this} this
|
|
159
|
+
*/
|
|
160
|
+
disableSoftDelete(condition?: boolean): this;
|
|
161
|
+
/**
|
|
162
|
+
* Assign build in function to result of data
|
|
163
|
+
* @param {object} func
|
|
164
|
+
* @return {this} this
|
|
165
|
+
*/
|
|
166
|
+
registry(func: {
|
|
167
|
+
[key: string]: Function;
|
|
168
|
+
}): this;
|
|
169
|
+
/**
|
|
170
|
+
*
|
|
171
|
+
* Use relations in registry of model return result of relation query
|
|
172
|
+
* @param {...string} nameRelations ...name registry in models using (hasOne , hasMany , belongsTo , belongsToMany)
|
|
173
|
+
* @return {this} this
|
|
174
|
+
*/
|
|
175
|
+
with(...nameRelations: Array<string>): this;
|
|
176
|
+
/**
|
|
177
|
+
*
|
|
178
|
+
* Use relations in registry of model return ignore soft deleted
|
|
179
|
+
* @param {...string} nameRelations if data exists return blank
|
|
180
|
+
* @return {this} this
|
|
181
|
+
*/
|
|
182
|
+
withTrashed(...nameRelations: Array<string>): this;
|
|
183
|
+
/**
|
|
184
|
+
*
|
|
185
|
+
* Use relations in registry of model return only exists result of relation query
|
|
186
|
+
* @param {...string} nameRelations if data exists return blank
|
|
187
|
+
* @return {this} this
|
|
188
|
+
*/
|
|
189
|
+
withExists(...nameRelations: Array<string>): this;
|
|
190
|
+
/**
|
|
191
|
+
*
|
|
192
|
+
* Use relations in registry of model return only exists result of relation query
|
|
193
|
+
* @param {...string} nameRelations if data exists return blank
|
|
194
|
+
* @return {this} this
|
|
195
|
+
*/
|
|
196
|
+
has(...nameRelations: Array<string>): this;
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
* Use relation '${name}' registry of model return callback this query model
|
|
200
|
+
* @param {string} nameRelation name relation in registry in your model
|
|
201
|
+
* @param {function} callback query callback
|
|
202
|
+
* @return {this} this
|
|
203
|
+
*/
|
|
204
|
+
withQuery(nameRelation: string, callback: Function): this;
|
|
205
|
+
/**
|
|
206
|
+
*
|
|
207
|
+
* Use relations in registry of model retrun result of relation query
|
|
208
|
+
* @param {...string} nameRelations ...name registry in models using (hasOne , hasMany , belongsTo , belongsToMany)
|
|
209
|
+
* @return {this} this
|
|
210
|
+
*/
|
|
211
|
+
relations(...nameRelations: Array<string>): this;
|
|
212
|
+
/**
|
|
213
|
+
*
|
|
214
|
+
* Use relations in registry of model return only exists result of relation query
|
|
215
|
+
* @param {...string} nameRelations if data exists return blank
|
|
216
|
+
* @return {this}
|
|
217
|
+
*/
|
|
218
|
+
relationsExists(...nameRelations: Array<string>): this;
|
|
219
|
+
/**
|
|
220
|
+
*
|
|
221
|
+
* Use relation '${name}' registry of model return callback this query model
|
|
222
|
+
* @param {string} nameRelation name relation in registry in your model
|
|
223
|
+
* @param {function} callback query callback
|
|
224
|
+
* @return {this} this
|
|
225
|
+
*/
|
|
226
|
+
relationQuery(nameRelation: string, callback: Function): this;
|
|
227
|
+
/**
|
|
228
|
+
*
|
|
229
|
+
* Use relations in registry of model return ignore soft deleted
|
|
230
|
+
* @param {...string} nameRelations if data exists return blank
|
|
231
|
+
* @return {this} this
|
|
232
|
+
*/
|
|
233
|
+
relationTrashed(...nameRelations: Array<string>): this;
|
|
234
|
+
/**
|
|
235
|
+
* Assign the relation in model Objects
|
|
236
|
+
* @param {object} relations registry relation in your model
|
|
237
|
+
* @property {string} relation.name
|
|
238
|
+
* @property {string} relation.as
|
|
239
|
+
* @property {class} relation.model
|
|
240
|
+
* @property {string} relation.localKey
|
|
241
|
+
* @property {string} relation.foreignKey
|
|
242
|
+
* @property {string} relation.freezeTable
|
|
243
|
+
* @return {this} this
|
|
244
|
+
*/
|
|
245
|
+
protected hasOne({ name, as, model, localKey, foreignKey, freezeTable }: Relation): this;
|
|
246
|
+
/**
|
|
247
|
+
* Assign the relation in model Objects
|
|
248
|
+
* @param {object} relations registry relation in your model
|
|
249
|
+
* @property {string} relation.name
|
|
250
|
+
* @property {string} relation.as
|
|
251
|
+
* @property {class} relation.model
|
|
252
|
+
* @property {string} relation.localKey
|
|
253
|
+
* @property {string} relation.foreignKey
|
|
254
|
+
* @property {string} relation.freezeTable
|
|
255
|
+
* @return {this} this
|
|
256
|
+
*/
|
|
257
|
+
protected hasMany({ name, as, model, localKey, foreignKey, freezeTable }: Relation): this;
|
|
258
|
+
/**
|
|
259
|
+
* Assign the relation in model Objects
|
|
260
|
+
* @param {object} relations registry relation in your model
|
|
261
|
+
* @property {string} relation.name
|
|
262
|
+
* @property {string} relation.as
|
|
263
|
+
* @property {class} relation.model
|
|
264
|
+
* @property {string} relation.localKey
|
|
265
|
+
* @property {string} relation.foreignKey
|
|
266
|
+
* @property {string} relation.freezeTable
|
|
267
|
+
* @return {this} this
|
|
268
|
+
*/
|
|
269
|
+
protected belongsTo({ name, as, model, localKey, foreignKey, freezeTable }: Relation): this;
|
|
270
|
+
/**
|
|
271
|
+
* Assign the relation in model Objects
|
|
272
|
+
* @param {object} relations registry relation in your model
|
|
273
|
+
* @property {string} relation.name
|
|
274
|
+
* @property {string} relation.as
|
|
275
|
+
* @property {class} relation.model
|
|
276
|
+
* @property {string} relation.localKey
|
|
277
|
+
* @property {string} relation.foreignKey
|
|
278
|
+
* @property {string} relation.freezeTable freeae table name
|
|
279
|
+
* @property {string} relation.pivot table name of pivot
|
|
280
|
+
* @property {string} relation.oldVersion return value of old version
|
|
281
|
+
* @return {this} this
|
|
282
|
+
*/
|
|
283
|
+
protected belongsToMany({ name, as, model, localKey, foreignKey, freezeTable, pivot, oldVersion }: Relation): this;
|
|
284
|
+
/**
|
|
285
|
+
* Assign the relation in model Objects
|
|
286
|
+
* @param {object} relation registry relation in your model
|
|
287
|
+
* @type {object} relation
|
|
288
|
+
* @property {class} model
|
|
289
|
+
* @property {string?} name
|
|
290
|
+
* @property {string?} as
|
|
291
|
+
* @property {string?} localKey
|
|
292
|
+
* @property {string?} foreignKey
|
|
293
|
+
* @property {string?} freezeTable
|
|
294
|
+
* @param {function?} callback callback of query
|
|
295
|
+
* @return {this} this
|
|
296
|
+
*/
|
|
297
|
+
protected hasOneBuilder({ name, as, model, localKey, foreignKey, freezeTable }: RelationQuery, callback?: Function): this;
|
|
298
|
+
/**
|
|
299
|
+
* Assign the relation in model Objects
|
|
300
|
+
* @param {object} relation registry relation in your model
|
|
301
|
+
* @type {object} relation
|
|
302
|
+
* @property {class} model
|
|
303
|
+
* @property {string?} name
|
|
304
|
+
* @property {string?} as
|
|
305
|
+
* @property {string?} localKey
|
|
306
|
+
* @property {string?} foreignKey
|
|
307
|
+
* @property {string?} freezeTable
|
|
308
|
+
* @param {function?} callback callback of query
|
|
309
|
+
* @return {this} this
|
|
310
|
+
*/
|
|
311
|
+
protected hasManyBuilder({ name, as, model, localKey, foreignKey, freezeTable }: RelationQuery, callback?: Function): this;
|
|
312
|
+
/**
|
|
313
|
+
* Assign the relation in model Objects
|
|
314
|
+
* @param {object} relation registry relation in your model
|
|
315
|
+
* @type {object} relation
|
|
316
|
+
* @property {class} model
|
|
317
|
+
* @property {string?} name
|
|
318
|
+
* @property {string?} as
|
|
319
|
+
* @property {string?} localKey
|
|
320
|
+
* @property {string?} foreignKey
|
|
321
|
+
* @property {string?} freezeTable
|
|
322
|
+
* @param {function?} callback callback of query
|
|
323
|
+
* @return {this} this
|
|
324
|
+
*/
|
|
325
|
+
protected belongsToBuilder({ name, as, model, localKey, foreignKey, freezeTable }: RelationQuery, callback?: Function): this;
|
|
326
|
+
/**
|
|
327
|
+
* Assign the relation in model Objects
|
|
328
|
+
* @param {object} relation registry relation in your model
|
|
329
|
+
* @type {object} relation
|
|
330
|
+
* @property {class} model
|
|
331
|
+
* @property {string?} name
|
|
332
|
+
* @property {string?} as
|
|
333
|
+
* @property {string?} localKey
|
|
334
|
+
* @property {string?} foreignKey
|
|
335
|
+
* @property {string?} freezeTable
|
|
336
|
+
* @param {function?} callback callback of query
|
|
337
|
+
* @return {this} this
|
|
338
|
+
*/
|
|
339
|
+
protected belongsToManyBuilder({ name, as, model, localKey, foreignKey, freezeTable, pivot }: RelationQuery, callback?: Function): this;
|
|
340
|
+
/**
|
|
341
|
+
* return only in trashed (data has been remove)
|
|
342
|
+
* @return {promise}
|
|
343
|
+
*/
|
|
344
|
+
trashed(): Promise<any>;
|
|
345
|
+
/**
|
|
346
|
+
* return all only in trashed (data has been remove)
|
|
347
|
+
* @return {promise}
|
|
348
|
+
*/
|
|
349
|
+
onlyTrashed(): Promise<any>;
|
|
350
|
+
/**
|
|
351
|
+
* restore data in trashed
|
|
352
|
+
* @return {promise}
|
|
353
|
+
*/
|
|
354
|
+
restore(): Promise<any>;
|
|
355
|
+
toTableName(): string;
|
|
356
|
+
toTableNameAndColumn(column: string): string;
|
|
357
|
+
/**
|
|
358
|
+
*
|
|
359
|
+
* @override Method
|
|
360
|
+
* @return {string}
|
|
361
|
+
*/
|
|
362
|
+
toString(): string;
|
|
363
|
+
/**
|
|
364
|
+
*
|
|
365
|
+
* @override Method
|
|
366
|
+
* @return {string}
|
|
367
|
+
*/
|
|
368
|
+
toSQL(): string;
|
|
369
|
+
/**
|
|
370
|
+
*
|
|
371
|
+
* @override Method
|
|
372
|
+
* @return {promise<string>}
|
|
373
|
+
*/
|
|
374
|
+
toJSON(): Promise<string>;
|
|
375
|
+
/**
|
|
376
|
+
*
|
|
377
|
+
* @override Method
|
|
378
|
+
* @param {string=} column [column=id]
|
|
379
|
+
* @return {promise<Array>}
|
|
380
|
+
*/
|
|
381
|
+
toArray(column?: string): Promise<Array<any>>;
|
|
382
|
+
/**
|
|
383
|
+
*
|
|
384
|
+
* @override Method
|
|
385
|
+
* @param {string=} column [column=id]
|
|
386
|
+
* @return {promise<number>}
|
|
387
|
+
*/
|
|
388
|
+
avg(column?: string): Promise<number>;
|
|
389
|
+
/**
|
|
390
|
+
*
|
|
391
|
+
* @override Method
|
|
392
|
+
* @param {string} column [column=id]
|
|
393
|
+
* @return {promise<number>}
|
|
394
|
+
*/
|
|
395
|
+
sum(column?: string): Promise<number>;
|
|
396
|
+
/**
|
|
397
|
+
*
|
|
398
|
+
* @override Method
|
|
399
|
+
* @param {string=} column [column=id]
|
|
400
|
+
* @return {promise<number>}
|
|
401
|
+
*/
|
|
402
|
+
max(column?: string): Promise<number>;
|
|
403
|
+
/**
|
|
404
|
+
*
|
|
405
|
+
* @override Method
|
|
406
|
+
* @param {string=} column [column=id]
|
|
407
|
+
* @return {promise<number>}
|
|
408
|
+
*/
|
|
409
|
+
min(column?: string): Promise<number>;
|
|
410
|
+
/**
|
|
411
|
+
*
|
|
412
|
+
* @override Method
|
|
413
|
+
* @param {string=} column [column=id]
|
|
414
|
+
* @return {promise<number>}
|
|
415
|
+
*/
|
|
416
|
+
count(column?: string): Promise<number>;
|
|
417
|
+
/**
|
|
418
|
+
*
|
|
419
|
+
* execute data return result is exists
|
|
420
|
+
* @return {promise<boolean>}
|
|
421
|
+
*/
|
|
422
|
+
exists(): Promise<boolean>;
|
|
423
|
+
/**
|
|
424
|
+
* delete data from the database
|
|
425
|
+
* @override Method
|
|
426
|
+
* @return {promise<boolean>}
|
|
427
|
+
*/
|
|
428
|
+
delete(): Promise<boolean>;
|
|
429
|
+
/**
|
|
430
|
+
*
|
|
431
|
+
* force delete data from the database
|
|
432
|
+
* @return {promise<boolean>}
|
|
433
|
+
*/
|
|
434
|
+
forceDelete(): Promise<boolean>;
|
|
435
|
+
/**
|
|
436
|
+
*
|
|
437
|
+
* @override Method
|
|
438
|
+
* @return {promise<{[key: string]:any} | null>}
|
|
439
|
+
*/
|
|
440
|
+
first(): Promise<{
|
|
441
|
+
[key: string]: any;
|
|
442
|
+
} | null>;
|
|
443
|
+
/**
|
|
444
|
+
*
|
|
445
|
+
* @override Method
|
|
446
|
+
* @return {promise<{[key: string]:any} | null>}
|
|
447
|
+
*/
|
|
448
|
+
findOne(): Promise<{
|
|
449
|
+
[key: string]: any;
|
|
450
|
+
} | null>;
|
|
451
|
+
/**
|
|
452
|
+
*
|
|
453
|
+
* @override Method
|
|
454
|
+
* @return {promise<object | Error>}
|
|
455
|
+
*/
|
|
456
|
+
firstOrError(message: string, options?: {
|
|
457
|
+
[key: string]: any;
|
|
458
|
+
}): Promise<{
|
|
459
|
+
[key: string]: any;
|
|
460
|
+
}>;
|
|
461
|
+
/**
|
|
462
|
+
*
|
|
463
|
+
* @override Method
|
|
464
|
+
* @return {promise<any>}
|
|
465
|
+
*/
|
|
466
|
+
findOneOrError(message: string, options?: {
|
|
467
|
+
[key: string]: any;
|
|
468
|
+
}): Promise<{
|
|
469
|
+
[key: string]: any;
|
|
470
|
+
}>;
|
|
471
|
+
/**
|
|
472
|
+
*
|
|
473
|
+
* @override Method
|
|
474
|
+
* @return {promise<array>}
|
|
475
|
+
*/
|
|
476
|
+
all(): Promise<Array<any>>;
|
|
477
|
+
/**
|
|
478
|
+
*
|
|
479
|
+
* @override Method
|
|
480
|
+
* @return {promise<object | null>}
|
|
481
|
+
*/
|
|
482
|
+
find(id: number): Promise<Record<string, any> | null>;
|
|
483
|
+
/**
|
|
484
|
+
*
|
|
485
|
+
* @override Method
|
|
486
|
+
* @return {promise<array>}
|
|
487
|
+
*/
|
|
488
|
+
get(): Promise<Array<any>>;
|
|
489
|
+
/**
|
|
490
|
+
*
|
|
491
|
+
* @override Method
|
|
492
|
+
* @return {promise<array>}
|
|
493
|
+
*/
|
|
494
|
+
findMany(): Promise<Array<any>>;
|
|
495
|
+
/**
|
|
496
|
+
*
|
|
497
|
+
* @override Method
|
|
498
|
+
* @param {object?} paginationOptions by default page = 1 , limit = 15
|
|
499
|
+
* @property {number} paginationOptions.limit
|
|
500
|
+
* @property {number} paginationOptions.page
|
|
501
|
+
* @return {promise<Pagination>}
|
|
502
|
+
*/
|
|
503
|
+
pagination(paginationOptions?: {
|
|
504
|
+
limit?: number;
|
|
505
|
+
page?: number;
|
|
506
|
+
}): Promise<Pagination>;
|
|
507
|
+
/**
|
|
508
|
+
*
|
|
509
|
+
* @override Method
|
|
510
|
+
* @param {?object} paginationOptions by default page = 1 , limit = 15
|
|
511
|
+
* @property {number} paginationOptions.limit
|
|
512
|
+
* @property {number} paginationOptions.page
|
|
513
|
+
* @return {promise<Pagination>}
|
|
514
|
+
*/
|
|
515
|
+
paginate(paginationOptions?: {
|
|
516
|
+
limit?: number;
|
|
517
|
+
page?: number;
|
|
518
|
+
}): Promise<Pagination>;
|
|
519
|
+
/**
|
|
520
|
+
*
|
|
521
|
+
* @override Method
|
|
522
|
+
* @param {string} column
|
|
523
|
+
* @return {Promise<array>}
|
|
524
|
+
*/
|
|
525
|
+
getGroupBy(column: string): Promise<Array<any>>;
|
|
526
|
+
/**
|
|
527
|
+
*
|
|
528
|
+
* update data in the database
|
|
529
|
+
* @override Method
|
|
530
|
+
* @param {object} data
|
|
531
|
+
* @return {this} this
|
|
532
|
+
*/
|
|
533
|
+
update(data: Record<string, any> & {
|
|
534
|
+
length?: never;
|
|
535
|
+
}): this;
|
|
536
|
+
/**
|
|
537
|
+
*
|
|
538
|
+
* @override Method
|
|
539
|
+
* @param {object} data for insert
|
|
540
|
+
* @return {this} this
|
|
541
|
+
*/
|
|
542
|
+
insert(data: Record<string, any> & {
|
|
543
|
+
length?: never;
|
|
544
|
+
}): this;
|
|
545
|
+
/**
|
|
546
|
+
*
|
|
547
|
+
* @override Method
|
|
548
|
+
* @param {object} data for insert
|
|
549
|
+
* @return {this} this
|
|
550
|
+
*/
|
|
551
|
+
create(data: Record<string, any> & {
|
|
552
|
+
length?: never;
|
|
553
|
+
}): this;
|
|
554
|
+
/**
|
|
555
|
+
*
|
|
556
|
+
* @override Method
|
|
557
|
+
* @param {object} data for update or create
|
|
558
|
+
* @return {this} this
|
|
559
|
+
*/
|
|
560
|
+
updateOrCreate(data: Record<string, any> & {
|
|
561
|
+
length?: never;
|
|
562
|
+
}): this;
|
|
563
|
+
/**
|
|
564
|
+
*
|
|
565
|
+
* @override Method
|
|
566
|
+
* @param {object} data for update or create
|
|
567
|
+
* @return {this} this
|
|
568
|
+
*/
|
|
569
|
+
updateOrInsert(data: Record<string, any> & {
|
|
570
|
+
length?: never;
|
|
571
|
+
}): this;
|
|
572
|
+
/**
|
|
573
|
+
*
|
|
574
|
+
* @override Method
|
|
575
|
+
* @param {object} data for update or create
|
|
576
|
+
* @return {this} this
|
|
577
|
+
*/
|
|
578
|
+
insertOrUpdate(data: Record<string, any> & {
|
|
579
|
+
length?: never;
|
|
580
|
+
}): this;
|
|
581
|
+
/**
|
|
582
|
+
*
|
|
583
|
+
* @override Method
|
|
584
|
+
* @param {object} data for update or create
|
|
585
|
+
* @return {this} this
|
|
586
|
+
*/
|
|
587
|
+
createOrUpdate(data: Record<string, any> & {
|
|
588
|
+
length?: never;
|
|
589
|
+
}): this;
|
|
590
|
+
/**
|
|
591
|
+
*
|
|
592
|
+
* @override Method
|
|
593
|
+
* @param {object} data for create
|
|
594
|
+
* @return {this} this
|
|
595
|
+
*/
|
|
596
|
+
createOrSelect(data: Record<string, any> & {
|
|
597
|
+
length?: never;
|
|
598
|
+
}): this;
|
|
599
|
+
/**
|
|
600
|
+
*
|
|
601
|
+
* @override Method
|
|
602
|
+
* @param {object} data for update or create
|
|
603
|
+
* @return {this} this
|
|
604
|
+
*/
|
|
605
|
+
insertOrSelect(data: Record<string, any> & {
|
|
606
|
+
length?: never;
|
|
607
|
+
}): this;
|
|
608
|
+
/**
|
|
609
|
+
*
|
|
610
|
+
* insert multiple data into the database
|
|
611
|
+
* @override Method
|
|
612
|
+
* @param {array<object>} data create multiple data
|
|
613
|
+
* @return {this} this this
|
|
614
|
+
*/
|
|
615
|
+
createMultiple(data: Array<{
|
|
616
|
+
[key: string]: any;
|
|
617
|
+
}>): this;
|
|
618
|
+
/**
|
|
619
|
+
*
|
|
620
|
+
* insert muliple data into the database
|
|
621
|
+
* @override Method
|
|
622
|
+
* @param {array<object>} data create multiple data
|
|
623
|
+
* @return {this} this this
|
|
624
|
+
*/
|
|
625
|
+
insertMultiple(data: Array<{
|
|
626
|
+
[key: string]: any;
|
|
627
|
+
}>): this;
|
|
628
|
+
/**
|
|
629
|
+
*
|
|
630
|
+
* @param {object} data create not exists data
|
|
631
|
+
* @override Method
|
|
632
|
+
* @return {this} this this
|
|
633
|
+
*/
|
|
634
|
+
createNotExists(data: Record<string, any> & {
|
|
635
|
+
length?: never;
|
|
636
|
+
}): this;
|
|
637
|
+
/**
|
|
638
|
+
*
|
|
639
|
+
* @param {object} data create not exists data
|
|
640
|
+
* @override Method
|
|
641
|
+
* @return {this} this this
|
|
642
|
+
*/
|
|
643
|
+
insertNotExists(data: {
|
|
644
|
+
[key: string]: any;
|
|
645
|
+
} & {
|
|
646
|
+
length?: never;
|
|
647
|
+
}): this;
|
|
648
|
+
/**
|
|
649
|
+
*
|
|
650
|
+
* get schema of table
|
|
651
|
+
* @return {this} this this
|
|
652
|
+
*/
|
|
653
|
+
getSchema(): Promise<any>;
|
|
654
|
+
/**
|
|
655
|
+
*
|
|
656
|
+
* @override Method
|
|
657
|
+
* @return {Promise<Record<string,any> | Array<any> | null | undefined>}
|
|
658
|
+
*/
|
|
659
|
+
save(): Promise<Record<string, any> | Array<any> | null | undefined>;
|
|
660
|
+
/**
|
|
661
|
+
*
|
|
662
|
+
* fake data into to this table
|
|
663
|
+
* @param {number} rows number of rows
|
|
664
|
+
* @return {promise<any>}
|
|
665
|
+
*/
|
|
666
|
+
faker(rows?: number): Promise<Record<string, any>[]>;
|
|
667
|
+
private _valuePattern;
|
|
668
|
+
private _isPatternSnakeCase;
|
|
669
|
+
private _classToTableName;
|
|
670
|
+
private _makeTableName;
|
|
671
|
+
private _tableName;
|
|
672
|
+
private _valueInRelation;
|
|
673
|
+
private _handleSoftDelete;
|
|
674
|
+
private _buildQueryModel;
|
|
675
|
+
private _showOnly;
|
|
676
|
+
private _validateSchema;
|
|
677
|
+
private _execute;
|
|
678
|
+
private _executeGroup;
|
|
679
|
+
private _relationMapData;
|
|
680
|
+
private _handleRelationsExists;
|
|
681
|
+
private _queryRelationsExists;
|
|
682
|
+
private _relation;
|
|
683
|
+
private _belongsToMany;
|
|
684
|
+
private _pagination;
|
|
685
|
+
private _result;
|
|
686
|
+
private _returnEmpty;
|
|
687
|
+
private _returnResult;
|
|
688
|
+
private _hiddenColumnModel;
|
|
689
|
+
private _attach;
|
|
690
|
+
private _detach;
|
|
691
|
+
private _queryUpdateModel;
|
|
692
|
+
private _queryInsertModel;
|
|
693
|
+
private _queryInsertMultipleModel;
|
|
694
|
+
private _insertNotExistsModel;
|
|
695
|
+
private _insertModel;
|
|
696
|
+
private _createMultipleModel;
|
|
697
|
+
private _updateOrInsertModel;
|
|
698
|
+
private _insertOrSelectModel;
|
|
699
|
+
private _updateModel;
|
|
700
|
+
private _assertError;
|
|
701
|
+
private _functionRelationName;
|
|
702
|
+
private _handleRelations;
|
|
703
|
+
private _handleRelationsQuery;
|
|
704
|
+
private _validateMethod;
|
|
705
|
+
private _initialModel;
|
|
706
|
+
}
|
|
707
|
+
export { Model };
|
|
708
|
+
export default Model;
|