w-orm-lmdb 1.0.18 → 1.0.20

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.
@@ -29,7 +29,7 @@
29
29
  <nav >
30
30
 
31
31
 
32
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="WOrmLmdb.html">WOrmLmdb</a><ul class='methods'><li data-type='method'><a href="WOrmLmdb.html#.del">del</a></li><li data-type='method'><a href="WOrmLmdb.html#.delAll">delAll</a></li><li data-type='method'><a href="WOrmLmdb.html#.insert">insert</a></li><li data-type='method'><a href="WOrmLmdb.html#.save">save</a></li><li data-type='method'><a href="WOrmLmdb.html#.select">select</a></li><li data-type='method'><a href="WOrmLmdb.html#.selectByPk">selectByPk</a></li></ul></li></ul>
32
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="WOrmLmdb.html">WOrmLmdb</a><ul class='methods'><li data-type='method'><a href="WOrmLmdb.html#.del">del</a></li><li data-type='method'><a href="WOrmLmdb.html#.delAll">delAll</a></li><li data-type='method'><a href="WOrmLmdb.html#.insert">insert</a></li><li data-type='method'><a href="WOrmLmdb.html#.insertBulk">insertBulk</a></li><li data-type='method'><a href="WOrmLmdb.html#.save">save</a></li><li data-type='method'><a href="WOrmLmdb.html#.select">select</a></li><li data-type='method'><a href="WOrmLmdb.html#.selectByPk">selectByPk</a></li></ul></li></ul>
33
33
 
34
34
  </nav>
35
35
 
@@ -79,12 +79,12 @@
79
79
  事件僅為附加通知,其所送出之資訊皆另有正規管道(操作結果經resolve、整批性錯誤經reject、逐筆失敗經該筆之err欄位),
80
80
  故不監聽亦能取得完整資訊,且監聽與否不改變任何操作之回傳值。</p>
81
81
  <p>change事件,參數為(mode, data, res),於資料實際異動成功後發出:
82
- mode為操作別字串,可為'insert'、'save'、'del'、'delAll';save內若逐筆走自動插入則該筆另發出mode為'insert'之事件。
82
+ mode為操作別字串,可為'insert'、'insertBulk'、'save'、'del'、'delAll';save內若逐筆走自動插入則該筆另發出mode為'insert'之事件。
83
83
  data為本次操作之輸入數據,delAll固定為null。
84
84
  res為本次操作之回傳結果。
85
85
  逐筆函數以整批為單位發出一次而不逐筆發出,select與selectByPk不發出本事件。</p>
86
86
  <p>error事件,參數為(mode, data, err),於操作發生錯誤時發出:
87
- mode為操作別字串,可為'select'、'selectByPk'、'insert'、'save'、'del'、'delAll'。
87
+ mode為操作別字串,可為'select'、'selectByPk'、'insert'、'insertBulk'、'save'、'del'、'delAll'。
88
88
  data為本次操作之輸入數據,無輸入數據者為null。
89
89
  err為錯誤訊息字串,內容與正規管道所送出者一致。
90
90
  整批性錯誤於reject之前發出;逐筆失敗於該筆結果定案後發出,每筆一次。
@@ -523,7 +523,7 @@ err為錯誤訊息字串,內容與正規管道所送出者一致。
523
523
 
524
524
  <dt class="tag-source">Source:</dt>
525
525
  <dd class="tag-source"><ul class="dummy"><li>
526
- <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line620">line 620</a>
526
+ <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line777">line 777</a>
527
527
  </li></ul></dd>
528
528
 
529
529
 
@@ -684,7 +684,7 @@ err為錯誤訊息字串,內容與正規管道所送出者一致。
684
684
 
685
685
  <dt class="tag-source">Source:</dt>
686
686
  <dd class="tag-source"><ul class="dummy"><li>
687
- <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line751">line 751</a>
687
+ <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line913">line 913</a>
688
688
  </li></ul></dd>
689
689
 
690
690
 
@@ -846,7 +846,7 @@ err為錯誤訊息字串,內容與正規管道所送出者一致。
846
846
 
847
847
 
848
848
 
849
- <h4 class="name" id=".insert"><span class="type-signature type-signature-async, static">(async, static) </span>insert<span class="signature">(data)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
849
+ <h4 class="name" id=".insert"><span class="type-signature type-signature-async, static">(async, static) </span>insert<span class="signature">(data, option<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
850
850
 
851
851
 
852
852
 
@@ -862,7 +862,298 @@ err為錯誤訊息字串,內容與正規管道所送出者一致。
862
862
 
863
863
  <dt class="tag-source">Source:</dt>
864
864
  <dd class="tag-source"><ul class="dummy"><li>
865
- <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line325">line 325</a>
865
+ <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line349">line 349</a>
866
+ </li></ul></dd>
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
+
898
+ </dl>
899
+
900
+
901
+
902
+
903
+
904
+
905
+
906
+
907
+
908
+
909
+
910
+
911
+
912
+ <h5 class="h5-parameters">Parameters:</h5>
913
+
914
+
915
+ <table class="params">
916
+ <thead>
917
+ <tr>
918
+
919
+ <th>Name</th>
920
+
921
+
922
+ <th>Type</th>
923
+
924
+
925
+ <th>Attributes</th>
926
+
927
+
928
+
929
+ <th>Default</th>
930
+
931
+
932
+ <th class="last">Description</th>
933
+ </tr>
934
+ </thead>
935
+
936
+ <tbody>
937
+
938
+
939
+ <tr>
940
+
941
+ <td class="name"><code>data</code></td>
942
+
943
+
944
+ <td class="type">
945
+
946
+
947
+ <span class="param-type">Object</span>
948
+ |
949
+
950
+ <span class="param-type">Array</span>
951
+
952
+
953
+
954
+
955
+ </td>
956
+
957
+
958
+ <td class="attributes">
959
+
960
+
961
+
962
+
963
+
964
+ </td>
965
+
966
+
967
+
968
+ <td class="default">
969
+
970
+ </td>
971
+
972
+
973
+ <td class="description last"><p>輸入數據物件或陣列</p></td>
974
+ </tr>
975
+
976
+
977
+
978
+ <tr>
979
+
980
+ <td class="name"><code>option</code></td>
981
+
982
+
983
+ <td class="type">
984
+
985
+
986
+ <span class="param-type">Object</span>
987
+
988
+
989
+
990
+
991
+ </td>
992
+
993
+
994
+ <td class="attributes">
995
+
996
+ &lt;optional><br>
997
+
998
+
999
+
1000
+
1001
+
1002
+ </td>
1003
+
1004
+
1005
+
1006
+ <td class="default">
1007
+
1008
+ <code>{}</code>
1009
+
1010
+ </td>
1011
+
1012
+
1013
+ <td class="description last"><p>輸入設定物件,預設為{}</p>
1014
+ <h6>Properties</h6>
1015
+
1016
+
1017
+ <table class="params">
1018
+ <thead>
1019
+ <tr>
1020
+
1021
+ <th>Name</th>
1022
+
1023
+
1024
+ <th>Type</th>
1025
+
1026
+
1027
+ <th>Attributes</th>
1028
+
1029
+
1030
+
1031
+ <th>Default</th>
1032
+
1033
+
1034
+ <th class="last">Description</th>
1035
+ </tr>
1036
+ </thead>
1037
+
1038
+ <tbody>
1039
+
1040
+
1041
+ <tr>
1042
+
1043
+ <td class="name"><code>returnList</code></td>
1044
+
1045
+
1046
+ <td class="type">
1047
+
1048
+
1049
+ <span class="param-type">Boolean</span>
1050
+
1051
+
1052
+
1053
+
1054
+ </td>
1055
+
1056
+
1057
+ <td class="attributes">
1058
+
1059
+ &lt;optional><br>
1060
+
1061
+
1062
+
1063
+
1064
+
1065
+ </td>
1066
+
1067
+
1068
+
1069
+ <td class="default">
1070
+
1071
+ <code>false</code>
1072
+
1073
+ </td>
1074
+
1075
+
1076
+ <td class="description last"><p>輸入是否改回傳逐筆結果布林值,預設false。給true時回傳與輸入等長保序之陣列,各筆為{n,nInserted,ok},nInserted為1即該筆為新增;聚合計數只回答有幾筆是新的,逐筆結果方能回答是哪幾筆,供下游僅對新資料執行昂貴動作。回傳形式由呼叫點靜態決定,共用之結果處理程式碼不可跨不同取值之呼叫點混用</p></td>
1077
+ </tr>
1078
+
1079
+
1080
+ </tbody>
1081
+ </table>
1082
+
1083
+ </td>
1084
+ </tr>
1085
+
1086
+
1087
+ </tbody>
1088
+ </table>
1089
+
1090
+
1091
+
1092
+
1093
+
1094
+
1095
+
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+
1102
+
1103
+
1104
+
1105
+ <h5 class="h5-returns">Returns:</h5>
1106
+
1107
+
1108
+ <div class="param-desc">
1109
+ <p>回傳Promise,resolve依returnList回傳插入結果:預設回傳聚合物件{n,nInserted,ok},n為輸入筆數、nInserted為實際插入筆數;returnList為true時回傳逐筆陣列,各筆n恆為1(主鍵命中或經插入)、ok恆為1(insert之錯誤皆屬整批性而reject,不進逐筆);reject回傳錯誤訊息</p>
1110
+ </div>
1111
+
1112
+
1113
+
1114
+ <dl class="param-type">
1115
+ <dt>
1116
+ Type
1117
+ </dt>
1118
+ <dd>
1119
+
1120
+ <span class="param-type">Promise</span>
1121
+
1122
+
1123
+
1124
+ </dd>
1125
+ </dl>
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+
1135
+
1136
+ <h4 class="name" id=".insertBulk"><span class="type-signature type-signature-async, static">(async, static) </span>insertBulk<span class="signature">(data)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1137
+
1138
+
1139
+
1140
+
1141
+
1142
+
1143
+ <dl class="details">
1144
+
1145
+ <dt class="tag-description">Description:</dt>
1146
+ <dd class="tag-description"><ul class="dummy"><li><p>批次插入數據,全批視為一個單位,全部插入成功或一筆都不寫入
1147
+ 註: 本函數非insert之加速版,兩者衝突政策不同。insert於主鍵已存在時跳過該筆而整批ok為1,
1148
+ 本函數則整批reject且不寫入任何一筆;同批含重複主鍵者亦視為衝突。確無衝突時兩者結果相同
1149
+ 註: 於本套件不會較insert快,因insert本即以Promise.all一次送出全部條件寫入而非逐筆await,
1150
+ 提供本函數係為與其他w-orm系列套件維持同一組函數,令呼叫端得於各套件間替換而不須改寫呼叫</p></li></ul></dd>
1151
+
1152
+
1153
+
1154
+ <dt class="tag-source">Source:</dt>
1155
+ <dd class="tag-source"><ul class="dummy"><li>
1156
+ <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line474">line 474</a>
866
1157
  </li></ul></dd>
867
1158
 
868
1159
 
@@ -980,7 +1271,7 @@ err為錯誤訊息字串,內容與正規管道所送出者一致。
980
1271
 
981
1272
 
982
1273
  <div class="param-desc">
983
- <p>回傳Promise,resolve回傳插入結果物件{n,nInserted,ok},n為輸入筆數、nInserted為實際插入筆數,reject回傳錯誤訊息</p>
1274
+ <p>回傳Promise,resolve回傳插入結果物件{n,nInserted,ok},n為輸入筆數、nInserted成功時恆等於n,任一筆主鍵已存在則reject回傳錯誤訊息</p>
984
1275
  </div>
985
1276
 
986
1277
 
@@ -1023,7 +1314,7 @@ err為錯誤訊息字串,內容與正規管道所送出者一致。
1023
1314
 
1024
1315
  <dt class="tag-source">Source:</dt>
1025
1316
  <dd class="tag-source"><ul class="dummy"><li>
1026
- <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line419">line 419</a>
1317
+ <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line571">line 571</a>
1027
1318
  </li></ul></dd>
1028
1319
 
1029
1320
 
@@ -1310,7 +1601,7 @@ err為錯誤訊息字串,內容與正規管道所送出者一致。
1310
1601
 
1311
1602
  <dt class="tag-source">Source:</dt>
1312
1603
  <dd class="tag-source"><ul class="dummy"><li>
1313
- <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line214">line 214</a>
1604
+ <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line226">line 226</a>
1314
1605
  </li></ul></dd>
1315
1606
 
1316
1607
 
@@ -1489,7 +1780,7 @@ err為錯誤訊息字串,內容與正規管道所送出者一致。
1489
1780
 
1490
1781
  <dt class="tag-source">Source:</dt>
1491
1782
  <dd class="tag-source"><ul class="dummy"><li>
1492
- <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line273">line 273</a>
1783
+ <a href="WOrmLmdb.mjs.html">WOrmLmdb.mjs</a>, <a href="WOrmLmdb.mjs.html#line290">line 290</a>
1493
1784
  </li></ul></dd>
1494
1785
 
1495
1786
 
@@ -1646,7 +1937,7 @@ err為錯誤訊息字串,內容與正規管道所送出者一致。
1646
1937
  <br class="clear">
1647
1938
 
1648
1939
  <footer>
1649
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Mon Aug 17 2026 08:38:27 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1940
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Mon Aug 17 2026 17:58:14 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1650
1941
  </footer>
1651
1942
 
1652
1943
  <script>prettyPrint();</script>