@budibase/server 2.4.36 → 2.4.37
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/builder/assets/{index.20cfbe7d.js → index.21a8a65c.js} +216 -216
- package/builder/index.html +1 -1
- package/dist/integrations/base/sql.js +3 -3
- package/dist/package.json +7 -7
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/integrations/base/sql.ts +3 -3
- package/src/integrations/tests/sql.spec.ts +50 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.37",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"license": "GPL-3.0",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
46
|
-
"@budibase/backend-core": "^2.4.
|
|
47
|
-
"@budibase/client": "^2.4.
|
|
48
|
-
"@budibase/pro": "2.4.
|
|
49
|
-
"@budibase/shared-core": "^2.4.
|
|
50
|
-
"@budibase/string-templates": "^2.4.
|
|
51
|
-
"@budibase/types": "^2.4.
|
|
46
|
+
"@budibase/backend-core": "^2.4.37",
|
|
47
|
+
"@budibase/client": "^2.4.37",
|
|
48
|
+
"@budibase/pro": "2.4.36",
|
|
49
|
+
"@budibase/shared-core": "^2.4.37",
|
|
50
|
+
"@budibase/string-templates": "^2.4.37",
|
|
51
|
+
"@budibase/types": "^2.4.37",
|
|
52
52
|
"@bull-board/api": "3.7.0",
|
|
53
53
|
"@bull-board/koa": "3.9.4",
|
|
54
54
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -175,5 +175,5 @@
|
|
|
175
175
|
"optionalDependencies": {
|
|
176
176
|
"oracledb": "5.3.0"
|
|
177
177
|
},
|
|
178
|
-
"gitHead": "
|
|
178
|
+
"gitHead": "7644199c2c0ba7bfce04e0b2bb68c530b1ddc777"
|
|
179
179
|
}
|
|
@@ -156,7 +156,7 @@ class InternalBuilder {
|
|
|
156
156
|
const rawFnc = `${fnc}Raw`
|
|
157
157
|
// @ts-ignore
|
|
158
158
|
query = query[rawFnc](`LOWER(${likeKey(this.client, key)}) LIKE ?`, [
|
|
159
|
-
`%${value}%`,
|
|
159
|
+
`%${value.toLowerCase()}%`,
|
|
160
160
|
])
|
|
161
161
|
}
|
|
162
162
|
}
|
|
@@ -202,7 +202,7 @@ class InternalBuilder {
|
|
|
202
202
|
let statement = ""
|
|
203
203
|
for (let i in value) {
|
|
204
204
|
if (typeof value[i] === "string") {
|
|
205
|
-
value[i] = `%"${value[i]}"%`
|
|
205
|
+
value[i] = `%"${value[i].toLowerCase()}"%`
|
|
206
206
|
} else {
|
|
207
207
|
value[i] = `%${value[i]}%`
|
|
208
208
|
}
|
|
@@ -238,7 +238,7 @@ class InternalBuilder {
|
|
|
238
238
|
const rawFnc = `${fnc}Raw`
|
|
239
239
|
// @ts-ignore
|
|
240
240
|
query = query[rawFnc](`LOWER(${likeKey(this.client, key)}) LIKE ?`, [
|
|
241
|
-
`${value}%`,
|
|
241
|
+
`${value.toLowerCase()}%`,
|
|
242
242
|
])
|
|
243
243
|
}
|
|
244
244
|
})
|
|
@@ -351,7 +351,7 @@ describe("SQL query builder", () => {
|
|
|
351
351
|
})
|
|
352
352
|
)
|
|
353
353
|
expect(query).toEqual({
|
|
354
|
-
bindings: [10, "%20%", "%25%", `%"
|
|
354
|
+
bindings: [10, "%20%", "%25%", `%"john"%`, `%"mary"%`],
|
|
355
355
|
sql: `select * from (select top (@p0) * from [${TABLE_NAME}] where (LOWER([${TABLE_NAME}].[age]) LIKE @p1 AND LOWER([${TABLE_NAME}].[age]) LIKE @p2) and (LOWER([${TABLE_NAME}].[name]) LIKE @p3 AND LOWER([${TABLE_NAME}].[name]) LIKE @p4)) as [${TABLE_NAME}]`,
|
|
356
356
|
})
|
|
357
357
|
})
|
|
@@ -402,7 +402,7 @@ describe("SQL query builder", () => {
|
|
|
402
402
|
})
|
|
403
403
|
)
|
|
404
404
|
expect(query).toEqual({
|
|
405
|
-
bindings: [10, "%20%", `%"
|
|
405
|
+
bindings: [10, "%20%", `%"john"%`],
|
|
406
406
|
sql: `select * from (select top (@p0) * from [${TABLE_NAME}] where NOT (LOWER([${TABLE_NAME}].[age]) LIKE @p1) and NOT (LOWER([${TABLE_NAME}].[name]) LIKE @p2)) as [${TABLE_NAME}]`,
|
|
407
407
|
})
|
|
408
408
|
})
|
|
@@ -453,7 +453,7 @@ describe("SQL query builder", () => {
|
|
|
453
453
|
})
|
|
454
454
|
)
|
|
455
455
|
expect(query).toEqual({
|
|
456
|
-
bindings: [10, "%20%", "%25%", `%"
|
|
456
|
+
bindings: [10, "%20%", "%25%", `%"john"%`, `%"mary"%`],
|
|
457
457
|
sql: `select * from (select top (@p0) * from [${TABLE_NAME}] where (LOWER([${TABLE_NAME}].[age]) LIKE @p1 OR LOWER([${TABLE_NAME}].[age]) LIKE @p2) and (LOWER([${TABLE_NAME}].[name]) LIKE @p3 OR LOWER([${TABLE_NAME}].[name]) LIKE @p4)) as [${TABLE_NAME}]`,
|
|
458
458
|
})
|
|
459
459
|
})
|
|
@@ -531,7 +531,7 @@ describe("SQL query builder", () => {
|
|
|
531
531
|
})
|
|
532
532
|
)
|
|
533
533
|
expect(query).toEqual({
|
|
534
|
-
bindings: ["
|
|
534
|
+
bindings: ["john%", limit],
|
|
535
535
|
sql: `select * from (select * from \`${tableName}\` where LOWER(\`${tableName}\`.\`name\`) LIKE ? limit ?) as \`${tableName}\``,
|
|
536
536
|
})
|
|
537
537
|
})
|
|
@@ -549,7 +549,7 @@ describe("SQL query builder", () => {
|
|
|
549
549
|
})
|
|
550
550
|
)
|
|
551
551
|
expect(query).toEqual({
|
|
552
|
-
bindings: [limit, "
|
|
552
|
+
bindings: [limit, "john%"],
|
|
553
553
|
sql: `select * from (select top (@p0) * from [${tableName}] where LOWER([${tableName}].[name]) LIKE @p1) as [${tableName}]`,
|
|
554
554
|
})
|
|
555
555
|
})
|
|
@@ -591,4 +591,49 @@ describe("SQL query builder", () => {
|
|
|
591
591
|
sql: `select * from (select * from \"${TABLE_NAME}\" where \"${TABLE_NAME}\".\"dob\" < $1 limit $2) as \"${TABLE_NAME}\"`,
|
|
592
592
|
})
|
|
593
593
|
})
|
|
594
|
+
|
|
595
|
+
it("should lowercase the values for Oracle LIKE statements", () => {
|
|
596
|
+
let query = new Sql(SqlClient.ORACLE, limit)._query(
|
|
597
|
+
generateReadJson({
|
|
598
|
+
filters: {
|
|
599
|
+
string: {
|
|
600
|
+
name: "John",
|
|
601
|
+
},
|
|
602
|
+
},
|
|
603
|
+
})
|
|
604
|
+
)
|
|
605
|
+
expect(query).toEqual({
|
|
606
|
+
bindings: ["john%", limit],
|
|
607
|
+
sql: `select * from (select * from (select * from \"test\" where LOWER(\"test\".\"name\") LIKE :1) where rownum <= :2) \"test\"`,
|
|
608
|
+
})
|
|
609
|
+
|
|
610
|
+
query = new Sql(SqlClient.ORACLE, limit)._query(
|
|
611
|
+
generateReadJson({
|
|
612
|
+
filters: {
|
|
613
|
+
contains: {
|
|
614
|
+
age: [20, 25],
|
|
615
|
+
name: ["John", "Mary"],
|
|
616
|
+
},
|
|
617
|
+
},
|
|
618
|
+
})
|
|
619
|
+
)
|
|
620
|
+
expect(query).toEqual({
|
|
621
|
+
bindings: ["%20%", "%25%", `%"john"%`, `%"mary"%`, limit],
|
|
622
|
+
sql: `select * from (select * from (select * from \"test\" where (LOWER(\"test\".\"age\") LIKE :1 AND LOWER(\"test\".\"age\") LIKE :2) and (LOWER(\"test\".\"name\") LIKE :3 AND LOWER(\"test\".\"name\") LIKE :4)) where rownum <= :5) \"test\"`,
|
|
623
|
+
})
|
|
624
|
+
|
|
625
|
+
query = new Sql(SqlClient.ORACLE, limit)._query(
|
|
626
|
+
generateReadJson({
|
|
627
|
+
filters: {
|
|
628
|
+
fuzzy: {
|
|
629
|
+
name: "Jo",
|
|
630
|
+
},
|
|
631
|
+
},
|
|
632
|
+
})
|
|
633
|
+
)
|
|
634
|
+
expect(query).toEqual({
|
|
635
|
+
bindings: [`%jo%`, limit],
|
|
636
|
+
sql: `select * from (select * from (select * from \"test\" where LOWER(\"test\".\"name\") LIKE :1) where rownum <= :2) \"test\"`,
|
|
637
|
+
})
|
|
638
|
+
})
|
|
594
639
|
})
|