doix-db 0.0.21 → 0.0.23

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.
@@ -80,7 +80,7 @@ class DbQuery {
80
80
 
81
81
  const t = q.addTable (table.relation ? table.relation.name : table.sql, o)
82
82
 
83
- for (const f of table.filters) f.clone (t)
83
+ for (const {sql, params} of table.filters) t.filters.push ({sql, params: [...params]})
84
84
 
85
85
  }
86
86
 
@@ -10,7 +10,7 @@ class DbQueryOr {
10
10
 
11
11
  const {filters} = this; if (filters.length === 0) throw Error ('No one term in this search condition')
12
12
 
13
- return filters.map (i => i.sql).join (' OR ')
13
+ return '(' + filters.map (i => '(' + i.sql + ')').join (' OR ') + ')'
14
14
 
15
15
  }
16
16
 
@@ -16,18 +16,6 @@ class DbQueryTableColumnComparison {
16
16
 
17
17
  }
18
18
 
19
- clone (table) {
20
-
21
- const result = new DbQueryTableColumnComparison (table, this.column.name, this.op, this.params)
22
-
23
- result.sql = this.sql
24
-
25
- result.params = this.params
26
-
27
- return result
28
-
29
- }
30
-
31
19
  setParams (value) {
32
20
 
33
21
  const {op, table} = this, {lang} = table
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doix-db",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "Shared database related code for doix",
5
5
  "main": "index.js",
6
6
  "files": [