@maiyunnet/kebab 8.0.4 → 8.0.6

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
@@ -560,9 +560,9 @@ Defined in: [index.ts:148](https://github.com/maiyunnet/kebab/blob/master/index.
560
560
 
561
561
  ## Properties
562
562
 
563
- ### charset
563
+ ### charset?
564
564
 
565
- > **charset**: `string`
565
+ > `optional` **charset**: `string`
566
566
 
567
567
  Defined in: [index.ts:151](https://github.com/maiyunnet/kebab/blob/master/index.ts#L151)
568
568
 
@@ -1385,7 +1385,7 @@ index/variables/VER.md
1385
1385
 
1386
1386
  # Variable: VER
1387
1387
 
1388
- > `const` **VER**: `"8.0.4"` = `'8.0.4'`
1388
+ > `const` **VER**: `"8.0.6"` = `'8.0.6'`
1389
1389
 
1390
1390
  Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
1391
1391
 
@@ -6645,7 +6645,7 @@ Defined in: [lib/db/pool.ts:126](https://github.com/maiyunnet/kebab/blob/master/
6645
6645
 
6646
6646
  > **beginTransaction**(`ctr`): `Promise`\<[`Transaction`](../../tran/classes/Transaction.md) \| `null`\>
6647
6647
 
6648
- Defined in: [lib/db/pool.ts:189](https://github.com/maiyunnet/kebab/blob/master/lib/db/pool.ts#L189)
6648
+ Defined in: [lib/db/pool.ts:194](https://github.com/maiyunnet/kebab/blob/master/lib/db/pool.ts#L194)
6649
6649
 
6650
6650
  开启事务,返回事务对象并锁定连接,别人任何人不可用,有 ctr 的话必传 this,独立执行时可传 null
6651
6651
 
@@ -6665,7 +6665,7 @@ Defined in: [lib/db/pool.ts:189](https://github.com/maiyunnet/kebab/blob/master/
6665
6665
 
6666
6666
  > **execute**(`sql`, `values?`): `Promise`\<[`IPacket`](../../interfaces/IPacket.md)\>
6667
6667
 
6668
- Defined in: [lib/db/pool.ts:169](https://github.com/maiyunnet/kebab/blob/master/lib/db/pool.ts#L169)
6668
+ Defined in: [lib/db/pool.ts:174](https://github.com/maiyunnet/kebab/blob/master/lib/db/pool.ts#L174)
6669
6669
 
6670
6670
  执行一条 SQL 并获得影响行数对象 packet,连接失败抛出错误
6671
6671
 
@@ -6689,11 +6689,25 @@ Defined in: [lib/db/pool.ts:169](https://github.com/maiyunnet/kebab/blob/master/
6689
6689
 
6690
6690
  ***
6691
6691
 
6692
+ ### getName()
6693
+
6694
+ > **getName**(): `string`
6695
+
6696
+ Defined in: [lib/db/pool.ts:140](https://github.com/maiyunnet/kebab/blob/master/lib/db/pool.ts#L140)
6697
+
6698
+ 获取当前连接的数据库名称
6699
+
6700
+ #### Returns
6701
+
6702
+ `string`
6703
+
6704
+ ***
6705
+
6692
6706
  ### getQueries()
6693
6707
 
6694
6708
  > **getQueries**(): `number`
6695
6709
 
6696
- Defined in: [lib/db/pool.ts:321](https://github.com/maiyunnet/kebab/blob/master/lib/db/pool.ts#L321)
6710
+ Defined in: [lib/db/pool.ts:326](https://github.com/maiyunnet/kebab/blob/master/lib/db/pool.ts#L326)
6697
6711
 
6698
6712
  获取 SQL 执行次数
6699
6713
 
@@ -6721,7 +6735,7 @@ Defined in: [lib/db/pool.ts:135](https://github.com/maiyunnet/kebab/blob/master/
6721
6735
 
6722
6736
  > **query**(`sql`, `values?`): `Promise`\<[`IData`](../../interfaces/IData.md)\>
6723
6737
 
6724
- Defined in: [lib/db/pool.ts:145](https://github.com/maiyunnet/kebab/blob/master/lib/db/pool.ts#L145)
6738
+ Defined in: [lib/db/pool.ts:150](https://github.com/maiyunnet/kebab/blob/master/lib/db/pool.ts#L150)
6725
6739
 
6726
6740
  执行一条 SQL,无视顺序和相同连接,随用随取
6727
6741
 
package/index.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * --- 本文件用来定义每个目录实体地址的常量 ---
6
6
  */
7
7
  /** --- 当前系统版本号 --- */
8
- export declare const VER = "8.0.4";
8
+ export declare const VER = "8.0.6";
9
9
  /** --- 框架根目录,以 / 结尾 --- */
10
10
  export declare const ROOT_PATH: string;
11
11
  export declare const LIB_PATH: string;
@@ -117,7 +117,7 @@ export interface IConfigTurnstile {
117
117
  export interface IConfigDb {
118
118
  'host': string;
119
119
  'port': number;
120
- 'charset': string;
120
+ 'charset'?: string;
121
121
  'name'?: string;
122
122
  'user': string;
123
123
  'pwd': string;
package/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * --- 本文件用来定义每个目录实体地址的常量 ---
7
7
  */
8
8
  /** --- 当前系统版本号 --- */
9
- export const VER = '8.0.4';
9
+ export const VER = '8.0.6';
10
10
  // --- 服务端用的路径 ---
11
11
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
12
12
  /** --- /xxx/xxx --- */
package/lib/db/pool.d.ts CHANGED
@@ -33,6 +33,8 @@ export declare class Pool {
33
33
  });
34
34
  /** --- 获取当前连接的服务商 --- */
35
35
  getService(): lDb.ESERVICE;
36
+ /** --- 获取当前连接的数据库名称 --- */
37
+ getName(): string;
36
38
  /**
37
39
  * --- 执行一条 SQL,无视顺序和相同连接,随用随取 ---
38
40
  * @param sql 执行的 SQL 字符串
package/lib/db/pool.js CHANGED
@@ -103,6 +103,10 @@ export class Pool {
103
103
  getService() {
104
104
  return this._service;
105
105
  }
106
+ /** --- 获取当前连接的数据库名称 --- */
107
+ getName() {
108
+ return this._etc.name ?? '';
109
+ }
106
110
  /**
107
111
  * --- 执行一条 SQL,无视顺序和相同连接,随用随取 ---
108
112
  * @param sql 执行的 SQL 字符串
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "8.0.4",
3
+ "version": "8.0.6",
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": [