@cap-js/db-service
Advanced tools
Comparing version 1.11.0 to 1.12.0
@@ -7,2 +7,17 @@ # Changelog | ||
## [1.12.0](https://github.com/cap-js/cds-dbs/compare/db-service-v1.11.0...db-service-v1.12.0) (2024-07-25) | ||
### Fixed | ||
*** add placeholder for string values ([#733](https://github.com/cap-js/cds-dbs/issues/733)) ([8136a45](https://github.com/cap-js/cds-dbs/commit/8136a4526f596b67932908b8ab1336cb052100f3)) | ||
*** for aggregated `expand` always set explicit alias ([#739](https://github.com/cap-js/cds-dbs/issues/739)) ([53a8075](https://github.com/cap-js/cds-dbs/commit/53a8075a609666a896296401a28b6183ff5aa487)), closes [#708](https://github.com/cap-js/cds-dbs/issues/708) | ||
*** quotations in vals ([#754](https://github.com/cap-js/cds-dbs/issues/754)) ([94d8e97](https://github.com/cap-js/cds-dbs/commit/94d8e977ed00776ff494287ce505d6b7e8017d2e)) | ||
### Changed | ||
*** generic-pool as real dep ([#750](https://github.com/cap-js/cds-dbs/issues/750)) ([b50c907](https://github.com/cap-js/cds-dbs/commit/b50c907880455a41a73826a736bc17ca17e5b9ae)) | ||
## [1.11.0](https://github.com/cap-js/cds-dbs/compare/db-service-v1.10.3...db-service-v1.11.0) (2024-07-08) | ||
@@ -9,0 +24,0 @@ |
@@ -1,2 +0,2 @@ | ||
const { createPool } = require('@sap/cds-foss').pool | ||
const { createPool } = require('generic-pool') | ||
@@ -3,0 +3,0 @@ class ConnectionPool { |
@@ -26,3 +26,4 @@ const StandardFunctions = { | ||
// only apply first search term, rest is ignored | ||
arg.val = arg.__proto__.val = arg.val.split(' ')[0].replace(/"/g, '') | ||
const sub= /("")|("(?:[^"]|\\")*(?:[^\\]|\\\\)")|(\S*)/.exec(arg.val) | ||
arg.val = arg.__proto__.val = (sub[2] ? JSON.parse(sub[2]) : sub[3]) || '' | ||
const refs = ref.list || [ref], | ||
@@ -29,0 +30,0 @@ { toString } = ref |
@@ -88,3 +88,3 @@ const cds = require('@sap/cds') | ||
this.sql, | ||
sanitize_values && (this.entries || this.values?.length > 0) ? ['***'] : this.entries || this.values, | ||
...(sanitize_values && (this.entries || this.values?.length > 0) ? ['***'] : this.entries || this.values || []), | ||
) | ||
@@ -315,4 +315,4 @@ return this | ||
if (x === '*') return '*' | ||
let sql = this.expr({ param: false, __proto__: x }) | ||
let sql = x.param !== true && typeof x.val === 'number' ? this.expr({ param: false, __proto__: x }): this.expr(x) | ||
let alias = this.column_alias4(x, q) | ||
@@ -513,2 +513,3 @@ if (alias) sql += ' as ' + this.quote(alias) | ||
stream.type = 'json' | ||
stream._raw = INSERT.entries | ||
this.entries = [[...this.values, stream]] | ||
@@ -658,2 +659,3 @@ } | ||
stream.type = 'json' | ||
stream._raw = INSERT.rows | ||
this.entries = [[...this.values, stream]] | ||
@@ -1087,2 +1089,4 @@ } | ||
Readable.prototype[require('node:util').inspect.custom] = Readable.prototype.toJSON = function () { return this._raw || `[object ${this.constructor.name}]` } | ||
const ObjectKeys = o => (o && [...ObjectKeys(o.__proto__), ...Object.keys(o)]) || [] | ||
@@ -1089,0 +1093,0 @@ const _managed = { |
@@ -374,6 +374,4 @@ const cds = require('@sap/cds'), | ||
!this.model?.definitions[_target_name4(q)] | ||
) { | ||
return _unquirked(q) | ||
} | ||
return cqn4sql(q, this.model) | ||
) return q | ||
else return cqn4sql(q, this.model) | ||
} | ||
@@ -468,14 +466,2 @@ | ||
const _unquirked = !cds.env.ql.quirks_mode ? q => q : q => { | ||
if (!q) return q | ||
else if (typeof q.SELECT?.from === 'string') q.SELECT.from = { ref: [q.SELECT.from] } | ||
else if (typeof q.INSERT?.into === 'string') q.INSERT.into = { ref: [q.INSERT.into] } | ||
else if (typeof q.UPSERT?.into === 'string') q.UPSERT.into = { ref: [q.UPSERT.into] } | ||
else if (typeof q.UPDATE?.entity === 'string') q.UPDATE.entity = { ref: [q.UPDATE.entity] } | ||
else if (typeof q.DELETE?.from === 'string') q.DELETE.from = { ref: [q.DELETE.from] } | ||
else if (typeof q.CREATE?.entity === 'string') q.CREATE.entity = { ref: [q.CREATE.entity] } | ||
else if (typeof q.DROP?.entity === 'string') q.DROP.entity = { ref: [q.DROP.entity] } | ||
return q | ||
} | ||
const sqls = new (class extends SQLService { | ||
@@ -482,0 +468,0 @@ get factory() { |
{ | ||
"name": "@cap-js/db-service", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"description": "CDS base database service", | ||
@@ -27,2 +27,5 @@ "homepage": "https://github.com/cap-js/cds-dbs/tree/main/db-service#cds-base-database-service", | ||
}, | ||
"dependencies": { | ||
"generic-pool": "^3.9.0" | ||
}, | ||
"peerDependencies": { | ||
@@ -29,0 +32,0 @@ "@sap/cds": ">=7.9" |
# CDS base database service | ||
Welcome to the new base database service for [SAP Cloud Application Programming Model](https://cap.cloud.sap) Node.js, based on new, streamlined database architecture. | ||
Welcome to the base database service for [SAP Cloud Application Programming Model](https://cap.cloud.sap) Node.js. This service forms the core of all supported databases and is the base of our streamlined database architecture. | ||
Find documentation at https://cap.cloud.sap/docs/guides/databases | ||
Find documentation at <https://cap.cloud.sap/docs/guides/databases> | ||
@@ -26,2 +26,2 @@ ## Support | ||
Copyright 2023 SAP SE or an SAP affiliate company and cds-dbs contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cap-js/cds-dbs). | ||
Copyright 2024 SAP SE or an SAP affiliate company and cds-dbs contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cap-js/cds-dbs). |
Sorry, the diff of this file is too big to display
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
301099
27
2
6282
1
+ Addedgeneric-pool@^3.9.0