@sap/cds-sql
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -9,2 +9,8 @@ # Changelog | ||
## Version 1.5.1 - 2019-02-12 | ||
### Added | ||
- Support for sql functions lower, upper, trim, length in $filter and $orderby | ||
## Version 1.5.0 - 2019-02-06 | ||
@@ -11,0 +17,0 @@ |
@@ -48,5 +48,2 @@ const BaseBuilder = require('./BaseBuilder') | ||
} | ||
if (this._obj.sort) { | ||
this._outputObj.sql.push(this._obj.sort === 'desc' ? 'DESC' : 'ASC') | ||
} | ||
} else { | ||
@@ -56,2 +53,6 @@ this._outputObj.sql.push(this._obj) | ||
if (this._obj.sort) { | ||
this._outputObj.sql.push(this._obj.sort === 'desc' ? 'DESC' : 'ASC') | ||
} | ||
this._outputObj.sql = this._outputObj.sql.join(' ') | ||
@@ -79,9 +80,22 @@ return this._outputObj | ||
} else { | ||
this._outputObj.sql.push( | ||
this._obj.ref[1].args.map(e => new ReferenceBuilder(e, this._options, this._csn).build().sql).join(', '), | ||
')' | ||
) | ||
this._addFunctionArgs(this._obj.ref[1].args) | ||
this._outputObj.sql.push(')') | ||
} | ||
} | ||
_addFunctionArgs (args) { | ||
const res = [] | ||
for (const arg of args) { | ||
if (arg.ref) { | ||
const { sql, values } = new ReferenceBuilder(arg, this._options, this._csn).build() | ||
res.push(sql) | ||
this._outputObj.values.push(...values) | ||
} else if (arg.val) { | ||
this._outputObj.values.push(arg.val) | ||
res.push(this._options.placeholder) | ||
} | ||
} | ||
this._outputObj.sql.push(res.join(', ')) | ||
} | ||
_createLikeComparison (contains, columns, searchText) { | ||
@@ -88,0 +102,0 @@ const length = columns.length |
{ | ||
"name": "@sap/cds-sql", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"lockfileVersion": 1 | ||
} |
@@ -1,1 +0,1 @@ | ||
{"bundleDependencies":false,"dependencies":{},"deprecated":false,"description":"This package offers a factory method to build a SQL string from a CQN object and a BaseClient which performs default post processing to be used by the inheriting clients.","engines":{"node":">= 8.9.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"{lib,test}/**/*.js":["prettier-standard","standard --fix","git add"]},"main":"lib/index.js","name":"@sap/cds-sql","version":"1.5.0","license":"SEE LICENSE IN developer-license-3.1.txt"} | ||
{"bundleDependencies":false,"dependencies":{},"deprecated":false,"description":"This package offers a factory method to build a SQL string from a CQN object and a BaseClient which performs default post processing to be used by the inheriting clients.","engines":{"node":">= 8.9.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"{lib,test}/**/*.js":["prettier-standard","standard --fix","git add"]},"main":"lib/index.js","name":"@sap/cds-sql","version":"1.5.1","license":"SEE LICENSE IN developer-license-3.1.txt"} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
187159
4783