@sap/cds 7.9.0 → 7.9.1

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/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@
4
4
  - The format is based on [Keep a Changelog](http://keepachangelog.com/).
5
5
  - This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## Version 7.9.1 - 2024-05-13
8
+
9
+ ### Fixed
10
+
11
+ - `cds.compile.to.sql` doesn't fail for older compiler versions if `postgres` keywords aren't defined
12
+ - `cds compile --to serviceinfo` no longer detects a Java project if there is a poml.xml file in a subfolder of `app/`
13
+ - `acquireTimeoutMillis` is ensured if custom pool config is provided
14
+
7
15
  ## Version 7.9.0 - 2024-04-30
8
16
 
9
17
  ### Added
@@ -1,7 +1,7 @@
1
1
  const cds = require ('../..')
2
2
  const cdsc = require ('../cdsc')
3
3
  const sqliteKeywords = cdsc.to.sql.sqlite.keywords
4
- const postgresKeywords = cdsc.to.sql.postgres.keywords
4
+ const postgresKeywords = cdsc.to.sql.postgres?.keywords // requires @sap/cds-compiler >= 4.8.0
5
5
  const { unfold_ddl } = require ('../etc/_localized')
6
6
  const TRACE = cds.debug('trace')
7
7
 
@@ -8,7 +8,7 @@ module.exports = (model, options={}) => {
8
8
 
9
9
  const result = []
10
10
  const isNodeProject = _isNodeProject(options.root || cds.root)
11
- const javaPrefix = _javaPrefix()
11
+ const javaPrefix = _javaPrefix(options.root || cds.root)
12
12
  const isJavaProject = !!javaPrefix
13
13
 
14
14
  cds.linked(model) .all ('service')
@@ -85,11 +85,12 @@ module.exports = (model, options={}) => {
85
85
  }
86
86
  }
87
87
 
88
- function _javaPrefix() {
88
+ function _javaPrefix(root) {
89
89
  let is_java
90
90
  const javaPrefixDefault = 'odata/v4/'
91
- for (let s of model.$sources) {
92
- const file = isfile (join (s,'../src/main/resources/application.yaml'))
91
+ const roots = [ cds.env.folders.db, cds.env.folders.srv ].map(d => join(root, d))
92
+ for (let r of roots) {
93
+ const file = isfile (join (r,'../src/main/resources/application.yaml'))
93
94
  if (file) {
94
95
  const yaml = cds.load.yaml(file)
95
96
  for (let yamlDoc of Array.isArray(yaml) ? yaml : [yaml]) {
@@ -103,7 +104,7 @@ module.exports = (model, options={}) => {
103
104
  }
104
105
  return javaPrefixDefault
105
106
  }
106
- else if (isfile (join(s,'../pom.xml'))) is_java = true
107
+ else if (isfile (join(r,'../pom.xml'))) is_java = true
107
108
  }
108
109
  return is_java && javaPrefixDefault
109
110
  }
@@ -62,6 +62,9 @@ const _getPoolConfig = function () {
62
62
  const { pool: poolConfig } = cds.env.requires.db
63
63
  const mergedConfig = Object.assign({}, defaultConfig, poolConfig)
64
64
 
65
+ // without an acquire timeout, the acquire call _never_ rejects -> blocks the request forever
66
+ mergedConfig.acquireTimeoutMillis ??= process.env.NODE_ENV === 'production' ? 1000 : 10 * 1000
67
+
65
68
  // defaults
66
69
  if (!poolConfig) {
67
70
  if (process.env.NODE_ENV === 'production') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds",
3
- "version": "7.9.0",
3
+ "version": "7.9.1",
4
4
  "description": "SAP Cloud Application Programming Model - CDS for Node.js",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [