w-orm-reladb 1.1.6 → 1.1.7

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.
@@ -0,0 +1,1716 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>Global - Documentation</title>
7
+
8
+
9
+ <script src="scripts/prettify/prettify.js"></script>
10
+ <script src="scripts/prettify/lang-css.js"></script>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
+ <script src="scripts/nav.js" defer></script>
17
+
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ </head>
20
+ <body>
21
+
22
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
23
+ <label for="nav-trigger" class="navicon-button x">
24
+ <div class="navicon"></div>
25
+ </label>
26
+
27
+ <label for="nav-trigger" class="overlay"></label>
28
+
29
+ <nav >
30
+
31
+
32
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="WOrmReladb.html">WOrmReladb</a><ul class='methods'><li data-type='method'><a href="WOrmReladb.html#.closeSequelize">closeSequelize</a></li><li data-type='method'><a href="WOrmReladb.html#.createStorage">createStorage</a></li><li data-type='method'><a href="WOrmReladb.html#.del">del</a></li><li data-type='method'><a href="WOrmReladb.html#.delAll">delAll</a></li><li data-type='method'><a href="WOrmReladb.html#.genModelsByDB">genModelsByDB</a></li><li data-type='method'><a href="WOrmReladb.html#.genModelsByTabs">genModelsByTabs</a></li><li data-type='method'><a href="WOrmReladb.html#.genTransaction">genTransaction</a></li><li data-type='method'><a href="WOrmReladb.html#.initSequelize">initSequelize</a></li><li data-type='method'><a href="WOrmReladb.html#.insert">insert</a></li><li data-type='method'><a href="WOrmReladb.html#.insertBulk">insertBulk</a></li><li data-type='method'><a href="WOrmReladb.html#.save">save</a></li><li data-type='method'><a href="WOrmReladb.html#.select">select</a></li><li data-type='method'><a href="WOrmReladb.html#.selectByPk">selectByPk</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#cvFind">cvFind</a></li><li><a href="global.html#getColKind">getColKind</a></li><li><a href="global.html#getColScale">getColScale</a></li><li><a href="global.html#importModels">importModels</a></li><li><a href="global.html#isKindOk">isKindOk</a></li><li><a href="global.html#normPk">normPk</a></li></ul>
33
+
34
+ </nav>
35
+
36
+ <div id="main">
37
+
38
+ <h1 class="page-title">Global</h1>
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+ <section>
47
+
48
+ <header>
49
+
50
+ <h2>
51
+
52
+
53
+
54
+ </h2>
55
+
56
+
57
+ </header>
58
+
59
+ <article>
60
+
61
+ <div class="container-overview">
62
+
63
+
64
+
65
+ <dl class="details">
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
+ </dl>
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ </div>
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+ <h3 class="subsection-title">Methods</h3>
127
+
128
+
129
+
130
+
131
+
132
+
133
+ <h4 class="name" id="cvFind"><span class="type-signature"></span>cvFind<span class="signature">(find, ctx)</span><span class="type-signature"> &rarr; {Object}</span></h4>
134
+
135
+
136
+
137
+
138
+
139
+
140
+ <dl class="details">
141
+
142
+ <dt class="tag-description">Description:</dt>
143
+ <dd class="tag-description"><ul class="dummy"><li><p>將查詢條件轉為sequelize之where, 供select與delAll共用, 令同一find於兩函數由同一SQL謂詞決定命中</p>
144
+ <p>註: 支援欄位等值與$eq、$ne、$gt、$gte、$lt、$lte、$in、$nin、$not、$regex($options僅i)、$exists, 以及$and、$or、$nor
145
+ 註: 不支援之運算子、非純量之值、與欄位型別不符之純量一律拋錯, 不得交sequelize之型別stringify(見本檔之chkScalar)
146
+ 註: NULL依SQL三值邏輯; $regex僅支援字面子字串; 非物件之find回{}(即全部), 此為現況保留</p></li></ul></dd>
147
+
148
+
149
+
150
+ <dt class="tag-source">Source:</dt>
151
+ <dd class="tag-source"><ul class="dummy"><li>
152
+ <a href="cvFind.mjs.html">cvFind.mjs</a>, <a href="cvFind.mjs.html#line767">line 767</a>
153
+ </li></ul></dd>
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
+ </dl>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+ <h5 class="h5-parameters">Parameters:</h5>
200
+
201
+
202
+ <table class="params">
203
+ <thead>
204
+ <tr>
205
+
206
+ <th>Name</th>
207
+
208
+
209
+ <th>Type</th>
210
+
211
+
212
+
213
+
214
+
215
+ <th class="last">Description</th>
216
+ </tr>
217
+ </thead>
218
+
219
+ <tbody>
220
+
221
+
222
+ <tr>
223
+
224
+ <td class="name"><code>find</code></td>
225
+
226
+
227
+ <td class="type">
228
+
229
+
230
+ <span class="param-type">*</span>
231
+
232
+
233
+
234
+
235
+ </td>
236
+
237
+
238
+
239
+
240
+
241
+ <td class="description last"><p>輸入查詢條件</p></td>
242
+ </tr>
243
+
244
+
245
+
246
+ <tr>
247
+
248
+ <td class="name"><code>ctx</code></td>
249
+
250
+
251
+ <td class="type">
252
+
253
+
254
+ <span class="param-type">Object</span>
255
+
256
+
257
+
258
+
259
+ </td>
260
+
261
+
262
+
263
+
264
+
265
+ <td class="description last"><p>輸入轉換所需之依賴物件</p>
266
+ <h6>Properties</h6>
267
+
268
+
269
+ <table class="params">
270
+ <thead>
271
+ <tr>
272
+
273
+ <th>Name</th>
274
+
275
+
276
+ <th>Type</th>
277
+
278
+
279
+ <th>Attributes</th>
280
+
281
+
282
+
283
+
284
+ <th class="last">Description</th>
285
+ </tr>
286
+ </thead>
287
+
288
+ <tbody>
289
+
290
+
291
+ <tr>
292
+
293
+ <td class="name"><code>escape</code></td>
294
+
295
+
296
+ <td class="type">
297
+
298
+
299
+ <span class="param-type">function</span>
300
+
301
+
302
+
303
+
304
+ </td>
305
+
306
+
307
+ <td class="attributes">
308
+
309
+
310
+
311
+
312
+
313
+ </td>
314
+
315
+
316
+
317
+
318
+ <td class="description last"><p>輸入依方言將字串轉為SQL字串常值之函數, 通常為sequelize實例之escape</p></td>
319
+ </tr>
320
+
321
+
322
+
323
+ <tr>
324
+
325
+ <td class="name"><code>attrs</code></td>
326
+
327
+
328
+ <td class="type">
329
+
330
+
331
+ <span class="param-type">Object</span>
332
+
333
+
334
+
335
+
336
+ </td>
337
+
338
+
339
+ <td class="attributes">
340
+
341
+ &lt;optional><br>
342
+
343
+
344
+
345
+
346
+
347
+ </td>
348
+
349
+
350
+
351
+
352
+ <td class="description last"><p>輸入model之rawAttributes, 供依欄位型別檢核純量與取得實際欄名, 未給時不檢型別</p></td>
353
+ </tr>
354
+
355
+
356
+
357
+ <tr>
358
+
359
+ <td class="name"><code>dialect</code></td>
360
+
361
+
362
+ <td class="type">
363
+
364
+
365
+ <span class="param-type">String</span>
366
+
367
+
368
+
369
+
370
+ </td>
371
+
372
+
373
+ <td class="attributes">
374
+
375
+ &lt;optional><br>
376
+
377
+
378
+
379
+
380
+
381
+ </td>
382
+
383
+
384
+
385
+
386
+ <td class="description last"><p>輸入資料庫種類字串, 供判定方言能力(如sqlite之LOWER僅折疊ASCII)</p></td>
387
+ </tr>
388
+
389
+
390
+
391
+ <tr>
392
+
393
+ <td class="name"><code>pk</code></td>
394
+
395
+
396
+ <td class="type">
397
+
398
+
399
+ <span class="param-type">String</span>
400
+
401
+
402
+
403
+
404
+ </td>
405
+
406
+
407
+ <td class="attributes">
408
+
409
+ &lt;optional><br>
410
+
411
+
412
+
413
+
414
+
415
+ </td>
416
+
417
+
418
+
419
+
420
+ <td class="description last"><p>輸入主鍵欄位名, 該欄之純量條件值依normPk正規化(如字串類主鍵欄之123即'123'), 未給時不正規化</p></td>
421
+ </tr>
422
+
423
+
424
+ </tbody>
425
+ </table>
426
+
427
+ </td>
428
+ </tr>
429
+
430
+
431
+ </tbody>
432
+ </table>
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+ <h5 class="h5-returns">Returns:</h5>
450
+
451
+
452
+ <div class="param-desc">
453
+ <p>回傳sequelize之where物件, 條件不合法時拋出錯誤</p>
454
+ </div>
455
+
456
+
457
+
458
+ <dl class="param-type">
459
+ <dt>
460
+ Type
461
+ </dt>
462
+ <dd>
463
+
464
+ <span class="param-type">Object</span>
465
+
466
+
467
+
468
+ </dd>
469
+ </dl>
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+
480
+ <h4 class="name" id="getColKind"><span class="type-signature"></span>getColKind<span class="signature">(attrs, field)</span><span class="type-signature"> &rarr; {String}</span></h4>
481
+
482
+
483
+
484
+
485
+
486
+
487
+ <dl class="details">
488
+
489
+ <dt class="tag-description">Description:</dt>
490
+ <dd class="tag-description"><ul class="dummy"><li><p>取欄位之型別分類: str、int、num、date、bool, 未知或非上列者為any</p></li></ul></dd>
491
+
492
+
493
+
494
+ <dt class="tag-source">Source:</dt>
495
+ <dd class="tag-source"><ul class="dummy"><li>
496
+ <a href="cvFind.mjs.html">cvFind.mjs</a>, <a href="cvFind.mjs.html#line148">line 148</a>
497
+ </li></ul></dd>
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
+ </dl>
530
+
531
+
532
+
533
+
534
+
535
+
536
+
537
+
538
+
539
+
540
+
541
+
542
+
543
+ <h5 class="h5-parameters">Parameters:</h5>
544
+
545
+
546
+ <table class="params">
547
+ <thead>
548
+ <tr>
549
+
550
+ <th>Name</th>
551
+
552
+
553
+ <th>Type</th>
554
+
555
+
556
+
557
+
558
+
559
+ <th class="last">Description</th>
560
+ </tr>
561
+ </thead>
562
+
563
+ <tbody>
564
+
565
+
566
+ <tr>
567
+
568
+ <td class="name"><code>attrs</code></td>
569
+
570
+
571
+ <td class="type">
572
+
573
+
574
+ <span class="param-type">Object</span>
575
+
576
+
577
+
578
+
579
+ </td>
580
+
581
+
582
+
583
+
584
+
585
+ <td class="description last"><p>輸入model之rawAttributes</p></td>
586
+ </tr>
587
+
588
+
589
+
590
+ <tr>
591
+
592
+ <td class="name"><code>field</code></td>
593
+
594
+
595
+ <td class="type">
596
+
597
+
598
+ <span class="param-type">String</span>
599
+
600
+
601
+
602
+
603
+ </td>
604
+
605
+
606
+
607
+
608
+
609
+ <td class="description last"><p>輸入欄位名</p></td>
610
+ </tr>
611
+
612
+
613
+ </tbody>
614
+ </table>
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+ <h5 class="h5-returns">Returns:</h5>
632
+
633
+
634
+ <div class="param-desc">
635
+ <p>回傳型別分類字串</p>
636
+ </div>
637
+
638
+
639
+
640
+ <dl class="param-type">
641
+ <dt>
642
+ Type
643
+ </dt>
644
+ <dd>
645
+
646
+ <span class="param-type">String</span>
647
+
648
+
649
+
650
+ </dd>
651
+ </dl>
652
+
653
+
654
+
655
+
656
+
657
+
658
+
659
+
660
+
661
+
662
+ <h4 class="name" id="getColScale"><span class="type-signature"></span>getColScale<span class="signature">(attrs, field)</span><span class="type-signature"> &rarr; {Number|null}</span></h4>
663
+
664
+
665
+
666
+
667
+
668
+
669
+ <dl class="details">
670
+
671
+ <dt class="tag-description">Description:</dt>
672
+ <dd class="tag-description"><ul class="dummy"><li><p>取DECIMAL欄之scale, 未指定者為0(mssql之DECIMAL預設為(18,0)), 非DECIMAL者為null</p></li></ul></dd>
673
+
674
+
675
+
676
+ <dt class="tag-source">Source:</dt>
677
+ <dd class="tag-source"><ul class="dummy"><li>
678
+ <a href="cvFind.mjs.html">cvFind.mjs</a>, <a href="cvFind.mjs.html#line183">line 183</a>
679
+ </li></ul></dd>
680
+
681
+
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+
711
+ </dl>
712
+
713
+
714
+
715
+
716
+
717
+
718
+
719
+
720
+
721
+
722
+
723
+
724
+
725
+ <h5 class="h5-parameters">Parameters:</h5>
726
+
727
+
728
+ <table class="params">
729
+ <thead>
730
+ <tr>
731
+
732
+ <th>Name</th>
733
+
734
+
735
+ <th>Type</th>
736
+
737
+
738
+
739
+
740
+
741
+ <th class="last">Description</th>
742
+ </tr>
743
+ </thead>
744
+
745
+ <tbody>
746
+
747
+
748
+ <tr>
749
+
750
+ <td class="name"><code>attrs</code></td>
751
+
752
+
753
+ <td class="type">
754
+
755
+
756
+ <span class="param-type">Object</span>
757
+
758
+
759
+
760
+
761
+ </td>
762
+
763
+
764
+
765
+
766
+
767
+ <td class="description last"><p>輸入model之rawAttributes</p></td>
768
+ </tr>
769
+
770
+
771
+
772
+ <tr>
773
+
774
+ <td class="name"><code>field</code></td>
775
+
776
+
777
+ <td class="type">
778
+
779
+
780
+ <span class="param-type">String</span>
781
+
782
+
783
+
784
+
785
+ </td>
786
+
787
+
788
+
789
+
790
+
791
+ <td class="description last"><p>輸入欄位名</p></td>
792
+ </tr>
793
+
794
+
795
+ </tbody>
796
+ </table>
797
+
798
+
799
+
800
+
801
+
802
+
803
+
804
+
805
+
806
+
807
+
808
+
809
+
810
+
811
+
812
+
813
+ <h5 class="h5-returns">Returns:</h5>
814
+
815
+
816
+ <div class="param-desc">
817
+ <p>回傳scale</p>
818
+ </div>
819
+
820
+
821
+
822
+ <dl class="param-type">
823
+ <dt>
824
+ Type
825
+ </dt>
826
+ <dd>
827
+
828
+ <span class="param-type">Number</span>
829
+ |
830
+
831
+ <span class="param-type">null</span>
832
+
833
+
834
+
835
+ </dd>
836
+ </dl>
837
+
838
+
839
+
840
+
841
+
842
+
843
+
844
+
845
+
846
+
847
+ <h4 class="name" id="importModels"><span class="type-signature type-signature-async">(async) </span>importModels<span class="signature">(fdModels, sequelize, name, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
848
+
849
+
850
+
851
+
852
+
853
+
854
+ <dl class="details">
855
+
856
+ <dt class="tag-description">Description:</dt>
857
+ <dd class="tag-description"><ul class="dummy"><li><p>匯入資料表設定檔</p>
858
+ <p>註: 不寫入model檔, id之主鍵設定於記憶體內補上</p></li></ul></dd>
859
+
860
+
861
+
862
+ <dt class="tag-source">Source:</dt>
863
+ <dd class="tag-source"><ul class="dummy"><li>
864
+ <a href="importModels.mjs.html">importModels.mjs</a>, <a href="importModels.mjs.html#line114">line 114</a>
865
+ </li></ul></dd>
866
+
867
+
868
+
869
+
870
+
871
+
872
+
873
+
874
+
875
+
876
+
877
+
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+
886
+
887
+
888
+
889
+
890
+
891
+
892
+
893
+
894
+
895
+
896
+
897
+ </dl>
898
+
899
+
900
+
901
+
902
+
903
+
904
+
905
+
906
+
907
+
908
+
909
+
910
+
911
+ <h5 class="h5-parameters">Parameters:</h5>
912
+
913
+
914
+ <table class="params">
915
+ <thead>
916
+ <tr>
917
+
918
+ <th>Name</th>
919
+
920
+
921
+ <th>Type</th>
922
+
923
+
924
+ <th>Attributes</th>
925
+
926
+
927
+
928
+ <th>Default</th>
929
+
930
+
931
+ <th class="last">Description</th>
932
+ </tr>
933
+ </thead>
934
+
935
+ <tbody>
936
+
937
+
938
+ <tr>
939
+
940
+ <td class="name"><code>fdModels</code></td>
941
+
942
+
943
+ <td class="type">
944
+
945
+
946
+ <span class="param-type">String</span>
947
+
948
+
949
+
950
+
951
+ </td>
952
+
953
+
954
+ <td class="attributes">
955
+
956
+
957
+
958
+
959
+
960
+ </td>
961
+
962
+
963
+
964
+ <td class="default">
965
+
966
+ </td>
967
+
968
+
969
+ <td class="description last"><p>輸入models所在資料夾字串</p></td>
970
+ </tr>
971
+
972
+
973
+
974
+ <tr>
975
+
976
+ <td class="name"><code>sequelize</code></td>
977
+
978
+
979
+ <td class="type">
980
+
981
+
982
+ <span class="param-type">Object</span>
983
+
984
+
985
+
986
+
987
+ </td>
988
+
989
+
990
+ <td class="attributes">
991
+
992
+
993
+
994
+
995
+
996
+ </td>
997
+
998
+
999
+
1000
+ <td class="default">
1001
+
1002
+ </td>
1003
+
1004
+
1005
+ <td class="description last"><p>輸入sequelize實例</p></td>
1006
+ </tr>
1007
+
1008
+
1009
+
1010
+ <tr>
1011
+
1012
+ <td class="name"><code>name</code></td>
1013
+
1014
+
1015
+ <td class="type">
1016
+
1017
+
1018
+ <span class="param-type">String</span>
1019
+
1020
+
1021
+
1022
+
1023
+ </td>
1024
+
1025
+
1026
+ <td class="attributes">
1027
+
1028
+
1029
+
1030
+
1031
+
1032
+ </td>
1033
+
1034
+
1035
+
1036
+ <td class="default">
1037
+
1038
+ </td>
1039
+
1040
+
1041
+ <td class="description last"><p>輸入資料表名稱字串</p></td>
1042
+ </tr>
1043
+
1044
+
1045
+
1046
+ <tr>
1047
+
1048
+ <td class="name"><code>opt</code></td>
1049
+
1050
+
1051
+ <td class="type">
1052
+
1053
+
1054
+ <span class="param-type">Object</span>
1055
+
1056
+
1057
+
1058
+
1059
+ </td>
1060
+
1061
+
1062
+ <td class="attributes">
1063
+
1064
+ &lt;optional><br>
1065
+
1066
+
1067
+
1068
+
1069
+
1070
+ </td>
1071
+
1072
+
1073
+
1074
+ <td class="default">
1075
+
1076
+ <code>{}</code>
1077
+
1078
+ </td>
1079
+
1080
+
1081
+ <td class="description last"><p>輸入設定物件</p>
1082
+ <h6>Properties</h6>
1083
+
1084
+
1085
+ <table class="params">
1086
+ <thead>
1087
+ <tr>
1088
+
1089
+ <th>Name</th>
1090
+
1091
+
1092
+ <th>Type</th>
1093
+
1094
+
1095
+ <th>Attributes</th>
1096
+
1097
+
1098
+
1099
+ <th>Default</th>
1100
+
1101
+
1102
+ <th class="last">Description</th>
1103
+ </tr>
1104
+ </thead>
1105
+
1106
+ <tbody>
1107
+
1108
+
1109
+ <tr>
1110
+
1111
+ <td class="name"><code>type</code></td>
1112
+
1113
+
1114
+ <td class="type">
1115
+
1116
+
1117
+ <span class="param-type">String</span>
1118
+
1119
+
1120
+
1121
+
1122
+ </td>
1123
+
1124
+
1125
+ <td class="attributes">
1126
+
1127
+ &lt;optional><br>
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+ </td>
1134
+
1135
+
1136
+
1137
+ <td class="default">
1138
+
1139
+ <code>'js'</code>
1140
+
1141
+ </td>
1142
+
1143
+
1144
+ <td class="description last"><p>輸入資料表設定檔類型字串,可有'js'、'json'</p></td>
1145
+ </tr>
1146
+
1147
+
1148
+
1149
+ <tr>
1150
+
1151
+ <td class="name"><code>sync</code></td>
1152
+
1153
+
1154
+ <td class="type">
1155
+
1156
+
1157
+ <span class="param-type">Boolean</span>
1158
+
1159
+
1160
+
1161
+
1162
+ </td>
1163
+
1164
+
1165
+ <td class="attributes">
1166
+
1167
+ &lt;optional><br>
1168
+
1169
+
1170
+
1171
+
1172
+
1173
+ </td>
1174
+
1175
+
1176
+
1177
+ <td class="default">
1178
+
1179
+ <code>false</code>
1180
+
1181
+ </td>
1182
+
1183
+
1184
+ <td class="description last"><p>輸入是否將models資料同步至資料庫</p></td>
1185
+ </tr>
1186
+
1187
+
1188
+ </tbody>
1189
+ </table>
1190
+
1191
+ </td>
1192
+ </tr>
1193
+
1194
+
1195
+ </tbody>
1196
+ </table>
1197
+
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+
1204
+
1205
+
1206
+
1207
+
1208
+
1209
+
1210
+
1211
+
1212
+
1213
+ <h5 class="h5-returns">Returns:</h5>
1214
+
1215
+
1216
+ <div class="param-desc">
1217
+ <p>回傳Promise,resolve回傳models物件,reject回傳錯誤訊息</p>
1218
+ </div>
1219
+
1220
+
1221
+
1222
+ <dl class="param-type">
1223
+ <dt>
1224
+ Type
1225
+ </dt>
1226
+ <dd>
1227
+
1228
+ <span class="param-type">Promise</span>
1229
+
1230
+
1231
+
1232
+ </dd>
1233
+ </dl>
1234
+
1235
+
1236
+
1237
+
1238
+
1239
+
1240
+
1241
+
1242
+
1243
+
1244
+ <h4 class="name" id="isKindOk"><span class="type-signature"></span>isKindOk<span class="signature">(v, kind)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
1245
+
1246
+
1247
+
1248
+
1249
+
1250
+
1251
+ <dl class="details">
1252
+
1253
+ <dt class="tag-description">Description:</dt>
1254
+ <dd class="tag-description"><ul class="dummy"><li><p>判定純量是否符合欄位型別分類
1255
+ 註: sqlite比較不同型別時不報錯而依型別排序, 如INTEGER &lt; 'abc'、DATE &lt; 'garbage'恆為真,
1256
+ 若放行則delAll會刪除全部非NULL之列; mssql則轉型失敗而reject, 兩方言分歧, 故一律於送出前判定
1257
+ 註: 整數欄之數值須在安全整數範圍內, 超出者已失精度而會比對到相鄰之值; 精確之大整數以數值字串給予</p></li></ul></dd>
1258
+
1259
+
1260
+
1261
+ <dt class="tag-source">Source:</dt>
1262
+ <dd class="tag-source"><ul class="dummy"><li>
1263
+ <a href="cvFind.mjs.html">cvFind.mjs</a>, <a href="cvFind.mjs.html#line205">line 205</a>
1264
+ </li></ul></dd>
1265
+
1266
+
1267
+
1268
+
1269
+
1270
+
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+
1281
+
1282
+
1283
+
1284
+
1285
+
1286
+
1287
+
1288
+
1289
+
1290
+
1291
+
1292
+
1293
+
1294
+
1295
+
1296
+ </dl>
1297
+
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+
1310
+ <h5 class="h5-parameters">Parameters:</h5>
1311
+
1312
+
1313
+ <table class="params">
1314
+ <thead>
1315
+ <tr>
1316
+
1317
+ <th>Name</th>
1318
+
1319
+
1320
+ <th>Type</th>
1321
+
1322
+
1323
+
1324
+
1325
+
1326
+ <th class="last">Description</th>
1327
+ </tr>
1328
+ </thead>
1329
+
1330
+ <tbody>
1331
+
1332
+
1333
+ <tr>
1334
+
1335
+ <td class="name"><code>v</code></td>
1336
+
1337
+
1338
+ <td class="type">
1339
+
1340
+
1341
+ <span class="param-type">*</span>
1342
+
1343
+
1344
+
1345
+
1346
+ </td>
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+ <td class="description last"><p>輸入純量</p></td>
1353
+ </tr>
1354
+
1355
+
1356
+
1357
+ <tr>
1358
+
1359
+ <td class="name"><code>kind</code></td>
1360
+
1361
+
1362
+ <td class="type">
1363
+
1364
+
1365
+ <span class="param-type">String</span>
1366
+
1367
+
1368
+
1369
+
1370
+ </td>
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+ <td class="description last"><p>輸入欄位型別分類</p></td>
1377
+ </tr>
1378
+
1379
+
1380
+ </tbody>
1381
+ </table>
1382
+
1383
+
1384
+
1385
+
1386
+
1387
+
1388
+
1389
+
1390
+
1391
+
1392
+
1393
+
1394
+
1395
+
1396
+
1397
+
1398
+ <h5 class="h5-returns">Returns:</h5>
1399
+
1400
+
1401
+ <div class="param-desc">
1402
+ <p>回傳是否相符</p>
1403
+ </div>
1404
+
1405
+
1406
+
1407
+ <dl class="param-type">
1408
+ <dt>
1409
+ Type
1410
+ </dt>
1411
+ <dd>
1412
+
1413
+ <span class="param-type">Boolean</span>
1414
+
1415
+
1416
+
1417
+ </dd>
1418
+ </dl>
1419
+
1420
+
1421
+
1422
+
1423
+
1424
+
1425
+
1426
+
1427
+
1428
+
1429
+ <h4 class="name" id="normPk"><span class="type-signature"></span>normPk<span class="signature">(v, kind, scale<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
1430
+
1431
+
1432
+
1433
+
1434
+
1435
+
1436
+ <dl class="details">
1437
+
1438
+ <dt class="tag-description">Description:</dt>
1439
+ <dd class="tag-description"><ul class="dummy"><li><p>依主鍵欄型別分類正規化主鍵值, 與w-orm-mdb之normPk同一規則(見CLAUDE_rulebook.md之R8)</p>
1440
+ <p>註: kind為'ok'(v為正規化後之值)、'invalid'(未給或非有效值, 依規格T6處置)、'mismatch'(與主鍵欄型別不符)
1441
+ 註: 字串類主鍵欄之有限數字以String(v)處置, 與w-serv-orm、w-orm-mdb一致
1442
+ 註: 整數類主鍵欄收安全整數, 以及標準整數寫法之字串(String(Number(s))===s)而轉為數值;
1443
+ 超出安全整數之標準整數寫法字串保留為字串(精確值, 供BIGINT), 超出安全整數之數值已失精度而會命中相鄰主鍵, 視為型別不符;
1444
+ 非整數之數值與其他字串(如'012'、'1e1'、'0x1')寫入時會被資料庫轉型而改變鍵, 視為型別不符
1445
+ 註: 其他數值類主鍵欄收有限數值與標準數字字串(轉為數值), 其他字串視為型別不符;
1446
+ DECIMAL主鍵欄之值小數位多於scale者寫入時會被四捨五入而改變鍵(mssql之DECIMAL(10,2)存1.254為1.25, insert回報已存在而selectByPk(1.254)回null), 視為型別不符
1447
+ 註: 其他型別之主鍵欄不檢型別, 收非空字串與有限數值
1448
+ 註: NaN、±Infinity、空字串、布林、物件、陣列、Date、BigInt、null、undefined為無效</p></li></ul></dd>
1449
+
1450
+
1451
+
1452
+ <dt class="tag-source">Source:</dt>
1453
+ <dd class="tag-source"><ul class="dummy"><li>
1454
+ <a href="cvFind.mjs.html">cvFind.mjs</a>, <a href="cvFind.mjs.html#line293">line 293</a>
1455
+ </li></ul></dd>
1456
+
1457
+
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+
1467
+
1468
+
1469
+
1470
+
1471
+
1472
+
1473
+
1474
+
1475
+
1476
+
1477
+
1478
+
1479
+
1480
+
1481
+
1482
+
1483
+
1484
+
1485
+
1486
+
1487
+ </dl>
1488
+
1489
+
1490
+
1491
+
1492
+
1493
+
1494
+
1495
+
1496
+
1497
+
1498
+
1499
+
1500
+
1501
+ <h5 class="h5-parameters">Parameters:</h5>
1502
+
1503
+
1504
+ <table class="params">
1505
+ <thead>
1506
+ <tr>
1507
+
1508
+ <th>Name</th>
1509
+
1510
+
1511
+ <th>Type</th>
1512
+
1513
+
1514
+ <th>Attributes</th>
1515
+
1516
+
1517
+
1518
+ <th>Default</th>
1519
+
1520
+
1521
+ <th class="last">Description</th>
1522
+ </tr>
1523
+ </thead>
1524
+
1525
+ <tbody>
1526
+
1527
+
1528
+ <tr>
1529
+
1530
+ <td class="name"><code>v</code></td>
1531
+
1532
+
1533
+ <td class="type">
1534
+
1535
+
1536
+ <span class="param-type">*</span>
1537
+
1538
+
1539
+
1540
+
1541
+ </td>
1542
+
1543
+
1544
+ <td class="attributes">
1545
+
1546
+
1547
+
1548
+
1549
+
1550
+ </td>
1551
+
1552
+
1553
+
1554
+ <td class="default">
1555
+
1556
+ </td>
1557
+
1558
+
1559
+ <td class="description last"><p>輸入主鍵值</p></td>
1560
+ </tr>
1561
+
1562
+
1563
+
1564
+ <tr>
1565
+
1566
+ <td class="name"><code>kind</code></td>
1567
+
1568
+
1569
+ <td class="type">
1570
+
1571
+
1572
+ <span class="param-type">String</span>
1573
+
1574
+
1575
+
1576
+
1577
+ </td>
1578
+
1579
+
1580
+ <td class="attributes">
1581
+
1582
+
1583
+
1584
+
1585
+
1586
+ </td>
1587
+
1588
+
1589
+
1590
+ <td class="default">
1591
+
1592
+ </td>
1593
+
1594
+
1595
+ <td class="description last"><p>輸入主鍵欄之型別分類, 取自getColKind</p></td>
1596
+ </tr>
1597
+
1598
+
1599
+
1600
+ <tr>
1601
+
1602
+ <td class="name"><code>scale</code></td>
1603
+
1604
+
1605
+ <td class="type">
1606
+
1607
+
1608
+ <span class="param-type">Number</span>
1609
+ |
1610
+
1611
+ <span class="param-type">null</span>
1612
+
1613
+
1614
+
1615
+
1616
+ </td>
1617
+
1618
+
1619
+ <td class="attributes">
1620
+
1621
+ &lt;optional><br>
1622
+
1623
+
1624
+
1625
+
1626
+
1627
+ </td>
1628
+
1629
+
1630
+
1631
+ <td class="default">
1632
+
1633
+ <code>null</code>
1634
+
1635
+ </td>
1636
+
1637
+
1638
+ <td class="description last"><p>輸入DECIMAL主鍵欄之scale, 取自getColScale, 非DECIMAL者為null</p></td>
1639
+ </tr>
1640
+
1641
+
1642
+ </tbody>
1643
+ </table>
1644
+
1645
+
1646
+
1647
+
1648
+
1649
+
1650
+
1651
+
1652
+
1653
+
1654
+
1655
+
1656
+
1657
+
1658
+
1659
+
1660
+ <h5 class="h5-returns">Returns:</h5>
1661
+
1662
+
1663
+ <div class="param-desc">
1664
+ <p>回傳{kind,v}</p>
1665
+ </div>
1666
+
1667
+
1668
+
1669
+ <dl class="param-type">
1670
+ <dt>
1671
+ Type
1672
+ </dt>
1673
+ <dd>
1674
+
1675
+ <span class="param-type">Object</span>
1676
+
1677
+
1678
+
1679
+ </dd>
1680
+ </dl>
1681
+
1682
+
1683
+
1684
+
1685
+
1686
+
1687
+
1688
+
1689
+
1690
+
1691
+
1692
+ </article>
1693
+
1694
+ </section>
1695
+
1696
+
1697
+
1698
+
1699
+
1700
+
1701
+ </div>
1702
+
1703
+ <br class="clear">
1704
+
1705
+ <footer>
1706
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Fri Oct 16 2026 13:47:09 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1707
+ </footer>
1708
+
1709
+ <script>prettyPrint();</script>
1710
+ <script src="scripts/polyfill.js"></script>
1711
+ <script src="scripts/linenumber.js"></script>
1712
+
1713
+
1714
+
1715
+ </body>
1716
+ </html>