doix-db 1.0.57 → 1.0.59
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/lib/model/DbColumn.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
const DbQueryColumn = require ('../query/DbQueryColumn.js')
|
|
2
|
-
|
|
3
1
|
const DbReference = require ('./DbReference.js')
|
|
4
2
|
|
|
5
3
|
const CH_ROUND_OPEN = '('.charCodeAt (0)
|
|
@@ -33,24 +31,6 @@ class DbColumn {
|
|
|
33
31
|
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
toQueryColumn (queryTable) {
|
|
37
|
-
|
|
38
|
-
const c = new DbQueryColumn (
|
|
39
|
-
|
|
40
|
-
queryTable.query,
|
|
41
|
-
|
|
42
|
-
queryTable.qName + '.' + this.qName,
|
|
43
|
-
|
|
44
|
-
queryTable.isFirst ? this.name : queryTable.alias + '.' + this.name
|
|
45
|
-
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
c.table = queryTable
|
|
49
|
-
|
|
50
|
-
return c
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
34
|
parse () {
|
|
55
35
|
|
|
56
36
|
const {src} = this, pos = src.lastIndexOf ('//')
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const DbQueryTableColumnComparison = require ('./DbQueryTableColumnComparison.js')
|
|
2
|
+
const DbQueryColumn = require ('./DbQueryColumn.js')
|
|
2
3
|
|
|
3
4
|
const JOIN_TYPES_ALOWED = ['LEFT', 'INNER', 'CROSS']
|
|
4
5
|
|
|
@@ -24,7 +25,7 @@ class DbQueryTable {
|
|
|
24
25
|
|
|
25
26
|
const names = o.columns || Object.keys (columns)
|
|
26
27
|
|
|
27
|
-
this.columns = names.map (name => columns [name]
|
|
28
|
+
this.columns = names.map (name => this.toQueryColumn (columns [name]))
|
|
28
29
|
|
|
29
30
|
}
|
|
30
31
|
else {
|
|
@@ -70,6 +71,24 @@ class DbQueryTable {
|
|
|
70
71
|
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
toQueryColumn (column) {
|
|
75
|
+
|
|
76
|
+
const c = new DbQueryColumn (
|
|
77
|
+
|
|
78
|
+
this.query,
|
|
79
|
+
|
|
80
|
+
this.qName + '.' + column.qName,
|
|
81
|
+
|
|
82
|
+
this.isFirst ? column.name : this.alias + '.' + column.name
|
|
83
|
+
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
c.table = this
|
|
87
|
+
|
|
88
|
+
return c
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
73
92
|
createColumnComparison (name, op, value) {
|
|
74
93
|
|
|
75
94
|
if (value == null && !this.lang.isUnaryOperator (op)) return null
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doix-db",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.59",
|
|
4
4
|
"description": "Shared database related code for doix",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/do-/node-doix-db#readme",
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"doix": "^1.0.
|
|
43
|
+
"doix": "^1.0.31"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"jest": "^29.6.1"
|