@sap/cds-ql
Advanced tools
Comparing version 1.11.1 to 1.14.0
@@ -9,2 +9,21 @@ # Changelog | ||
## Version 1.14.0 - 2019-06-24 | ||
### Fixed | ||
- Bug with nested types in update | ||
- Improved logging of SQLs when DEBUG=true is provided | ||
## Version 1.13.0 - 2019-06-07 | ||
### Changed | ||
- updated generic-pool to 3.7.1 | ||
## Version 1.12.0 - 2019-05-24 | ||
### Removed | ||
- Removed superficial cache for services | ||
## Version 1.11.1 - 2019-05-16 | ||
@@ -11,0 +30,0 @@ |
@@ -82,2 +82,6 @@ const { IllegalFunctionArgumentError } = require('../errors') | ||
if (driver.prototype._executeExpand) { | ||
driver.prototype._executeExpand = _decorated(driver.prototype._executeExpand) | ||
} | ||
driver.prototype._executeSQL = _decorated(driver.prototype._executeSQL) | ||
@@ -97,3 +101,6 @@ } | ||
case 'sqlite': | ||
case 'rest': | ||
return require(`@sap/cds-${kind}`) | ||
case 'enterpriseMessaging': | ||
return require(`@sap/cds-em`) | ||
case undefined: | ||
@@ -174,3 +181,11 @@ case null: | ||
if (!options.credentials || (options.credentials && !options.credentials.user && !options.credentials.database)) { | ||
if ( | ||
!options.credentials || | ||
(options.credentials && | ||
!options.credentials.user && | ||
!options.credentials.database && | ||
!options.credentials.mock && | ||
!options.credentials.sources && | ||
!options.credentials.targets) | ||
) { | ||
xsenv(options) | ||
@@ -177,0 +192,0 @@ } |
@@ -63,10 +63,39 @@ const Pool = require('./Pool') | ||
if (this.options.package && this.options.package.serviceFunctions) { | ||
Object.defineProperties(this, { | ||
create: { value: this.options.package.serviceFunctions.create, writable: true }, | ||
read: { value: this.options.package.serviceFunctions.read, writable: true }, | ||
update: { value: this.options.package.serviceFunctions.update, writable: true }, | ||
delete: { value: this.options.package.serviceFunctions.delete, writable: true }, | ||
insert: { value: this.options.package.serviceFunctions.insert, writable: true } | ||
}) | ||
if (this.options.package) { | ||
if (this.options.package.serviceFunctions) { | ||
Object.defineProperties(this, { | ||
create: { value: this.options.package.serviceFunctions.create, writable: true }, | ||
read: { value: this.options.package.serviceFunctions.read, writable: true }, | ||
update: { value: this.options.package.serviceFunctions.update, writable: true }, | ||
delete: { value: this.options.package.serviceFunctions.delete, writable: true }, | ||
insert: { value: this.options.package.serviceFunctions.insert, writable: true } | ||
}) | ||
} | ||
if (this.options.package.httpFunctions) { | ||
Object.defineProperties(this, { | ||
get: { value: this.options.package.httpFunctions.get, writable: true }, | ||
post: { value: this.options.package.httpFunctions.post, writable: true }, | ||
put: { value: this.options.package.httpFunctions.put, writable: true }, | ||
patch: { value: this.options.package.httpFunctions.patch, writable: true }, | ||
delete: { value: this.options.package.httpFunctions.delete, writable: true } | ||
}) | ||
} | ||
if (this.options.package.messagingFunctions) { | ||
Object.defineProperties(this, { | ||
on: { value: this.options.package.messagingFunctions.on, writable: true }, | ||
emit: { value: this.options.package.messagingFunctions.emit, writable: true }, | ||
removeAllListeners: { value: this.options.package.messagingFunctions.removeAllListeners, writable: true }, | ||
putQueue: { value: this.options.package.messagingFunctions.putQueue, writable: true }, | ||
deleteQueue: { value: this.options.package.messagingFunctions.deleteQueue, writable: true }, | ||
addSubscription: { value: this.options.package.messagingFunctions.addSubscription, writable: true } | ||
}) | ||
this.on.error = this.options.package.messagingFunctions.onError.bind(this) | ||
this.on.topic = this.options.package.messagingFunctions.onTopic.bind(this) | ||
this.emit.to = Object.defineProperties(this, { | ||
topic: { value: this.options.package.messagingFunctions.emitToTopic, writable: true }, | ||
queue: { value: this.options.package.messagingFunctions.emitToQueue, writable: true } | ||
}) | ||
} | ||
} | ||
@@ -94,2 +123,7 @@ | ||
const _get = this.get | ||
const _post = this.post | ||
const _put = this.put | ||
const _patch = this.patch | ||
// 2. Load the model asynchronously | ||
@@ -115,2 +149,10 @@ const done = this._loadServiceModel(this.options.model) | ||
if (_get) { | ||
this.get = _get | ||
this.post = _post | ||
this.put = _put | ||
this.patch = _patch | ||
this.delete = _delete | ||
} | ||
return this | ||
@@ -134,2 +176,10 @@ }) | ||
} | ||
if (_get) { | ||
this.get = (...args) => done.then(() => this.get(...args)) | ||
this.post = (...args) => done.then(() => this.post(...args)) | ||
this.put = (...args) => done.then(() => this.put(...args)) | ||
this.patch = (...args) => done.then(() => this.patch(...args)) | ||
this.delete = (...args) => done.then(() => this.delete(...args)) | ||
} | ||
} | ||
@@ -136,0 +186,0 @@ |
const { SessionInstanceError } = require('../errors') | ||
const Service = require('./Service') | ||
const _cache = {} | ||
let _primary | ||
@@ -37,10 +36,2 @@ | ||
const connect = (datasource, options, primary = false) => { | ||
if (((datasource && _cache[datasource]) || (primary && _primary)) && options) { | ||
throw new Error('Cannot access cache with options') | ||
} | ||
if (typeof datasource !== 'object' && _cache[datasource]) { | ||
return _cache[datasource] | ||
} | ||
if (primary && _primary) { | ||
@@ -52,6 +43,2 @@ return _primary.session | ||
if (datasource) { | ||
_cache[datasource] = session | ||
} | ||
if (primary) { | ||
@@ -122,3 +109,2 @@ _primary = { | ||
if (!tenantId) { | ||
delete _cache[_primary.datasource] | ||
_primary = null | ||
@@ -125,0 +111,0 @@ } |
@@ -108,3 +108,3 @@ // Support for legacy push down of model | ||
const then = (resolve, reject) => { | ||
return promise.then(resolve).catch(reject) | ||
return promise.then(resolve, reject).catch(reject) | ||
} | ||
@@ -111,0 +111,0 @@ |
@@ -60,2 +60,10 @@ const Where = require('./Where') | ||
if (!Array.isArray(value) && value instanceof Object) { | ||
const cqnObj = {} | ||
for (const key in value) { | ||
cqnObj[key] = this._generateValObj(value[key], key) | ||
} | ||
return cqnObj | ||
} | ||
return { val: value } | ||
@@ -62,0 +70,0 @@ } |
{ | ||
"name": "@sap/cds-ql", | ||
"version": "1.11.1", | ||
"version": "1.14.0", | ||
"lockfileVersion": 1, | ||
@@ -8,18 +8,18 @@ "requires": true, | ||
"@sap/cds-hana": { | ||
"version": "1.11.1", | ||
"version": "1.13.0", | ||
"requires": { | ||
"@sap/cds-sql": "1.11.1" | ||
"@sap/cds-sql": "1.13.0" | ||
} | ||
}, | ||
"@sap/cds-sql": { | ||
"version": "1.11.1" | ||
"version": "1.13.0" | ||
}, | ||
"@sap/cds-sqlite": { | ||
"version": "1.11.1", | ||
"version": "1.13.0", | ||
"requires": { | ||
"@sap/cds-sql": "1.11.1" | ||
"@sap/cds-sql": "1.13.0" | ||
} | ||
}, | ||
"generic-pool": { | ||
"version": "3.4.2" | ||
"version": "3.7.1" | ||
}, | ||
@@ -26,0 +26,0 @@ "uuid": { |
@@ -1,1 +0,1 @@ | ||
{"bundleDependencies":false,"dependencies":{"@sap/cds-hana":"1.11.1","@sap/cds-sql":"1.11.1","@sap/cds-sqlite":"1.11.1","generic-pool":"3.4.2","uuid":"3.3.2"},"deprecated":false,"description":"This package deals with creating a pool of connection clients, connecting to a driver (read: db) and using these connection clients from the pool to insert, delete, select and update values or rows from a specific table. Performing these insert, delete, select and update operations also includes executing embedded queries and plain statements.","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-ql","version":"1.11.1","license":"SEE LICENSE IN developer-license-3.1.txt"} | ||
{"bundleDependencies":false,"dependencies":{"@sap/cds-hana":"1.13.0","@sap/cds-sql":"1.13.0","@sap/cds-sqlite":"1.13.0","generic-pool":"3.7.1","uuid":"3.3.2"},"deprecated":false,"description":"This package deals with creating a pool of connection clients, connecting to a driver (read: db) and using these connection clients from the pool to insert, delete, select and update values or rows from a specific table. Performing these insert, delete, select and update operations also includes executing embedded queries and plain statements.","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-ql","version":"1.14.0","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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
152204
3306
8
+ Added@sap/cds-hana@1.13.0(transitive)
+ Added@sap/cds-sql@1.13.0(transitive)
+ Added@sap/cds-sqlite@1.13.0(transitive)
+ Addedgeneric-pool@3.7.1(transitive)
- Removed@sap/cds-hana@1.11.1(transitive)
- Removed@sap/cds-sql@1.11.1(transitive)
- Removed@sap/cds-sqlite@1.11.1(transitive)
- Removedgeneric-pool@3.4.2(transitive)
Updated@sap/cds-hana@1.13.0
Updated@sap/cds-sql@1.13.0
Updated@sap/cds-sqlite@1.13.0
Updatedgeneric-pool@3.7.1