Browse Source
Merge pull request #4 from esalazarv/fix/raw-quotes
Fix for column names in raw. Especially for non postgres drivers
master^2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
2 deletions
-
.gitignore
-
index.js
|
|
@ -36,3 +36,4 @@ jspm_packages |
|
|
|
# Optional REPL history |
|
|
|
.node_repl_history |
|
|
|
.vscode/* |
|
|
|
.idea |
|
|
|
|
|
@ -57,7 +57,7 @@ function addCondition (q, field, val) { |
|
|
|
return val.forEach(addCondition.bind(null, this, field)); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!Array.isArray(val)) { |
|
|
|
// Simple string or number value
|
|
|
|
val = ['AND', field, val ]; |
|
|
@ -78,7 +78,7 @@ function addCondition (q, field, val) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
var args = val[0].includes('RAW') ? [ '"'+val[1]+'" ' + val[2] ] : val.slice(1) |
|
|
|
var args = val[0].includes('RAW') ? [ q.client.raw('??', val[1]) + ' ' + val[2] ] : val.slice(1); |
|
|
|
return q[functionOperatorMap[val[0]]].apply(q, args); |
|
|
|
} |
|
|
|
|
|
|
|