@maiyunnet/kebab 8.6.4 → 8.6.5
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/doc/kebab-rag.md +6 -6
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/db/conn.js +8 -6
- package/package.json +1 -1
package/doc/kebab-rag.md
CHANGED
|
@@ -1410,7 +1410,7 @@ index/variables/VER.md
|
|
|
1410
1410
|
|
|
1411
1411
|
# Variable: VER
|
|
1412
1412
|
|
|
1413
|
-
> `const` **VER**: `"8.6.
|
|
1413
|
+
> `const` **VER**: `"8.6.5"` = `'8.6.5'`
|
|
1414
1414
|
|
|
1415
1415
|
Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
|
|
1416
1416
|
|
|
@@ -6332,7 +6332,7 @@ Defined in: [lib/db/conn.ts:59](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
6332
6332
|
|
|
6333
6333
|
> **beginTransaction**(): `Promise`\<`boolean`\>
|
|
6334
6334
|
|
|
6335
|
-
Defined in: [lib/db/conn.ts:
|
|
6335
|
+
Defined in: [lib/db/conn.ts:319](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L319)
|
|
6336
6336
|
|
|
6337
6337
|
#### Returns
|
|
6338
6338
|
|
|
@@ -6344,7 +6344,7 @@ Defined in: [lib/db/conn.ts:317](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
6344
6344
|
|
|
6345
6345
|
> **commit**(): `Promise`\<`boolean`\>
|
|
6346
6346
|
|
|
6347
|
-
Defined in: [lib/db/conn.ts:
|
|
6347
|
+
Defined in: [lib/db/conn.ts:340](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L340)
|
|
6348
6348
|
|
|
6349
6349
|
#### Returns
|
|
6350
6350
|
|
|
@@ -6356,7 +6356,7 @@ Defined in: [lib/db/conn.ts:338](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
6356
6356
|
|
|
6357
6357
|
> **end**(): `Promise`\<`boolean`\>
|
|
6358
6358
|
|
|
6359
|
-
Defined in: [lib/db/conn.ts:
|
|
6359
|
+
Defined in: [lib/db/conn.ts:308](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L308)
|
|
6360
6360
|
|
|
6361
6361
|
关闭连接,一般情况下不使用
|
|
6362
6362
|
|
|
@@ -6370,7 +6370,7 @@ Defined in: [lib/db/conn.ts:306](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
6370
6370
|
|
|
6371
6371
|
> **execute**(`sql`, `values?`): `Promise`\<[`IPacket`](../../interfaces/IPacket.md)\>
|
|
6372
6372
|
|
|
6373
|
-
Defined in: [lib/db/conn.ts:
|
|
6373
|
+
Defined in: [lib/db/conn.ts:235](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L235)
|
|
6374
6374
|
|
|
6375
6375
|
执行一条 SQL 并获得影响行数对象 packet
|
|
6376
6376
|
|
|
@@ -6560,7 +6560,7 @@ Defined in: [lib/db/conn.ts:146](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
6560
6560
|
|
|
6561
6561
|
> **rollback**(): `Promise`\<`boolean`\>
|
|
6562
6562
|
|
|
6563
|
-
Defined in: [lib/db/conn.ts:
|
|
6563
|
+
Defined in: [lib/db/conn.ts:358](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L358)
|
|
6564
6564
|
|
|
6565
6565
|
#### Returns
|
|
6566
6566
|
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '8.6.
|
|
9
|
+
export const VER = '8.6.5';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/db/conn.js
CHANGED
|
@@ -172,10 +172,12 @@ export class Connection {
|
|
|
172
172
|
else {
|
|
173
173
|
const res = await this._link.execute(sql, values);
|
|
174
174
|
rtn.rows = res[0];
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
if (res[1]) {
|
|
176
|
+
rtn.fields = res[1].map(item => ({
|
|
177
|
+
'name': item.orgName || item.name,
|
|
178
|
+
'length': item.length ?? -1,
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
179
181
|
}
|
|
180
182
|
if (Date.now() - time > 200) {
|
|
181
183
|
lCore.log({}, '[WARNING][DB][Connection][query] slow sql 200ms: ' + sql, '-warning');
|
|
@@ -184,7 +186,7 @@ export class Connection {
|
|
|
184
186
|
catch (e) {
|
|
185
187
|
rtn.error = {
|
|
186
188
|
'message': e.message,
|
|
187
|
-
'errno': e.errno ?? Number(e.code.replace(/[a-zA-Z]/g, '')),
|
|
189
|
+
'errno': e.errno ?? (e.code ? Number(e.code.replace(/[a-zA-Z]/g, '')) : 0),
|
|
188
190
|
};
|
|
189
191
|
rtn.result = -500;
|
|
190
192
|
}
|
|
@@ -251,7 +253,7 @@ export class Connection {
|
|
|
251
253
|
}
|
|
252
254
|
}
|
|
253
255
|
catch (e) {
|
|
254
|
-
let errno = e.errno ?? Number(e.code.replace(/[a-zA-Z]/g, ''));
|
|
256
|
+
let errno = e.errno ?? (e.code ? Number(e.code.replace(/[a-zA-Z]/g, '')) : 0);
|
|
255
257
|
if (errno === 23505) {
|
|
256
258
|
errno = 1062;
|
|
257
259
|
}
|