baja-lite 1.4.7 → 1.4.8
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/boot.js +2 -2
- package/package.json +1 -1
- package/sql.d.ts +345 -346
- package/sql.js +381 -763
package/sql.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const _inTransaction: unique symbol;
|
|
|
20
20
|
declare const _daoDB: unique symbol;
|
|
21
21
|
declare const _sqliteRemoteName: unique symbol;
|
|
22
22
|
declare const _SqlOption: unique symbol;
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const _DataConvert: unique symbol;
|
|
24
24
|
export declare const _enum: unique symbol;
|
|
25
25
|
export declare const _GlobalSqlOption: unique symbol;
|
|
26
26
|
export declare const _EventBus: unique symbol;
|
|
@@ -41,27 +41,27 @@ export declare enum SyncMode {
|
|
|
41
41
|
}
|
|
42
42
|
export declare enum InsertMode {
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
# 默认使用
|
|
45
|
+
** 支持单个、批量,语法 `INSERT INTO XX VALUES (第一条数据), (第二条数据);`
|
|
46
|
+
** 批量执行有性能优势,但无法利用数据库的sql预编译功能
|
|
47
|
+
*/
|
|
48
48
|
Insert = 0,
|
|
49
49
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
# 利用临时表
|
|
51
|
+
## 执行步骤
|
|
52
|
+
1. 建立临时表(从正式表复制)
|
|
53
|
+
2. 数据全部进入临时表
|
|
54
|
+
3. 临时表数据转移到正式表: `INSERT INTO 正式表 SELECT * FROM 临时表`
|
|
55
|
+
4. 删除临时表
|
|
56
|
+
## 注意
|
|
57
|
+
1. 适用于:主键不会冲突、非自增
|
|
58
|
+
2. 临时表的结构复制正式表
|
|
59
59
|
*/
|
|
60
60
|
InsertWithTempTable = 1,
|
|
61
61
|
InsertIfNotExists = 2,
|
|
62
62
|
/**
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
# 插入或者更新
|
|
64
|
+
1. 判断依据是主键
|
|
65
65
|
*/
|
|
66
66
|
Replace = 3
|
|
67
67
|
}
|
|
@@ -72,7 +72,7 @@ export declare enum DeleteMode {
|
|
|
72
72
|
`DELETE FROM WHERE (id = 1) OR (id = 2)`
|
|
73
73
|
### 例二
|
|
74
74
|
`DELETE FROM WHERE (id = 1 AND idx = 11) OR (id = 2 AND idx = 22)`
|
|
75
|
-
|
|
75
|
+
*/
|
|
76
76
|
Common = 0,
|
|
77
77
|
TempTable = 1
|
|
78
78
|
}
|
|
@@ -83,7 +83,7 @@ export declare enum SelectMode {
|
|
|
83
83
|
`SELECT * FROM WHERE (id = 1) OR (id = 2)`
|
|
84
84
|
### 例二
|
|
85
85
|
`SELECT * FROM WHERE (id = 1 AND idx = 11) OR (id = 2 AND idx = 22)`
|
|
86
|
-
|
|
86
|
+
*/
|
|
87
87
|
Common = 0,
|
|
88
88
|
TempTable = 1
|
|
89
89
|
}
|
|
@@ -174,12 +174,12 @@ interface ServiceOption {
|
|
|
174
174
|
# 全局行为配置文件
|
|
175
175
|
### `sqlDir?: string;` 数据库查询语句存放目录.存放格式为 export.default 的js、ts, 存放内容满足格式:
|
|
176
176
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
177
|
+
```
|
|
178
|
+
interface SqlModel {
|
|
179
|
+
[key: string]: string | ((params: { [k: string]: any }, context: any, isCount?: boolean) => string)
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
可以继承该接口来约束格式
|
|
183
183
|
*/
|
|
184
184
|
export interface GlobalSqlOptionForWeb {
|
|
185
185
|
/** 增改忽略Undefined */
|
|
@@ -193,18 +193,18 @@ export interface GlobalSqlOptionForWeb {
|
|
|
193
193
|
SqliteRemote?: {
|
|
194
194
|
/**
|
|
195
195
|
## 单一数据源
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
196
|
+
```
|
|
197
|
+
db: 'd:/1.db'
|
|
198
|
+
```
|
|
199
|
+
## 多数据源:传入多个连接配置
|
|
200
|
+
```
|
|
201
|
+
db: {
|
|
202
|
+
db1: 'd:/1.db',
|
|
203
|
+
db2: 'd:/2.db'
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
不支持 `SqliteMemory`
|
|
207
|
+
*/
|
|
208
208
|
db?: Record<string, string> | string;
|
|
209
209
|
/** 远程SQLITE接口实现,适用于Electron, 采用Ipc 的handel机制实现 */
|
|
210
210
|
service: SqliteRemoteInterface;
|
|
@@ -222,11 +222,11 @@ export interface GlobalSqlOptionForWeb {
|
|
|
222
222
|
*/
|
|
223
223
|
sqlFNMap?: Record<string, string>;
|
|
224
224
|
/**
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
225
|
+
// 第一个元素=列名,第二个元素是属性路径,
|
|
226
|
+
[
|
|
227
|
+
['dit_id', ['id']], // 列名ditid,对应属性id
|
|
228
|
+
['event_id', ['eventMainInfo', 'id']] // 列名event_id对应属性eventMainInfo.id
|
|
229
|
+
]
|
|
230
230
|
*/
|
|
231
231
|
sqlMapperMap?: SqlMappers;
|
|
232
232
|
/** 提供的枚举MAP */
|
|
@@ -236,12 +236,12 @@ export interface GlobalSqlOptionForWeb {
|
|
|
236
236
|
* 当设置为columnMode.HUMP时,切记将代码生成器中属性名称改对
|
|
237
237
|
* # 自定义sql查询时,无法自动转换哦,可使用标签转换:
|
|
238
238
|
*```
|
|
239
|
-
|
|
239
|
+
SELECT
|
|
240
240
|
* {{#hump}} seller_sku2, seller_sku {{/hump}}
|
|
241
241
|
* ```
|
|
242
242
|
* 转换为
|
|
243
243
|
*```
|
|
244
|
-
|
|
244
|
+
SELECT
|
|
245
245
|
* {{#hump}} seller_sku2 sellerSku2, seller_sku sellerSku {{/hump}}
|
|
246
246
|
* ```
|
|
247
247
|
*/
|
|
@@ -262,100 +262,100 @@ export interface GlobalSqlOptionForWeb {
|
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
264
264
|
# 全局行为配置文件
|
|
265
|
-
|
|
265
|
+
MYSQL编码: 'utf8mb4', utf8mb4_general_ci'
|
|
266
266
|
### `sqlDir?: string;` 数据库查询语句存放目录.存放格式为 export.default 的js、ts, 存放内容满足格式:
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
interface SqlModel {
|
|
270
|
+
[key: string]: string | ((params: { [k: string]: any }, context: any, isCount?: boolean) => string)
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
可以继承该接口来约束格式
|
|
274
274
|
*/
|
|
275
275
|
export interface GlobalSqlOption extends GlobalSqlOptionForWeb {
|
|
276
276
|
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
277
|
+
初始化MYSQL链接 支持多数据源
|
|
278
|
+
## 单一数据源: 直接传入Mysql2的连接配置
|
|
279
|
+
[MYSQL初始化文档](https://github.com/mysqljs/mysql#connection-options)
|
|
280
|
+
```
|
|
281
|
+
Mysql: {
|
|
282
|
+
host: '127.0.0.1',
|
|
283
|
+
...
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
## 多数据源:传入多个Mysql2的连接配置
|
|
287
|
+
```
|
|
288
|
+
Mysql: {
|
|
289
|
+
db1: {
|
|
290
|
+
host: '127.0.0.1',
|
|
291
|
+
...
|
|
292
|
+
},
|
|
293
|
+
db2: {
|
|
294
|
+
host: '127.0.0.1',
|
|
295
|
+
...
|
|
296
|
+
},
|
|
297
|
+
...
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
*/
|
|
301
301
|
Mysql?: Record<string, Record<string, any>> | Record<string, any>;
|
|
302
302
|
/**
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
303
|
+
初始化postgresql链接 支持多数据源
|
|
304
|
+
## 单一数据源: 直接传入postgresql的连接配置
|
|
305
|
+
[Postgresql初始化文档](https://github.com/brianc/node-postgres/tree/master/packages/pg-pool)
|
|
306
|
+
```
|
|
307
|
+
Postgresql: {
|
|
308
|
+
database: 'postgres',
|
|
309
|
+
user: 'brianc',
|
|
310
|
+
password: 'secret!',
|
|
311
|
+
port: 5432,
|
|
312
|
+
ssl: true,
|
|
313
|
+
max: 20, // set pool max size to 20
|
|
314
|
+
idleTimeoutMillis: 1000, // close idle clients after 1 second
|
|
315
|
+
connectionTimeoutMillis: 1000, // return an error after 1 second if connection could not be established
|
|
316
|
+
maxUses: 7500, // close (and replace) a connection after it has been used 7500 times (see below for discussion)
|
|
317
|
+
host?: string | undefined;
|
|
318
|
+
connectionString?: string | undefined;
|
|
319
|
+
keepAlive?: boolean | undefined;
|
|
320
|
+
stream?: () => stream.Duplex | stream.Duplex | undefined;
|
|
321
|
+
statement_timeout?: false | number | undefined;
|
|
322
|
+
query_timeout?: number | undefined;
|
|
323
|
+
keepAliveInitialDelayMillis?: number | undefined;
|
|
324
|
+
idle_in_transaction_session_timeout?: number | undefined;
|
|
325
|
+
application_name?: string | undefined;
|
|
326
|
+
types?: CustomTypesConfig | undefined;
|
|
327
|
+
options?: string | undefined;
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
## 多数据源:传入多个Postgresql的连接配置
|
|
331
|
+
```
|
|
332
|
+
Postgresql: {
|
|
333
|
+
db1: {
|
|
334
|
+
database: 'postgres',
|
|
335
|
+
user: 'brianc',
|
|
336
|
+
password: 'secret!',
|
|
337
|
+
port: 5432,
|
|
338
|
+
ssl: true,
|
|
339
|
+
max: 20, // set pool max size to 20
|
|
340
|
+
idleTimeoutMillis: 1000, // close idle clients after 1 second
|
|
341
|
+
connectionTimeoutMillis: 1000, // return an error after 1 second if connection could not be established
|
|
342
|
+
maxUses: 7500, // close (and replace) a connection after it has been used 7500 times (see below for discussion)
|
|
343
|
+
},
|
|
344
|
+
db2: {
|
|
345
|
+
database: 'postgres',
|
|
346
|
+
user: 'brianc',
|
|
347
|
+
password: 'secret!',
|
|
348
|
+
port: 5432,
|
|
349
|
+
ssl: true,
|
|
350
|
+
max: 20, // set pool max size to 20
|
|
351
|
+
idleTimeoutMillis: 1000, // close idle clients after 1 second
|
|
352
|
+
connectionTimeoutMillis: 1000, // return an error after 1 second if connection could not be established
|
|
353
|
+
maxUses: 7500, // close (and replace) a connection after it has been used 7500 times (see below for discussion)
|
|
354
|
+
},
|
|
355
|
+
...
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
*/
|
|
359
359
|
Postgresql?: Record<string, Record<string, any>> | Record<string, any>;
|
|
360
360
|
/**
|
|
361
361
|
## 单一数据源
|
|
@@ -364,34 +364,34 @@ export interface GlobalSqlOption extends GlobalSqlOptionForWeb {
|
|
|
364
364
|
```
|
|
365
365
|
## 多数据源:传入多个连接配置
|
|
366
366
|
```
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
367
|
+
Sqlite: {
|
|
368
|
+
db1: 'd:/1.db',
|
|
369
|
+
db2: 'd:/2.db'
|
|
370
|
+
}
|
|
371
371
|
```
|
|
372
|
-
|
|
372
|
+
路径 = `SqliteMemory` 将创建内存库
|
|
373
373
|
*/
|
|
374
374
|
Sqlite?: Record<string, string> | string;
|
|
375
375
|
/**
|
|
376
376
|
## 日志文件存放路径,该目录下文件名是模块名,例如有一个文件名为 `user.js`,内容为:
|
|
377
377
|
```
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
378
|
+
export default {
|
|
379
|
+
'sql_1': 'SELECT * FROM user WHERE username = :username',
|
|
380
|
+
'sql_2': (options: {
|
|
381
|
+
ctx?: any;
|
|
382
|
+
isCount?: boolean;
|
|
383
|
+
isSum?: boolean;
|
|
384
|
+
limitStart?: number;
|
|
385
|
+
limitEnd?: number;
|
|
386
|
+
sortName?: string; sortType?: string;
|
|
387
|
+
params?: Record<string, any>;
|
|
388
|
+
}) => {
|
|
389
|
+
return `
|
|
390
|
+
SELECT * FROM user u LEFT JOIN organ o ON u.orgid = o.orgid
|
|
391
|
+
WHERE o.orgid = :orgid;
|
|
392
|
+
`;
|
|
393
|
+
}
|
|
394
|
+
} as SqlModel;
|
|
395
395
|
```
|
|
396
396
|
** 可以看到,sql语句支持直接映射一个sql语句,也可以通过函数返回,返回字符串支持[mustache](https://github.com/janl/mustache.js)
|
|
397
397
|
** 上面的文件中,将注册两个SQL:`user.sql_1` 和 `user.sql_2`.
|
|
@@ -402,12 +402,12 @@ export interface GlobalSqlOption extends GlobalSqlOptionForWeb {
|
|
|
402
402
|
### 注意
|
|
403
403
|
1. 不要直接拼接参数:不安全且效率低
|
|
404
404
|
2. sqlite不支持多语句拼接
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
## 也支持.mu文件,格式略
|
|
406
|
+
*/
|
|
407
407
|
sqlDir?: string;
|
|
408
408
|
/**
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
## [mustache](https://mustache.github.io/) 编译时的[模板](https://github.com/janl/mustache.js#:~:text=requires%20only%20this%3A-,%7B%7B%3E%20next_more%7D%7D,-Why%3F%20Because%20the)
|
|
410
|
+
## 文件名就是模板名
|
|
411
411
|
*/
|
|
412
412
|
sqlFNDir?: string;
|
|
413
413
|
/**
|
|
@@ -424,42 +424,42 @@ export interface GlobalSqlOption extends GlobalSqlOptionForWeb {
|
|
|
424
424
|
*/
|
|
425
425
|
sqlMapDir?: string;
|
|
426
426
|
/**
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
427
|
+
## 映射数据为对象,文件名就是模板名
|
|
428
|
+
```
|
|
429
|
+
// 第一个元素=列名,第二个元素是属性路径,
|
|
430
|
+
// 该目录下可存放json文件,内容如下
|
|
431
|
+
//
|
|
432
|
+
// 可以在查询时使用,优先级高于hump
|
|
433
|
+
// 例如:
|
|
434
|
+
[
|
|
435
|
+
['dit_id', ['id'], 可选的默认值], // 列名ditid,对应属性id,当未查询返回时,使用默认值
|
|
436
|
+
['event_id', ['eventMainInfo', 'id']] // 列名event_id对应属性eventMainInfo.id,当未查询返回时,该属性不存在
|
|
437
|
+
]
|
|
438
|
+
```
|
|
439
439
|
*/
|
|
440
440
|
sqlMapperDir?: string;
|
|
441
441
|
/**
|
|
442
442
|
[REDIS初始化文档](https://github.com/redis/ioredis?tab=readme-ov-file#:~:text=connect%20to%20by%3A-,new%20Redis()%3B,-//%20Connect%20to%20127.0.0.1)
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
443
|
+
```
|
|
444
|
+
Redis: {
|
|
445
|
+
host: '127.0.0.1',
|
|
446
|
+
...
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
## 多数据源:传入多个Redis的连接配置
|
|
450
|
+
```
|
|
451
|
+
Redis: {
|
|
452
|
+
db1: {
|
|
453
|
+
host: '127.0.0.1',
|
|
454
|
+
...
|
|
455
|
+
},
|
|
456
|
+
db2: {
|
|
457
|
+
host: '127.0.0.1',
|
|
458
|
+
...
|
|
459
|
+
},
|
|
460
|
+
...
|
|
461
|
+
}
|
|
462
|
+
```
|
|
463
463
|
*/
|
|
464
464
|
Redis?: Record<string, Record<string, any>> | Record<string, any>;
|
|
465
465
|
/** sqlite数据库驱动初始化函数 */
|
|
@@ -663,15 +663,14 @@ export declare class SqlCache {
|
|
|
663
663
|
/**
|
|
664
664
|
*
|
|
665
665
|
* ```
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
666
|
+
// 第一个元素=列名,第二个元素是属性路径,
|
|
667
|
+
[
|
|
668
|
+
['dit_id', ['id']], // 列名ditid,对应属性id
|
|
669
|
+
['event_id', ['eventMainInfo', 'id']] // 列名event_id对应属性eventMainInfo.id
|
|
670
|
+
]
|
|
671
671
|
* ```
|
|
672
|
-
* @param
|
|
672
|
+
* @param am
|
|
673
673
|
* @param keys
|
|
674
|
-
* @param key
|
|
675
674
|
*/
|
|
676
675
|
private readResultMap;
|
|
677
676
|
init(options: {
|
|
@@ -734,40 +733,40 @@ export declare const DB: (config: ServiceOption) => <C extends {
|
|
|
734
733
|
};
|
|
735
734
|
} & C;
|
|
736
735
|
/**
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
736
|
+
js项目中实体类注解替代品,只要确保函数被执行即可,举例:
|
|
737
|
+
```
|
|
738
|
+
// 声明一个class
|
|
739
|
+
export class AmaFuck {}
|
|
740
|
+
DeclareClass(AmaFuck, [
|
|
741
|
+
{ type: "String", name: "SellerSKU" },
|
|
742
|
+
{ type: "String", name: "SellerSKU2" },
|
|
743
|
+
{ type: "String", name: "site" }
|
|
744
|
+
]);
|
|
745
|
+
```
|
|
747
746
|
*/
|
|
748
747
|
export declare function DeclareClass(clz: any, FieldOptions: FieldOption[]): void;
|
|
749
748
|
/**
|
|
750
749
|
JS项目中,service注解代替,举例:
|
|
751
750
|
```
|
|
752
751
|
// 声明一个service,注意这里的let
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
752
|
+
export let AmaService = class AmaService extends SqlService {};
|
|
753
|
+
AmaService = DeclareService(AmaService, {
|
|
754
|
+
tableName: "ama_fuck2",
|
|
755
|
+
clz: AmaFuck,
|
|
756
|
+
dbType: DBType.Sqlite,
|
|
757
|
+
sqliteVersion: "0.0.3"
|
|
758
|
+
});
|
|
760
759
|
```
|
|
761
760
|
*/
|
|
762
761
|
export declare function DeclareService(clz: any, config: ServiceOption): any;
|
|
763
762
|
/**
|
|
764
763
|
## 数据库服务
|
|
765
764
|
### 注解DB
|
|
766
|
-
|
|
765
|
+
|
|
767
766
|
### 泛型 T,同DB注解中的clz
|
|
768
767
|
** 服务中所有方法默认以该类型为准
|
|
769
768
|
**
|
|
770
|
-
|
|
769
|
+
|
|
771
770
|
*/
|
|
772
771
|
export declare class SqlService<T extends object> {
|
|
773
772
|
[_tableName]?: string;
|
|
@@ -798,30 +797,32 @@ export declare class SqlService<T extends object> {
|
|
|
798
797
|
}) => Partial<T>;
|
|
799
798
|
private _insert;
|
|
800
799
|
/**
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
* @
|
|
800
|
+
0. `sync`: 同步(sqlite)或者异步(mysql、remote),影响返回值类型,默认 `异步`
|
|
801
|
+
1. `data`:可是数组或者单对象
|
|
802
|
+
2. `skipUndefined`: boolean; 是否不处理值为undefined的字段,默认 true
|
|
803
|
+
3. `skipNull`: boolean; 是否不处理值为null的字段,默认 true
|
|
804
|
+
4. `skipEmptyString`: boolean; 是否不处理值为空字符串(`注意:多个空格也算空字符串`)的字段,默认 true
|
|
805
|
+
5. `maxDeal`: number; 批量处理时,每次处理多少个?默认500
|
|
806
|
+
6. `tableName`: 默认使用service注解的`tableName`,可以在某个方法中覆盖
|
|
807
|
+
7. `dbName`: 默认使用service注解的`dbName`,可以在某个方法中覆盖
|
|
808
|
+
8. `conn`: 仅在开启事务时需要主动传入,传入示例:
|
|
809
|
+
```
|
|
810
|
+
service.transaction(async conn => {
|
|
811
|
+
service.insert({conn});
|
|
812
|
+
});
|
|
813
|
+
```
|
|
814
|
+
9. `dao`: 永远不需要传入该值
|
|
815
|
+
10. `mode` :默认`insert`,可选如下
|
|
816
|
+
1. `insert`: 默认
|
|
817
|
+
2. `insertIfNotExists`: 通过主键或者existConditionOtherThanIds字段判断数据是否存在,不存在才插入,存在则不执行
|
|
818
|
+
3. `replace`: 只支持用主键判断, 存在更新, 不存在插入
|
|
819
|
+
11. `existConditionOtherThanIds`: insertIfNotExists时判断同一记录的字段名称,默认情况下按照ID判断,设置existConditionOtherThanIds后,不用id
|
|
820
|
+
12. `replaceWithDef` replace时,是否带入默认值? 默认true
|
|
821
|
+
### 返回值是最后一次插入的主键ID,对于自增ID表适用
|
|
822
|
+
1. 如果主键是自增批量操作,且期望返回所有记录的ID,那么需要设置 `option 中的 every = true`,此时效率降低
|
|
823
|
+
* @param {{[P in keyof T]?: T[P]}} data
|
|
824
|
+
* @param {MethodOption} [option]
|
|
825
|
+
* @memberof SqlServer
|
|
825
826
|
*/
|
|
826
827
|
insert(option: MethodOption & {
|
|
827
828
|
data: Partial<T>;
|
|
@@ -877,22 +878,22 @@ export declare class SqlService<T extends object> {
|
|
|
877
878
|
}): bigint[];
|
|
878
879
|
private _update;
|
|
879
880
|
/**
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
881
|
+
## 根据主键修改
|
|
882
|
+
0. `sync`: 同步(sqlite)或者异步(mysql、remote),影响返回值类型,默认`异步模式`
|
|
883
|
+
1. `data`:可是数组或者单对象
|
|
884
|
+
2. `skipUndefined`: boolean; 是否不处理值为undefined的字段,默认 true
|
|
885
|
+
3. `skipNull`: boolean; 是否不处理值为null的字段,默认 true
|
|
886
|
+
4. `skipEmptyString`: boolean; 是否不处理值为空字符串(`注意:多个空格也算空字符串`)的字段,默认 true
|
|
887
|
+
5. `maxDeal`: number; 批量处理时,每次处理多少个?默认500
|
|
888
|
+
6. `tableName`: 默认使用service注解的`tableName`,可以在某个方法中覆盖
|
|
889
|
+
7. `dbName`: 默认使用service注解的`dbName`,可以在某个方法中覆盖
|
|
890
|
+
8. `conn`: 仅在开启事务时需要主动传入,传入示例:
|
|
891
|
+
```
|
|
892
|
+
service.transaction(async conn => {
|
|
893
|
+
service.insert({conn});
|
|
894
|
+
});
|
|
895
|
+
```
|
|
896
|
+
9. `dao`: 永远不需要传入该值
|
|
896
897
|
*/
|
|
897
898
|
update(option: MethodOption & {
|
|
898
899
|
data: Partial<T> | Array<Partial<T>>;
|
|
@@ -911,23 +912,23 @@ export declare class SqlService<T extends object> {
|
|
|
911
912
|
maxDeal?: number;
|
|
912
913
|
}): number;
|
|
913
914
|
/**
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
915
|
+
## 删除
|
|
916
|
+
0. `sync`: 同步(sqlite)或者异步(mysql、remote),影响返回值类型,默认`异步模式`
|
|
917
|
+
1. 支持按ID删除:可以单个ID或者ID数组 `需要实体类只有一个ID`
|
|
918
|
+
2. 支持实体类删除: 用于多个ID或者按实体类某些字段删除
|
|
919
|
+
3. 两种模式:`mode`=`Common` 或者 `TempTable`
|
|
920
|
+
3. 如果数据多,使用 `TempTable`模式
|
|
921
|
+
4. 当设置实体类的字段有 `logicDelete` ,将进行逻辑删除,除非设置 forceDelete = true
|
|
922
|
+
6. `tableName`: 默认使用service注解的`tableName`,可以在某个方法中覆盖
|
|
923
|
+
7. `dbName`: 默认使用service注解的`dbName`,可以在某个方法中覆盖
|
|
924
|
+
8. `conn`: 仅在开启事务时需要主动传入,传入示例:
|
|
925
|
+
```
|
|
926
|
+
service.transaction(async conn => {
|
|
927
|
+
service.insert({conn});
|
|
928
|
+
});
|
|
929
|
+
```
|
|
930
|
+
9. `dao`: 永远不需要传入该值
|
|
931
|
+
*/
|
|
931
932
|
delete(option: MethodOption & {
|
|
932
933
|
sync?: SyncMode.Async;
|
|
933
934
|
id?: string | number | Array<string | number>;
|
|
@@ -944,26 +945,26 @@ export declare class SqlService<T extends object> {
|
|
|
944
945
|
}): number;
|
|
945
946
|
private _template;
|
|
946
947
|
/**
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
948
|
+
#根据条件查询对象
|
|
949
|
+
## 特点:快速、简单,可快速根据某些字段是否等于来查询返回,可以查询记录和记录数
|
|
950
|
+
0. `sync`: 同步(sqlite)或者异步(mysql、remote),影响返回值类型,默认`异步模式`
|
|
951
|
+
1. `templateResult`: 返回值类型断言,4种
|
|
952
|
+
1. `AssertOne` 确定返回一个,如果不是一个,将报错,返回类型是T `默认`
|
|
953
|
+
2. `NotSureOne` 可能返回一个,返回类型是T|null
|
|
954
|
+
3. `Many` 返回多个
|
|
955
|
+
4. `Count` 返回记录数
|
|
956
|
+
2. 支持按ID查询:可以单个ID或者ID数组 `需要实体类只有一个ID`
|
|
957
|
+
3. 支持实体类查询: 用于多个ID或者按实体类某些字段查询
|
|
958
|
+
4. 两种查询方式:`mode`=`Common`(默认) 或者 `TempTable`
|
|
959
|
+
5. `tableName`: 默认使用service注解的`tableName`,可以在某个方法中覆盖
|
|
960
|
+
6. `dbName`: 默认使用service注解的`dbName`,可以在某个方法中覆盖
|
|
961
|
+
7. `conn`: 仅在开启事务时需要主动传入,传入示例:
|
|
962
|
+
```
|
|
963
|
+
service.transaction(async conn => {
|
|
964
|
+
service.insert({conn});
|
|
965
|
+
});
|
|
966
|
+
```
|
|
967
|
+
8. `dao`: 永远不需要传入该值
|
|
967
968
|
|
|
968
969
|
*/
|
|
969
970
|
template<L = T>(option: MethodOption & {
|
|
@@ -1088,31 +1089,31 @@ export declare class SqlService<T extends object> {
|
|
|
1088
1089
|
}): Promise<ArrayList<L>>;
|
|
1089
1090
|
private _select;
|
|
1090
1091
|
/**
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1092
|
+
# 自由查询
|
|
1093
|
+
0. `sync`: 同步(sqlite)或者异步(mysql、remote),影响返回值类型,默认`异步模式`
|
|
1094
|
+
1. `templateResult`: 返回值类型断言,6种, R表示行,C表示列,带S表示复数
|
|
1095
|
+
1. R_C_Assert,
|
|
1096
|
+
2. R_C_NotSure,
|
|
1097
|
+
3. R_CS_Assert,
|
|
1098
|
+
4. R_CS_NotSure,
|
|
1099
|
+
5. RS_C,
|
|
1100
|
+
6. RS_C_List
|
|
1101
|
+
7. RS_CS[默认]
|
|
1102
|
+
8. RS_CS_List
|
|
1103
|
+
2. `sql` 或者 `sqlid`
|
|
1104
|
+
3. `params`
|
|
1105
|
+
4. `defValue`: One_Row_One_Column 时有效
|
|
1106
|
+
5. 禁止一次查询多个语句
|
|
1107
|
+
6. `dbName`: 默认使用service注解的`dbName`,可以在某个方法中覆盖
|
|
1108
|
+
7. `conn`: 仅在开启事务时需要主动传入,传入示例:
|
|
1109
|
+
```
|
|
1110
|
+
service.transaction(async conn => {
|
|
1111
|
+
service.insert({conn});
|
|
1112
|
+
});
|
|
1113
|
+
```
|
|
1114
|
+
9. `dao`: 永远不需要传入该值
|
|
1115
|
+
10. `hump`: 是否将列名改为驼峰写法?默认情况下按照全局配置
|
|
1116
|
+
11. `mapper`: 列名-属性 映射工具,优先级高于hump
|
|
1116
1117
|
```
|
|
1117
1118
|
// 该属性支持传入mybatis.xml中定义的resultMap块ID,或者读取sqlMapDir目录下的JSON文件.
|
|
1118
1119
|
// 注意:resultMap块ID与sql语句逻辑一致,同样是 目录.ID
|
|
@@ -1154,7 +1155,6 @@ export declare class SqlService<T extends object> {
|
|
|
1154
1155
|
hump?: boolean;
|
|
1155
1156
|
mapper?: string | SqlMapper;
|
|
1156
1157
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1157
|
-
buildInConvert?: Record<keyof L, string>;
|
|
1158
1158
|
dataConvert?: Record<string, string>;
|
|
1159
1159
|
}): Promise<L[]>;
|
|
1160
1160
|
select<L = T>(option: MethodOption & {
|
|
@@ -1170,7 +1170,6 @@ export declare class SqlService<T extends object> {
|
|
|
1170
1170
|
hump?: boolean;
|
|
1171
1171
|
mapper?: string | SqlMapper;
|
|
1172
1172
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1173
|
-
buildInConvert?: Record<keyof L, string>;
|
|
1174
1173
|
dataConvert?: Record<string, string>;
|
|
1175
1174
|
}): Promise<ArrayList<L>>;
|
|
1176
1175
|
select<L = T>(option: MethodOption & {
|
|
@@ -1186,7 +1185,6 @@ export declare class SqlService<T extends object> {
|
|
|
1186
1185
|
hump?: boolean;
|
|
1187
1186
|
mapper?: string | SqlMapper;
|
|
1188
1187
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1189
|
-
buildInConvert?: Record<keyof L, string>;
|
|
1190
1188
|
dataConvert?: Record<string, string>;
|
|
1191
1189
|
}): Promise<L>;
|
|
1192
1190
|
select<L = T>(option: MethodOption & {
|
|
@@ -1202,7 +1200,6 @@ export declare class SqlService<T extends object> {
|
|
|
1202
1200
|
hump?: boolean;
|
|
1203
1201
|
mapper?: string | SqlMapper;
|
|
1204
1202
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1205
|
-
buildInConvert?: Record<keyof L, string>;
|
|
1206
1203
|
dataConvert?: Record<string, string>;
|
|
1207
1204
|
}): Promise<L | null>;
|
|
1208
1205
|
select<L = T>(option: MethodOption & {
|
|
@@ -1218,7 +1215,6 @@ export declare class SqlService<T extends object> {
|
|
|
1218
1215
|
hump?: boolean;
|
|
1219
1216
|
mapper?: string | SqlMapper;
|
|
1220
1217
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1221
|
-
buildInConvert?: Record<keyof L, string>;
|
|
1222
1218
|
dataConvert?: Record<string, string>;
|
|
1223
1219
|
}): L[];
|
|
1224
1220
|
select<L = T>(option: MethodOption & {
|
|
@@ -1234,7 +1230,6 @@ export declare class SqlService<T extends object> {
|
|
|
1234
1230
|
hump?: boolean;
|
|
1235
1231
|
mapper?: string | SqlMapper;
|
|
1236
1232
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1237
|
-
buildInConvert?: Record<keyof L, string>;
|
|
1238
1233
|
dataConvert?: Record<string, string>;
|
|
1239
1234
|
}): ArrayList<L>;
|
|
1240
1235
|
select<L = T>(option: MethodOption & {
|
|
@@ -1250,7 +1245,6 @@ export declare class SqlService<T extends object> {
|
|
|
1250
1245
|
hump?: boolean;
|
|
1251
1246
|
mapper?: string | SqlMapper;
|
|
1252
1247
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1253
|
-
buildInConvert?: Record<keyof L, string>;
|
|
1254
1248
|
dataConvert?: Record<string, string>;
|
|
1255
1249
|
}): L;
|
|
1256
1250
|
select<L = T>(option: MethodOption & {
|
|
@@ -1266,7 +1260,6 @@ export declare class SqlService<T extends object> {
|
|
|
1266
1260
|
hump?: boolean;
|
|
1267
1261
|
mapper?: string | SqlMapper;
|
|
1268
1262
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1269
|
-
buildInConvert?: Record<keyof L, string>;
|
|
1270
1263
|
dataConvert?: Record<string, string>;
|
|
1271
1264
|
}): L | null;
|
|
1272
1265
|
/**
|
|
@@ -1276,14 +1269,14 @@ export declare class SqlService<T extends object> {
|
|
|
1276
1269
|
2. `params`
|
|
1277
1270
|
3. `dbName`: 默认使用service注解的`dbName`,可以在某个方法中覆盖
|
|
1278
1271
|
4. `conn`: 仅在开启事务时需要主动传入,传入示例:
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1272
|
+
```
|
|
1273
|
+
service.transaction(async conn => {
|
|
1274
|
+
service.insert({conn});
|
|
1275
|
+
});
|
|
1276
|
+
```
|
|
1284
1277
|
5. `dao`: 永远不需要传入该值
|
|
1285
|
-
|
|
1286
|
-
|
|
1278
|
+
|
|
1279
|
+
*/
|
|
1287
1280
|
excute<L = T>(option: MethodOption & {
|
|
1288
1281
|
sync?: SyncMode.Async;
|
|
1289
1282
|
sqlId?: string;
|
|
@@ -1399,16 +1392,16 @@ export declare class SqlService<T extends object> {
|
|
|
1399
1392
|
sync: SyncMode.Sync;
|
|
1400
1393
|
}): void;
|
|
1401
1394
|
/**
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1395
|
+
#创建表
|
|
1396
|
+
** `tableName` 表名称
|
|
1397
|
+
** `temp` 是否是临时表,默认true
|
|
1398
|
+
** `columns` 字符串数组,默认是当前实体类全部字段,通过`columns` 可以创建部分字段临时表
|
|
1399
|
+
** `id` 表的主键设置 4种:
|
|
1400
|
+
1. `auto`: `columns`中已经在当前实体类配置的ID作为主键 `默认`
|
|
1401
|
+
2. `all`: `columns`中所有字段全部当主键
|
|
1402
|
+
3. `none`: 没有主键
|
|
1403
|
+
4. 自定义字段名称:字符串数组
|
|
1404
|
+
** `index` 表的索引,设置方式同ID
|
|
1412
1405
|
*/
|
|
1413
1406
|
private _createTable;
|
|
1414
1407
|
private _matchSqlid;
|
|
@@ -1416,7 +1409,7 @@ export declare class SqlService<T extends object> {
|
|
|
1416
1409
|
private _generSql;
|
|
1417
1410
|
}
|
|
1418
1411
|
declare class StreamQuery<T extends object> {
|
|
1419
|
-
private
|
|
1412
|
+
private _prefix;
|
|
1420
1413
|
private _index;
|
|
1421
1414
|
private _wheres;
|
|
1422
1415
|
private _andQuerys;
|
|
@@ -1433,7 +1426,7 @@ declare class StreamQuery<T extends object> {
|
|
|
1433
1426
|
private _orders;
|
|
1434
1427
|
private _startRow;
|
|
1435
1428
|
private _pageSize;
|
|
1436
|
-
private
|
|
1429
|
+
private _service;
|
|
1437
1430
|
private [_fields];
|
|
1438
1431
|
private [_columns];
|
|
1439
1432
|
constructor(service: SqlService<T>, __fields: Record<string, AField>, __columns: string[]);
|
|
@@ -1444,8 +1437,6 @@ declare class StreamQuery<T extends object> {
|
|
|
1444
1437
|
/**
|
|
1445
1438
|
* AND(key1 = :value OR key2 = :value)
|
|
1446
1439
|
* @param keys [key1, key2, ...]
|
|
1447
|
-
* @param keys
|
|
1448
|
-
* @param value
|
|
1449
1440
|
*/
|
|
1450
1441
|
eqs(keys: (keyof T)[], value: string | number, { paramName, skipEmptyString, breakExcuteIfSkip }?: {
|
|
1451
1442
|
paramName?: string | undefined;
|
|
@@ -1772,6 +1763,7 @@ declare class StreamQuery<T extends object> {
|
|
|
1772
1763
|
hump?: boolean;
|
|
1773
1764
|
mapper?: string | SqlMapper;
|
|
1774
1765
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1766
|
+
dataConvert?: Record<string, string>;
|
|
1775
1767
|
}): Promise<L[]>;
|
|
1776
1768
|
excuteSelect<L = T>(option?: MethodOption & {
|
|
1777
1769
|
sync?: SyncMode.Async;
|
|
@@ -1779,6 +1771,7 @@ declare class StreamQuery<T extends object> {
|
|
|
1779
1771
|
hump?: boolean;
|
|
1780
1772
|
mapper?: string | SqlMapper;
|
|
1781
1773
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1774
|
+
dataConvert?: Record<string, string>;
|
|
1782
1775
|
}): Promise<ArrayList<L>>;
|
|
1783
1776
|
excuteSelect<L = T>(option: MethodOption & {
|
|
1784
1777
|
sync?: SyncMode.Async;
|
|
@@ -1787,6 +1780,7 @@ declare class StreamQuery<T extends object> {
|
|
|
1787
1780
|
hump?: boolean;
|
|
1788
1781
|
mapper?: string | SqlMapper;
|
|
1789
1782
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1783
|
+
dataConvert?: Record<string, string>;
|
|
1790
1784
|
}): Promise<L>;
|
|
1791
1785
|
excuteSelect<L = T>(option: MethodOption & {
|
|
1792
1786
|
sync?: SyncMode.Async;
|
|
@@ -1794,6 +1788,7 @@ declare class StreamQuery<T extends object> {
|
|
|
1794
1788
|
hump?: boolean;
|
|
1795
1789
|
mapper?: string | SqlMapper;
|
|
1796
1790
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1791
|
+
dataConvert?: Record<string, string>;
|
|
1797
1792
|
}): Promise<L | null>;
|
|
1798
1793
|
excuteSelect<L = T>(option: MethodOption & {
|
|
1799
1794
|
sync: SyncMode.Sync;
|
|
@@ -1801,6 +1796,7 @@ declare class StreamQuery<T extends object> {
|
|
|
1801
1796
|
hump?: boolean;
|
|
1802
1797
|
mapper?: string | SqlMapper;
|
|
1803
1798
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1799
|
+
dataConvert?: Record<string, string>;
|
|
1804
1800
|
}): L[];
|
|
1805
1801
|
excuteSelect<L = T>(option: MethodOption & {
|
|
1806
1802
|
sync: SyncMode.Sync;
|
|
@@ -1808,6 +1804,7 @@ declare class StreamQuery<T extends object> {
|
|
|
1808
1804
|
hump?: boolean;
|
|
1809
1805
|
mapper?: string | SqlMapper;
|
|
1810
1806
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1807
|
+
dataConvert?: Record<string, string>;
|
|
1811
1808
|
}): ArrayList<L>;
|
|
1812
1809
|
excuteSelect<L = T>(option: MethodOption & {
|
|
1813
1810
|
sync: SyncMode.Sync;
|
|
@@ -1816,6 +1813,7 @@ declare class StreamQuery<T extends object> {
|
|
|
1816
1813
|
hump?: boolean;
|
|
1817
1814
|
mapper?: string | SqlMapper;
|
|
1818
1815
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1816
|
+
dataConvert?: Record<string, string>;
|
|
1819
1817
|
}): L;
|
|
1820
1818
|
excuteSelect<L = T>(option: MethodOption & {
|
|
1821
1819
|
sync: SyncMode.Sync;
|
|
@@ -1823,6 +1821,7 @@ declare class StreamQuery<T extends object> {
|
|
|
1823
1821
|
hump?: boolean;
|
|
1824
1822
|
mapper?: string | SqlMapper;
|
|
1825
1823
|
mapperIfUndefined?: MapperIfUndefined;
|
|
1824
|
+
dataConvert?: Record<string, string>;
|
|
1826
1825
|
}): L | null;
|
|
1827
1826
|
excutePage<L = T>(option?: MethodOption & {
|
|
1828
1827
|
sync?: SyncMode;
|