baja-lite 1.5.18 → 1.5.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.
package/sql.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { ExtensionCodec } from "@msgpack/msgpack";
2
2
  import { _columns, _columnsNoId, _def, _deleteState, _fields, _ids, _index, _logicIds, _stateFileName, AField, DBType, EnumMap, FieldOption } from 'baja-lite-field';
3
3
  import { XML } from './convert-xml.js';
4
- import { ArrayList } from './list.js';
5
4
  export declare const extensionCodec: ExtensionCodec<undefined>;
6
5
  declare const _daoDBName: unique symbol;
7
6
  declare const _tableName: unique symbol;
@@ -94,10 +93,8 @@ export declare enum TemplateResult {
94
93
  NotSureOne = 1,
95
94
  /** 返回多条记录 */
96
95
  Many = 2,
97
- /** 返回多条记录并封装ArrayList */
98
- ManyList = 3,
99
96
  /** 仅查询记录数量 */
100
- Count = 4
97
+ Count = 3
101
98
  }
102
99
  export declare enum SelectResult {
103
100
  /** 一行一列 确定非空 */
@@ -110,12 +107,8 @@ export declare enum SelectResult {
110
107
  R_CS_NotSure = 3,
111
108
  /** 多行一列 */
112
109
  RS_C = 4,
113
- /** 多行一列并封装ArrayList */
114
- RS_C_List = 5,
115
110
  /** 多行多列 */
116
- RS_CS = 6,
117
- /** 多行多列并封装ArrayList */
118
- RS_CS_List = 7
111
+ RS_CS = 5
119
112
  }
120
113
  export declare enum ColumnMode {
121
114
  NONE = 0,
@@ -1068,30 +1061,6 @@ export declare class SqlService<T extends object> {
1068
1061
  error?: string;
1069
1062
  columns?: (keyof L)[];
1070
1063
  }): Promise<L[]>;
1071
- template<L = T>(option: MethodOption & {
1072
- sync: SyncMode.Sync;
1073
- templateResult: TemplateResult.ManyList;
1074
- id?: string | number | Array<string | number>;
1075
- where?: Partial<L> | Array<Partial<L>>;
1076
- skipUndefined?: boolean;
1077
- skipNull?: boolean;
1078
- skipEmptyString?: boolean;
1079
- mode?: SelectMode;
1080
- error?: string;
1081
- columns?: (keyof L)[];
1082
- }): ArrayList<L>;
1083
- template<L = T>(option: MethodOption & {
1084
- sync?: SyncMode.Async;
1085
- templateResult: TemplateResult.ManyList;
1086
- id?: string | number | Array<string | number>;
1087
- where?: Partial<L> | Array<Partial<L>>;
1088
- skipUndefined?: boolean;
1089
- skipNull?: boolean;
1090
- skipEmptyString?: boolean;
1091
- mode?: SelectMode;
1092
- error?: string;
1093
- columns?: (keyof L)[];
1094
- }): Promise<ArrayList<L>>;
1095
1064
  private _select;
1096
1065
  /**
1097
1066
  # 自由查询
@@ -1102,9 +1071,7 @@ export declare class SqlService<T extends object> {
1102
1071
  3. R_CS_Assert,
1103
1072
  4. R_CS_NotSure,
1104
1073
  5. RS_C,
1105
- 6. RS_C_List
1106
1074
  7. RS_CS[默认]
1107
- 8. RS_CS_List
1108
1075
  2. `sql` 或者 `sqlid`
1109
1076
  3. `params`
1110
1077
  4. `defValue`: One_Row_One_Column 时有效
@@ -1151,21 +1118,6 @@ export declare class SqlService<T extends object> {
1151
1118
  mapperIfUndefined?: MapperIfUndefined;
1152
1119
  dataConvert?: Record<string, string>;
1153
1120
  }): Promise<L[]>;
1154
- select<L = T>(option: MethodOption & {
1155
- sync?: SyncMode.Async;
1156
- selectResult: SelectResult.RS_CS_List | SelectResult.RS_C_List;
1157
- sqlId?: string;
1158
- sql?: string;
1159
- params?: Record<string, any>;
1160
- context?: any;
1161
- isCount?: boolean;
1162
- defValue?: L | null;
1163
- errorMsg?: string;
1164
- hump?: boolean;
1165
- mapper?: string | SqlMapper;
1166
- mapperIfUndefined?: MapperIfUndefined;
1167
- dataConvert?: Record<string, string>;
1168
- }): Promise<ArrayList<L>>;
1169
1121
  select<L = T>(option: MethodOption & {
1170
1122
  sync?: SyncMode.Async;
1171
1123
  selectResult: SelectResult.R_CS_Assert | SelectResult.R_C_Assert;
@@ -1211,21 +1163,6 @@ export declare class SqlService<T extends object> {
1211
1163
  mapperIfUndefined?: MapperIfUndefined;
1212
1164
  dataConvert?: Record<string, string>;
1213
1165
  }): L[];
1214
- select<L = T>(option: MethodOption & {
1215
- sync: SyncMode.Sync;
1216
- selectResult: SelectResult.RS_CS_List | SelectResult.RS_C_List;
1217
- sqlId?: string;
1218
- sql?: string;
1219
- params?: Record<string, any>;
1220
- context?: any;
1221
- isCount?: boolean;
1222
- defValue?: L | null;
1223
- errorMsg?: string;
1224
- hump?: boolean;
1225
- mapper?: string | SqlMapper;
1226
- mapperIfUndefined?: MapperIfUndefined;
1227
- dataConvert?: Record<string, string>;
1228
- }): ArrayList<L>;
1229
1166
  select<L = T>(option: MethodOption & {
1230
1167
  sync: SyncMode.Sync;
1231
1168
  selectResult: SelectResult.R_CS_Assert | SelectResult.R_C_Assert;
@@ -1291,8 +1228,9 @@ export declare class SqlService<T extends object> {
1291
1228
  // qiniu 在开始时定义
1292
1229
  ```
1293
1230
  */
1294
- selectMuit<T extends any[] = []>(option: MethodOption & {
1231
+ selectBatch<T extends any[] = []>(option: MethodOption & {
1295
1232
  sync?: SyncMode.Async;
1233
+ selectResult?: SelectResult.RS_CS | SelectResult.RS_C;
1296
1234
  sqlId?: string;
1297
1235
  sql?: string;
1298
1236
  params?: Record<string, any>;
@@ -1304,8 +1242,37 @@ export declare class SqlService<T extends object> {
1304
1242
  }): Promise<{
1305
1243
  [K in keyof T]: T[K][];
1306
1244
  }>;
1307
- selectMuit<T extends any[] = []>(option: MethodOption & {
1245
+ selectBatch<T extends any[] = []>(option: MethodOption & {
1246
+ sync?: SyncMode.Async;
1247
+ selectResult: SelectResult.R_CS_Assert | SelectResult.R_C_Assert;
1248
+ sqlId?: string;
1249
+ sql?: string;
1250
+ params?: Record<string, any>;
1251
+ context?: any;
1252
+ hump?: boolean;
1253
+ mapper?: string | SqlMapper;
1254
+ mapperIfUndefined?: MapperIfUndefined;
1255
+ dataConvert?: Record<string, string>;
1256
+ }): Promise<{
1257
+ [K in keyof T]: T[K];
1258
+ }>;
1259
+ selectBatch<T extends any[] = []>(option: MethodOption & {
1260
+ sync?: SyncMode.Async;
1261
+ selectResult: SelectResult.R_CS_NotSure | SelectResult.R_C_NotSure;
1262
+ sqlId?: string;
1263
+ sql?: string;
1264
+ params?: Record<string, any>;
1265
+ context?: any;
1266
+ hump?: boolean;
1267
+ mapper?: string | SqlMapper;
1268
+ mapperIfUndefined?: MapperIfUndefined;
1269
+ dataConvert?: Record<string, string>;
1270
+ }): Promise<{
1271
+ [K in keyof T]: T[K] | null;
1272
+ }>;
1273
+ selectBatch<T extends any[] = []>(option: MethodOption & {
1308
1274
  sync: SyncMode.Sync;
1275
+ selectResult?: SelectResult.RS_CS | SelectResult.RS_C;
1309
1276
  sqlId?: string;
1310
1277
  sql?: string;
1311
1278
  params?: Record<string, any>;
@@ -1317,6 +1284,34 @@ export declare class SqlService<T extends object> {
1317
1284
  }): {
1318
1285
  [K in keyof T]: T[K][];
1319
1286
  };
1287
+ selectBatch<T extends any[] = []>(option: MethodOption & {
1288
+ sync: SyncMode.Sync;
1289
+ selectResult: SelectResult.R_CS_Assert | SelectResult.R_C_Assert;
1290
+ sqlId?: string;
1291
+ sql?: string;
1292
+ params?: Record<string, any>;
1293
+ context?: any;
1294
+ hump?: boolean;
1295
+ mapper?: string | SqlMapper;
1296
+ mapperIfUndefined?: MapperIfUndefined;
1297
+ dataConvert?: Record<string, string>;
1298
+ }): {
1299
+ [K in keyof T]: T[K];
1300
+ };
1301
+ selectBatch<T extends any[] = []>(option: MethodOption & {
1302
+ sync: SyncMode.Sync;
1303
+ selectResult: SelectResult.R_CS_NotSure | SelectResult.R_C_NotSure;
1304
+ sqlId?: string;
1305
+ sql?: string;
1306
+ params?: Record<string, any>;
1307
+ context?: any;
1308
+ hump?: boolean;
1309
+ mapper?: string | SqlMapper;
1310
+ mapperIfUndefined?: MapperIfUndefined;
1311
+ dataConvert?: Record<string, string>;
1312
+ }): {
1313
+ [K in keyof T]: T[K] | null;
1314
+ };
1320
1315
  /**
1321
1316
  # 自由执行sql
1322
1317
  0. `sync`: 同步(sqlite)或者异步(mysql、remote),影响返回值类型,默认`异步模式`
@@ -1521,26 +1516,6 @@ declare class StreamQuery<T extends object> {
1521
1516
  eqWith(key1: keyof T, key2: keyof T): this;
1522
1517
  /** AND key1 <> key2 */
1523
1518
  notEqWith(key1: keyof T, key2: keyof T): this;
1524
- /** AND key REGEXP :regexp */
1525
- regexp(key: keyof T, regexp: string, { paramName, breakExcuteIfEmpty }?: {
1526
- paramName?: string | undefined;
1527
- breakExcuteIfEmpty?: boolean | undefined;
1528
- }): this;
1529
- /** AND key NOT REGEXP :regexp */
1530
- notRegexp(key: keyof T, regexp: string, { paramName, breakExcuteIfEmpty }?: {
1531
- paramName?: string | undefined;
1532
- breakExcuteIfEmpty?: boolean | undefined;
1533
- }): this;
1534
- /** AND (key1 << 8) + key2 = value */
1535
- shiftEq(key1: keyof T, key2: keyof T, value: number, { paramName, breakExcuteIfEmpty }?: {
1536
- paramName?: string | undefined;
1537
- breakExcuteIfEmpty?: boolean | undefined;
1538
- }): this;
1539
- /** AND (key1 << 8) + key2 <> value */
1540
- shiftNotEq(key1: keyof T, key2: keyof T, value: number, { paramName, breakExcuteIfEmpty }?: {
1541
- paramName?: string | undefined;
1542
- breakExcuteIfEmpty?: boolean | undefined;
1543
- }): this;
1544
1519
  /** AND key > :value */
1545
1520
  grate(key: keyof T, value: string | number, { paramName, breakExcuteIfEmpty }?: {
1546
1521
  paramName?: string | undefined;
@@ -1569,6 +1544,36 @@ declare class StreamQuery<T extends object> {
1569
1544
  lessWith(key1: keyof T, key2: keyof T): this;
1570
1545
  /** AND key1 <= key2 */
1571
1546
  lessEqWith(key1: keyof T, key2: keyof T): this;
1547
+ /** AND key REGEXP :regexp */
1548
+ regexp(key: keyof T, regexp: string, { paramName, breakExcuteIfEmpty }?: {
1549
+ paramName?: string | undefined;
1550
+ breakExcuteIfEmpty?: boolean | undefined;
1551
+ }): this;
1552
+ /** AND key NOT REGEXP :regexp */
1553
+ notRegexp(key: keyof T, regexp: string, { paramName, breakExcuteIfEmpty }?: {
1554
+ paramName?: string | undefined;
1555
+ breakExcuteIfEmpty?: boolean | undefined;
1556
+ }): this;
1557
+ /** AND :regexp REGEXP key */
1558
+ regexp2(key: keyof T, regexp: string, { paramName, breakExcuteIfEmpty }?: {
1559
+ paramName?: string | undefined;
1560
+ breakExcuteIfEmpty?: boolean | undefined;
1561
+ }): this;
1562
+ /** AND :regexp NOT REGEXP key */
1563
+ notRegexp2(key: keyof T, regexp: string, { paramName, breakExcuteIfEmpty }?: {
1564
+ paramName?: string | undefined;
1565
+ breakExcuteIfEmpty?: boolean | undefined;
1566
+ }): this;
1567
+ /** AND (key1 << 8) + key2 = value */
1568
+ shiftEq(key1: keyof T, key2: keyof T, value: number, { paramName, breakExcuteIfEmpty }?: {
1569
+ paramName?: string | undefined;
1570
+ breakExcuteIfEmpty?: boolean | undefined;
1571
+ }): this;
1572
+ /** AND (key1 << 8) + key2 <> value */
1573
+ shiftNotEq(key1: keyof T, key2: keyof T, value: number, { paramName, breakExcuteIfEmpty }?: {
1574
+ paramName?: string | undefined;
1575
+ breakExcuteIfEmpty?: boolean | undefined;
1576
+ }): this;
1572
1577
  /** AND key LIKE CONCAT('%', :value, '%') */
1573
1578
  like(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1574
1579
  paramName?: string | undefined;
@@ -1605,72 +1610,168 @@ declare class StreamQuery<T extends object> {
1605
1610
  skipEmptyString?: boolean | undefined;
1606
1611
  breakExcuteIfEmpty?: boolean | undefined;
1607
1612
  }): this;
1608
- /** AND key NOT LIKE :value */
1613
+ /** AND key LIKE :value 注意:不会拼接% */
1609
1614
  PreciseLike(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1610
1615
  paramName?: string | undefined;
1611
1616
  skipEmptyString?: boolean | undefined;
1612
1617
  breakExcuteIfEmpty?: boolean | undefined;
1613
1618
  }): this;
1614
- /** AND key LIKE :value */
1619
+ /** AND key NOT LIKE :value 注意:不会拼接%*/
1615
1620
  notPreciseLike(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1616
1621
  paramName?: string | undefined;
1617
1622
  skipEmptyString?: boolean | undefined;
1618
1623
  breakExcuteIfEmpty?: boolean | undefined;
1619
1624
  }): this;
1620
- /** AND key GLOB CONCAT('%', :value, '%') */
1625
+ /** AND key GLOB CONCAT('%', :value, '%') 注意:GLOB是大小写敏感like */
1621
1626
  glob(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1622
1627
  paramName?: string | undefined;
1623
1628
  skipEmptyString?: boolean | undefined;
1624
1629
  breakExcuteIfEmpty?: boolean | undefined;
1625
1630
  }): this;
1626
- /** AND key NOT GLOB CONCAT('%', :value, '%') */
1631
+ /** AND key NOT GLOB CONCAT('%', :value, '%') 注意:GLOB是大小写敏感like*/
1627
1632
  notGlob(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1628
1633
  paramName?: string | undefined;
1629
1634
  skipEmptyString?: boolean | undefined;
1630
1635
  breakExcuteIfEmpty?: boolean | undefined;
1631
1636
  }): this;
1632
- /** AND key GLOB CONCAT('%', :value) */
1637
+ /** AND key GLOB CONCAT('%', :value) 注意:GLOB是大小写敏感like*/
1633
1638
  leftGlob(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1634
1639
  paramName?: string | undefined;
1635
1640
  skipEmptyString?: boolean | undefined;
1636
1641
  breakExcuteIfEmpty?: boolean | undefined;
1637
1642
  }): this;
1638
- /** AND key NOT GLOB CONCAT('%', :value) */
1643
+ /** AND key NOT GLOB CONCAT('%', :value) 注意:GLOB是大小写敏感like*/
1639
1644
  notLeftGlob(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1640
1645
  paramName?: string | undefined;
1641
1646
  skipEmptyString?: boolean | undefined;
1642
1647
  breakExcuteIfEmpty?: boolean | undefined;
1643
1648
  }): this;
1644
- /** AND key GLOB CONCAT(:value, '%') */
1649
+ /** AND key GLOB CONCAT(:value, '%') 注意:GLOB是大小写敏感like*/
1645
1650
  rightGlob(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1646
1651
  paramName?: string | undefined;
1647
1652
  skipEmptyString?: boolean | undefined;
1648
1653
  breakExcuteIfEmpty?: boolean | undefined;
1649
1654
  }): this;
1650
- /** AND key NOT GLOB CONCAT(:value, '%') */
1655
+ /** AND key NOT GLOB CONCAT(:value, '%') 注意:GLOB是大小写敏感like*/
1651
1656
  notRightGlob(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1652
1657
  paramName?: string | undefined;
1653
1658
  skipEmptyString?: boolean | undefined;
1654
1659
  breakExcuteIfEmpty?: boolean | undefined;
1655
1660
  }): this;
1656
- /** AND key GLOB :value */
1657
- PreciseGlob(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1661
+ /** AND key GLOB :value 注意:GLOB是大小写敏感like,这里不拼接%*/
1662
+ preciseGlob(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1658
1663
  paramName?: string | undefined;
1659
1664
  skipEmptyString?: boolean | undefined;
1660
1665
  breakExcuteIfEmpty?: boolean | undefined;
1661
1666
  }): this;
1662
- /** AND key NOT GLOB :value */
1667
+ /** AND key NOT GLOB :value 注意:GLOB是大小写敏感like,这里不拼接%*/
1663
1668
  notPreciseGlob(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1664
1669
  paramName?: string | undefined;
1665
1670
  skipEmptyString?: boolean | undefined;
1666
1671
  breakExcuteIfEmpty?: boolean | undefined;
1667
1672
  }): this;
1668
- /** AND key IN :value */
1673
+ /** AND :value LIKE CONCAT('%', key, '%') */
1674
+ like2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1675
+ paramName?: string | undefined;
1676
+ skipEmptyString?: boolean | undefined;
1677
+ breakExcuteIfEmpty?: boolean | undefined;
1678
+ }): this;
1679
+ /** AND :value NOT LIKE CONCAT('%', key, '%') */
1680
+ notLike2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1681
+ paramName?: string | undefined;
1682
+ skipEmptyString?: boolean | undefined;
1683
+ breakExcuteIfEmpty?: boolean | undefined;
1684
+ }): this;
1685
+ /** AND :value NOT LIKE CONCAT('%', key) */
1686
+ leftLike2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1687
+ paramName?: string | undefined;
1688
+ skipEmptyString?: boolean | undefined;
1689
+ breakExcuteIfEmpty?: boolean | undefined;
1690
+ }): this;
1691
+ /** AND :value LIKE CONCAT('%', key) */
1692
+ notLeftLike2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1693
+ paramName?: string | undefined;
1694
+ skipEmptyString?: boolean | undefined;
1695
+ breakExcuteIfEmpty?: boolean | undefined;
1696
+ }): this;
1697
+ /** AND :value LIKE CONCAT(key, '%') */
1698
+ rightLike2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1699
+ paramName?: string | undefined;
1700
+ skipEmptyString?: boolean | undefined;
1701
+ breakExcuteIfEmpty?: boolean | undefined;
1702
+ }): this;
1703
+ /** AND :value NOT LIKE CONCAT(key, '%') */
1704
+ notRightLike2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1705
+ paramName?: string | undefined;
1706
+ skipEmptyString?: boolean | undefined;
1707
+ breakExcuteIfEmpty?: boolean | undefined;
1708
+ }): this;
1709
+ /** AND :value LIKE key 注意:不会拼接% */
1710
+ PreciseLike2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1711
+ paramName?: string | undefined;
1712
+ skipEmptyString?: boolean | undefined;
1713
+ breakExcuteIfEmpty?: boolean | undefined;
1714
+ }): this;
1715
+ /** AND :value NOT LIKE key 注意:不会拼接%*/
1716
+ notPreciseLike2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1717
+ paramName?: string | undefined;
1718
+ skipEmptyString?: boolean | undefined;
1719
+ breakExcuteIfEmpty?: boolean | undefined;
1720
+ }): this;
1721
+ /** AND :value GLOB CONCAT('%', key, '%') 注意:GLOB是大小写敏感like */
1722
+ glob2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1723
+ paramName?: string | undefined;
1724
+ skipEmptyString?: boolean | undefined;
1725
+ breakExcuteIfEmpty?: boolean | undefined;
1726
+ }): this;
1727
+ /** AND :value NOT GLOB CONCAT('%', key, '%') 注意:GLOB是大小写敏感like*/
1728
+ notGlob2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1729
+ paramName?: string | undefined;
1730
+ skipEmptyString?: boolean | undefined;
1731
+ breakExcuteIfEmpty?: boolean | undefined;
1732
+ }): this;
1733
+ /** AND :value GLOB CONCAT('%', key) 注意:GLOB是大小写敏感like*/
1734
+ leftGlob2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1735
+ paramName?: string | undefined;
1736
+ skipEmptyString?: boolean | undefined;
1737
+ breakExcuteIfEmpty?: boolean | undefined;
1738
+ }): this;
1739
+ /** AND :value NOT GLOB CONCAT('%', key) 注意:GLOB是大小写敏感like*/
1740
+ notLeftGlob2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1741
+ paramName?: string | undefined;
1742
+ skipEmptyString?: boolean | undefined;
1743
+ breakExcuteIfEmpty?: boolean | undefined;
1744
+ }): this;
1745
+ /** AND :value GLOB CONCAT(key, '%') 注意:GLOB是大小写敏感like*/
1746
+ rightGlob2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1747
+ paramName?: string | undefined;
1748
+ skipEmptyString?: boolean | undefined;
1749
+ breakExcuteIfEmpty?: boolean | undefined;
1750
+ }): this;
1751
+ /** AND :value NOT GLOB CONCAT(key, '%') 注意:GLOB是大小写敏感like*/
1752
+ notRightGlob2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1753
+ paramName?: string | undefined;
1754
+ skipEmptyString?: boolean | undefined;
1755
+ breakExcuteIfEmpty?: boolean | undefined;
1756
+ }): this;
1757
+ /** AND :value GLOB key 注意:GLOB是大小写敏感like,这里不拼接%*/
1758
+ preciseGlob2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1759
+ paramName?: string | undefined;
1760
+ skipEmptyString?: boolean | undefined;
1761
+ breakExcuteIfEmpty?: boolean | undefined;
1762
+ }): this;
1763
+ /** AND :value NOT GLOB key 注意:GLOB是大小写敏感like,这里不拼接%*/
1764
+ notPreciseGlob2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1765
+ paramName?: string | undefined;
1766
+ skipEmptyString?: boolean | undefined;
1767
+ breakExcuteIfEmpty?: boolean | undefined;
1768
+ }): this;
1769
+ /** AND key IN (:value) */
1669
1770
  in(key: keyof T, value: Array<string | number>, { paramName, breakExcuteIfEmpty }?: {
1670
1771
  paramName?: string | undefined;
1671
1772
  breakExcuteIfEmpty?: boolean | undefined;
1672
1773
  }): this;
1673
- /** AND key NOT IN :value */
1774
+ /** AND key NOT IN (:value) */
1674
1775
  notIn(key: keyof T, value: Array<string | number>, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1675
1776
  paramName?: string | undefined;
1676
1777
  skipEmptyString?: boolean | undefined;
@@ -1717,6 +1818,16 @@ declare class StreamQuery<T extends object> {
1717
1818
  paramName?: string | undefined;
1718
1819
  breakExcuteIfEmpty?: boolean | undefined;
1719
1820
  }): this;
1821
+ /** AND POW(2, :value) & key */
1822
+ pow2(key: keyof T, value: number, { paramName, breakExcuteIfEmpty }?: {
1823
+ paramName?: string | undefined;
1824
+ breakExcuteIfEmpty?: boolean | undefined;
1825
+ }): this;
1826
+ /** AND NOT POW(2, :value) & key */
1827
+ notPow2(key: keyof T, value: number, { paramName, breakExcuteIfEmpty }?: {
1828
+ paramName?: string | undefined;
1829
+ breakExcuteIfEmpty?: boolean | undefined;
1830
+ }): this;
1720
1831
  /** AND POW(2, key1) & key2 */
1721
1832
  powWith(key: keyof T, values: Array<number | string>, { paramName, breakExcuteIfEmpty }?: {
1722
1833
  paramName?: string | undefined;
@@ -1727,43 +1838,43 @@ declare class StreamQuery<T extends object> {
1727
1838
  paramName?: string | undefined;
1728
1839
  breakExcuteIfEmpty?: boolean | undefined;
1729
1840
  }): this;
1730
- /** AND MATCH(key1, key2, key3) AGAINST (:value) */
1841
+ /** AND MATCH(key1, key2, key3...) AGAINST (:value) */
1731
1842
  match(value: string, keys: (keyof T)[], { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1732
1843
  paramName?: string | undefined;
1733
1844
  skipEmptyString?: boolean | undefined;
1734
1845
  breakExcuteIfEmpty?: boolean | undefined;
1735
1846
  }): this;
1736
- /** AND NOT MATCH(key1, key2, key3) AGAINST (:value) */
1847
+ /** AND NOT MATCH(key1, key2, key3...) AGAINST (:value) */
1737
1848
  notMatch(value: string, keys: (keyof T)[], { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1738
1849
  paramName?: string | undefined;
1739
1850
  skipEmptyString?: boolean | undefined;
1740
1851
  breakExcuteIfEmpty?: boolean | undefined;
1741
1852
  }): this;
1742
- /** AND MATCH(key1, key2, key3) AGAINST (:value) IN BOOLEAN MODE*/
1853
+ /** AND MATCH(key1, key2, key3...) AGAINST (:value) IN BOOLEAN MODE*/
1743
1854
  matchBoolean(value: string, keys: (keyof T)[], { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1744
1855
  paramName?: string | undefined;
1745
1856
  skipEmptyString?: boolean | undefined;
1746
1857
  breakExcuteIfEmpty?: boolean | undefined;
1747
1858
  }): this;
1748
- /** AND NOT MATCH(key1, key2, key3) AGAINST (:value) IN BOOLEAN MODE */
1859
+ /** AND NOT MATCH(key1, key2, key3...) AGAINST (:value) IN BOOLEAN MODE */
1749
1860
  notMatchBoolean(value: string, keys: (keyof T)[], { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1750
1861
  paramName?: string | undefined;
1751
1862
  skipEmptyString?: boolean | undefined;
1752
1863
  breakExcuteIfEmpty?: boolean | undefined;
1753
1864
  }): this;
1754
- /** AND MATCH(key1, key2, key3) AGAINST (:value) WITH QUERY EXPANSION*/
1865
+ /** AND MATCH(key1, key2, key3...) AGAINST (:value) WITH QUERY EXPANSION*/
1755
1866
  matchQuery(value: string, keys: (keyof T)[], { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1756
1867
  paramName?: string | undefined;
1757
1868
  skipEmptyString?: boolean | undefined;
1758
1869
  breakExcuteIfEmpty?: boolean | undefined;
1759
1870
  }): this;
1760
- /** AND NOT MATCH(key1, key2, key3) AGAINST (:value) WITH QUERY EXPANSION*/
1871
+ /** AND NOT MATCH(key1, key2, key3...) AGAINST (:value) WITH QUERY EXPANSION*/
1761
1872
  notMatchQuery(value: string, keys: (keyof T)[], { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1762
1873
  paramName?: string | undefined;
1763
1874
  skipEmptyString?: boolean | undefined;
1764
1875
  breakExcuteIfEmpty?: boolean | undefined;
1765
1876
  }): this;
1766
- /** AND NOT LOCATE(key, :value) > 0 */
1877
+ /** AND LOCATE(key, :value) > 0 */
1767
1878
  includes(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1768
1879
  paramName?: string | undefined;
1769
1880
  skipEmptyString?: boolean | undefined;
@@ -1775,6 +1886,18 @@ declare class StreamQuery<T extends object> {
1775
1886
  skipEmptyString?: boolean | undefined;
1776
1887
  breakExcuteIfEmpty?: boolean | undefined;
1777
1888
  }): this;
1889
+ /** AND LOCATE(:value, key) > 0 */
1890
+ includes2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1891
+ paramName?: string | undefined;
1892
+ skipEmptyString?: boolean | undefined;
1893
+ breakExcuteIfEmpty?: boolean | undefined;
1894
+ }): this;
1895
+ /** AND NOT LOCATE(:value, key) = 0 */
1896
+ notIncludes2(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1897
+ paramName?: string | undefined;
1898
+ skipEmptyString?: boolean | undefined;
1899
+ breakExcuteIfEmpty?: boolean | undefined;
1900
+ }): this;
1778
1901
  /** AND FIND_IN_SET(:value, key) */
1779
1902
  findInSet(key: keyof T, value: string | number, { paramName, skipEmptyString, breakExcuteIfEmpty }?: {
1780
1903
  paramName?: string | undefined;
@@ -1789,6 +1912,14 @@ declare class StreamQuery<T extends object> {
1789
1912
  }): this;
1790
1913
  and(fn: StreamQuery<T> | ((stream: StreamQuery<T>) => boolean | void)): this;
1791
1914
  or(fn: StreamQuery<T> | ((stream: StreamQuery<T>) => boolean | void)): this;
1915
+ /**
1916
+ * sql WHERE 查询语句拼接:注意若有JOIN,需要写明别名。本表别名为t.例如:
1917
+ * ```
1918
+ * where('t.name > :name', {name: 1});
1919
+ * where('(t.name > :name OR t.name <> :name)', {name: 1});
1920
+ * ```
1921
+ */
1922
+ where(sql: string, param?: Record<string, any>): this;
1792
1923
  /** SET key = IFNULL(key, 0) + :value */
1793
1924
  incr(key: keyof T, value?: number): this;
1794
1925
  /** GROUP BY key1, key2, ... */
@@ -1824,8 +1955,16 @@ declare class StreamQuery<T extends object> {
1824
1955
  groupName?: string;
1825
1956
  }): this;
1826
1957
  select(...key: (keyof T)[]): this;
1958
+ /**
1959
+ * sql查询语句拼接:注意若有JOIN,需要写明别名。本表别名为t.例如:
1960
+ * ```
1961
+ * select2('t.name, t.age, ISNULL(t.type, :type)', {type: 1});
1962
+ * select2('MAX(t.age) MAXAge');
1963
+ * ```
1964
+ */
1827
1965
  select2(sql: string, param?: Record<string, any>): this;
1828
1966
  update(key: keyof T, value: T[keyof T]): this;
1967
+ /** update语句拼接:注意若有JOIN,需要写明别名。本表别名为t */
1829
1968
  update2(sql: string, param?: Record<string, any>): this;
1830
1969
  updateT(t: Partial<T>): this;
1831
1970
  /** SET key = REPLACE(key, :valueToFind, :valueToReplace) */
@@ -1838,14 +1977,6 @@ declare class StreamQuery<T extends object> {
1838
1977
  mapperIfUndefined?: MapperIfUndefined;
1839
1978
  dataConvert?: Record<string, string>;
1840
1979
  }): Promise<L[]>;
1841
- excuteSelect<L = T>(option?: MethodOption & {
1842
- sync?: SyncMode.Async;
1843
- selectResult?: SelectResult.RS_CS_List | SelectResult.RS_C_List;
1844
- hump?: boolean;
1845
- mapper?: string | SqlMapper;
1846
- mapperIfUndefined?: MapperIfUndefined;
1847
- dataConvert?: Record<string, string>;
1848
- }): Promise<ArrayList<L>>;
1849
1980
  excuteSelect<L = T>(option: MethodOption & {
1850
1981
  sync?: SyncMode.Async;
1851
1982
  selectResult: SelectResult.R_CS_Assert | SelectResult.R_C_Assert;
@@ -1871,14 +2002,6 @@ declare class StreamQuery<T extends object> {
1871
2002
  mapperIfUndefined?: MapperIfUndefined;
1872
2003
  dataConvert?: Record<string, string>;
1873
2004
  }): L[];
1874
- excuteSelect<L = T>(option: MethodOption & {
1875
- sync: SyncMode.Sync;
1876
- selectResult: SelectResult.RS_CS_List | SelectResult.RS_C_List;
1877
- hump?: boolean;
1878
- mapper?: string | SqlMapper;
1879
- mapperIfUndefined?: MapperIfUndefined;
1880
- dataConvert?: Record<string, string>;
1881
- }): ArrayList<L>;
1882
2005
  excuteSelect<L = T>(option: MethodOption & {
1883
2006
  sync: SyncMode.Sync;
1884
2007
  selectResult: SelectResult.R_CS_Assert | SelectResult.R_C_Assert;
@@ -1925,6 +2048,7 @@ declare class StreamQuery<T extends object> {
1925
2048
  }): number;
1926
2049
  private _where;
1927
2050
  private _;
2051
+ private _2;
1928
2052
  private __;
1929
2053
  private _null;
1930
2054
  private _key;
@@ -1934,8 +2058,11 @@ declare class StreamQuery<T extends object> {
1934
2058
  private _shift;
1935
2059
  private _match;
1936
2060
  private _pow;
2061
+ private _pow2;
1937
2062
  private _like;
2063
+ private _like2;
1938
2064
  private _includes;
2065
+ private _includes2;
1939
2066
  }
1940
2067
  /**
1941
2068
  获取REDIS客户端,