sql-easy-builder
Advanced tools
@@ -75,2 +75,6 @@ import { Op } from './attr_builder'; | ||
| /** | ||
| * index('a') => USE INDEX (a) | ||
| */ | ||
| index(name: FieldType, type?: 'USE' | 'FORCE' | 'IGNORE', for_?: 'JOIN' | 'ORDER BY' | 'GROUP BY'): this; | ||
| /** | ||
| * where({ username: 'test' }) => WHERE username = ?; ['test'] | ||
@@ -77,0 +81,0 @@ * where(w => w.eq('username', 'test')) => WHERE username = ?; ['test'] |
+13
-0
@@ -249,2 +249,15 @@ "use strict"; | ||
| /** | ||
| * index('a') => USE INDEX (a) | ||
| */ | ||
| index(name, type, for_) { | ||
| this.append(`${type || 'USE'} INDEX`); | ||
| if (for_) { | ||
| this.append(`FOR ${for_}`); | ||
| } | ||
| this.append('('); | ||
| this.fields([name]); | ||
| this.append(')'); | ||
| return this; | ||
| } | ||
| /** | ||
| * where({ username: 'test' }) => WHERE username = ?; ['test'] | ||
@@ -251,0 +264,0 @@ * where(w => w.eq('username', 'test')) => WHERE username = ?; ['test'] |
+2
-2
| { | ||
| "name": "sql-easy-builder", | ||
| "version": "2.14.1", | ||
| "version": "2.15.0", | ||
| "description": "SQL easy builder", | ||
@@ -15,3 +15,3 @@ "exports": "./dist/index.js", | ||
| "build": "rimraf dist && tsc", | ||
| "prepublishOnly": "npm run build", | ||
| "prepack": "npm run build", | ||
| "test": "tsc && ts-mocha test/test.ts" | ||
@@ -18,0 +18,0 @@ }, |
-34
| # Changelog | ||
| ## [2.14.1] - 2023-10-26 | ||
| - 修复: $and 数组无效元素产生空 AND () 问题 | ||
| ## [2.14.0] - 2023-8-23 | ||
| - 新增: AB.distinctCount | ||
| ## [2.13.0] - 2023-4-28 | ||
| - 删除: class Where 此功能不太常用,没有 jsonWhere 方便,故此删除 | ||
| - 更新: symbol UNSET 改为 class UNSET,修正 ts 检查问题 | ||
| - 更新: 使用 typescript 重写 test | ||
| ## [2.12.0] - 2023-4-23 | ||
| - 更新: between 支持单个参数查询 | ||
| ## [2.11.0] - 2023-4-18 | ||
| - 新增: JSON 查询新增 UNSET 类型,可以删除查询条件 | ||
| ## [2.10.0] - 2023-4-18 | ||
| - 新增: PointType, AB.point, Buffer | ||
| - 更新: AttrBuilder 为抽象类 | ||
| - 更新: BuildResult 为对象类型 | ||
| ## [2.9.0] - 2023-3-13 | ||
| - fix: JsonWhere 不能设置 null 值问题 | ||
| - update: 删除 JsonWhereParam 类型 | ||
| - update: WhereType 增加 Where 类型 | ||
| ## 2.8.1 | ||
| - update() 方法忽略值为 undefined 的 | ||
| ## 2.8.0 | ||
| - null 检查 |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1381
1.25%5
-16.67%49056
-0.86%20
-4.76%