@budibase/backend-core 2.29.30 → 2.30.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budibase/backend-core",
3
- "version": "2.29.30",
3
+ "version": "2.30.0",
4
4
  "description": "Budibase backend core libraries used in server and worker",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  "dependencies": {
24
24
  "@budibase/nano": "10.1.5",
25
25
  "@budibase/pouchdb-replication-stream": "1.2.11",
26
- "@budibase/shared-core": "2.29.30",
27
- "@budibase/types": "2.29.30",
26
+ "@budibase/shared-core": "2.30.0",
27
+ "@budibase/types": "2.30.0",
28
28
  "aws-cloudfront-sign": "3.0.2",
29
29
  "aws-sdk": "2.1030.0",
30
30
  "bcrypt": "5.1.0",
@@ -95,5 +95,5 @@
95
95
  }
96
96
  }
97
97
  },
98
- "gitHead": "189394af7aa7280f434d1753a4bb04b755e3941a"
98
+ "gitHead": "804bad718ad31b940fce1d9bdfa97845ecdbea24"
99
99
  }
package/src/sql/sql.ts CHANGED
@@ -463,6 +463,24 @@ class InternalBuilder {
463
463
  }
464
464
  }
465
465
 
466
+ if (filters.$and) {
467
+ const { $and } = filters
468
+ query = query.where(x => {
469
+ for (const condition of $and.conditions) {
470
+ x = this.addFilters(x, condition, opts)
471
+ }
472
+ })
473
+ }
474
+
475
+ if (filters.$or) {
476
+ const { $or } = filters
477
+ query = query.where(x => {
478
+ for (const condition of $or.conditions) {
479
+ x = this.addFilters(x, { ...condition, allOr: true }, opts)
480
+ }
481
+ })
482
+ }
483
+
466
484
  if (filters.oneOf) {
467
485
  const fnc = allOr ? "orWhereIn" : "whereIn"
468
486
  iterate(
@@ -682,6 +700,8 @@ class InternalBuilder {
682
700
  const direction =
683
701
  value.direction === SortOrder.ASCENDING ? "asc" : "desc"
684
702
 
703
+ // TODO: figure out a way to remove this conditional, not relying on
704
+ // the defaults of each datastore.
685
705
  let nulls: "first" | "last" | undefined = undefined
686
706
  if (
687
707
  this.client === SqlClient.POSTGRES ||