@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 CHANGED
@@ -1410,7 +1410,7 @@ index/variables/VER.md
1410
1410
 
1411
1411
  # Variable: VER
1412
1412
 
1413
- > `const` **VER**: `"8.6.4"` = `'8.6.4'`
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:317](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L317)
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:338](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L338)
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:306](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L306)
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:233](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L233)
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:356](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L356)
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
@@ -5,7 +5,7 @@
5
5
  * --- 本文件用来定义每个目录实体地址的常量 ---
6
6
  */
7
7
  /** --- 当前系统版本号 --- */
8
- export declare const VER = "8.6.4";
8
+ export declare const VER = "8.6.5";
9
9
  /** --- 框架根目录,以 / 结尾 --- */
10
10
  export declare const ROOT_PATH: string;
11
11
  /** --- 框架的 LIB,以 / 结尾 --- */
package/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * --- 本文件用来定义每个目录实体地址的常量 ---
7
7
  */
8
8
  /** --- 当前系统版本号 --- */
9
- export const VER = '8.6.4';
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
- rtn.fields = res[1].map(item => ({
176
- 'name': item.orgName || item.name,
177
- 'length': item.length ?? -1,
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "8.6.4",
3
+ "version": "8.6.5",
4
4
  "description": "Simple, easy-to-use, and fully-featured Node.js framework that is ready-to-use out of the box.",
5
5
  "type": "module",
6
6
  "keywords": [