From ef2ce873b70be80ee27a336d9afbd545c8e20057 Mon Sep 17 00:00:00 2001 From: Lothar Bender Date: Tue, 18 Jun 2024 12:59:19 +0200 Subject: [PATCH 1/5] new command: cds compile --to hana --- node.js/cds-compile.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/node.js/cds-compile.md b/node.js/cds-compile.md index 83aa51dcd..001175615 100644 --- a/node.js/cds-compile.md +++ b/node.js/cds-compile.md @@ -184,25 +184,26 @@ for (let [edm,{file,suffix}] of all) ``` - - -### .hdbtable() {.method} - ### .hdbcds() {.method} +Generates `hdbcds` output. +Current SAP HANA Cloud versions do no longer support `.hdbcds`, use `cds.compile.to.hana` instead. The command is supported for backward compatibility with older versions of [SAP HANA Service for SAP BTP](https://help.sap.com/docs/HANA_SERVICE). +### .hdbtable() {.method} - deprecated +Generates `hdbtable/hdbview` output. +Returns a generator that yields `[ src, {file} ]` for each resulting `.hdbtable`, `.hdbview` file. -Generates `hdbtable/view` or `hdbcds` output. -Returns a generator that yields `[ src, {file} ]` for each resulting `.hdbtable`, `.hdbview`, or `.hdbcds` file. +### .hana() {.method} + +Use `cds.compile.to.hana` instead of the deprecated `cds.compile.to.hdbtable`. The generated `hdbtable/hdbview` output is identical, but may contain additional migration table specific data calculated for a given `beforeImage` model parameter. The latter is only relevant for build tools to determine the actual migration table contents. +The result is a generator that produces `[ src, {file} ]` for each resulting `.hdbtable`, `.hdbview` and optional `.json` files for the migration table specific data. For example, use it as follows: ```js -let all = cds.compile.to.hdbtable (csn) +let all = cds.compile.to.hana (csn) for (let [src,{file}] of all) console.log (file,src) ``` - - ### .sql() {.method} From be24f58a07aab7b1db0994a3531958f30ce19469 Mon Sep 17 00:00:00 2001 From: Lothar Bender Date: Tue, 18 Jun 2024 14:11:49 +0200 Subject: [PATCH 2/5] Update node.js/cds-compile.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Jeglinsky --- node.js/cds-compile.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node.js/cds-compile.md b/node.js/cds-compile.md index 001175615..fb93fcea4 100644 --- a/node.js/cds-compile.md +++ b/node.js/cds-compile.md @@ -184,11 +184,11 @@ for (let [edm,{file,suffix}] of all) ``` -### .hdbcds() {.method} +### .hdbcds() {.method} - deprecated Generates `hdbcds` output. Current SAP HANA Cloud versions do no longer support `.hdbcds`, use `cds.compile.to.hana` instead. The command is supported for backward compatibility with older versions of [SAP HANA Service for SAP BTP](https://help.sap.com/docs/HANA_SERVICE). -### .hdbtable() {.method} - deprecated +### .hdbtable() {.method} - deprecated Generates `hdbtable/hdbview` output. Returns a generator that yields `[ src, {file} ]` for each resulting `.hdbtable`, `.hdbview` file. From 41657e90829c60b48cd371725e94f21f0666d3f3 Mon Sep 17 00:00:00 2001 From: Lothar Bender Date: Wed, 19 Jun 2024 10:49:52 +0200 Subject: [PATCH 3/5] different wording --- node.js/cds-compile.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/node.js/cds-compile.md b/node.js/cds-compile.md index fb93fcea4..1978750e7 100644 --- a/node.js/cds-compile.md +++ b/node.js/cds-compile.md @@ -194,14 +194,15 @@ Returns a generator that yields `[ src, {file} ]` for each resulting `.hdbtable` ### .hana() {.method} -Use `cds.compile.to.hana` instead of the deprecated `cds.compile.to.hdbtable`. The generated `hdbtable/hdbview` output is identical, but may contain additional migration table specific data calculated for a given `beforeImage` model parameter. The latter is only relevant for build tools to determine the actual migration table contents. -The result is a generator that produces `[ src, {file} ]` for each resulting `.hdbtable`, `.hdbview` and optional `.json` files for the migration table specific data. +Use `cds.compile.to.hana` instead of the deprecated `cds.compile.to.hdbtable`. The generated `hdbtable/hdbview/hdbconstraint` output is identical, but may contain additional migration table specific data calculated for a given `beforeImage` model parameter. The latter is only relevant for build tools to determine the actual migration table changes. +The result is a generator function that produces `[ src, {file} ]` for each artifact. For example, use it as follows: ```js -let all = cds.compile.to.hana (csn) -for (let [src,{file}] of all) - console.log (file,src) +const all = cds.compile.to.hana(csn); +for (const [src, { file }] of all) { + console.log(file, src); +} ``` ### .sql() {.method} From d9bf21ec722efbde198274f0339e57ea86df00f9 Mon Sep 17 00:00:00 2001 From: Lothar Bender Date: Wed, 19 Jun 2024 12:13:51 +0200 Subject: [PATCH 4/5] describe output more precisely --- node.js/cds-compile.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node.js/cds-compile.md b/node.js/cds-compile.md index 1978750e7..2f0250ea9 100644 --- a/node.js/cds-compile.md +++ b/node.js/cds-compile.md @@ -195,13 +195,13 @@ Returns a generator that yields `[ src, {file} ]` for each resulting `.hdbtable` ### .hana() {.method} Use `cds.compile.to.hana` instead of the deprecated `cds.compile.to.hdbtable`. The generated `hdbtable/hdbview/hdbconstraint` output is identical, but may contain additional migration table specific data calculated for a given `beforeImage` model parameter. The latter is only relevant for build tools to determine the actual migration table changes. -The result is a generator function that produces `[ src, {file} ]` for each artifact. +The result is a generator function that produces `[ content, {file} ]` for each artifact. The variable `content` contains the SQL DDL statements for the `.hdb*` artifacts, while `file` represents the corresponding filename. For example, use it as follows: ```js const all = cds.compile.to.hana(csn); -for (const [src, { file }] of all) { - console.log(file, src); +for (const [content, { file }] of all) { + console.log(file, content); } ``` From b163aa056d6d3ea24dddd1c6f4533f7234b099db Mon Sep 17 00:00:00 2001 From: Christian Georgi Date: Thu, 20 Jun 2024 18:18:36 +0200 Subject: [PATCH 5/5] Cosmetics --- .vitepress/theme/custom.scss | 2 ++ node.js/cds-compile.md | 24 +++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.vitepress/theme/custom.scss b/.vitepress/theme/custom.scss index 109ac3f02..2fd6cb824 100644 --- a/.vitepress/theme/custom.scss +++ b/.vitepress/theme/custom.scss @@ -252,6 +252,8 @@ main { .event::before { content: 'Event: '; color: #999 } .class::before { content: 'Class: '; color: #999 } .async-method::before { content: 'Method: async '; color: #999 } + .deprecated::after { content: ' – deprecated'; color: #999 } + h3.event, h3.method, h3.async-method { margin-top: 5em; // font-size: 22px; diff --git a/node.js/cds-compile.md b/node.js/cds-compile.md index 2f0250ea9..2fa9d8909 100644 --- a/node.js/cds-compile.md +++ b/node.js/cds-compile.md @@ -184,18 +184,26 @@ for (let [edm,{file,suffix}] of all) ``` -### .hdbcds() {.method} - deprecated +### .hdbcds() {.method .deprecated} + Generates `hdbcds` output. -Current SAP HANA Cloud versions do no longer support `.hdbcds`, use `cds.compile.to.hana` instead. The command is supported for backward compatibility with older versions of [SAP HANA Service for SAP BTP](https://help.sap.com/docs/HANA_SERVICE). -### .hdbtable() {.method} - deprecated +Current SAP HANA Cloud versions do no longer support `.hdbcds`. The command is supported for backward compatibility with older versions of [SAP HANA Service for SAP BTP](https://help.sap.com/docs/HANA_SERVICE). + +Use [`cds.compile.to.hana`](#hana) instead. + +### .hdbtable() {.method .deprecated} + Generates `hdbtable/hdbview` output. -Returns a generator that yields `[ src, {file} ]` for each resulting `.hdbtable`, `.hdbview` file. -### .hana() {.method} +Use [`cds.compile.to.hana`](#hana) instead. + +### .hana() {.method} + +Generates `hdbtable/hdbview` output. + +Returns a generator function that produces `[ content, {file} ]` for each artifact. The variable `content` contains the SQL DDL statements for the `.hdb*` artifacts, and `file` is the filename. -Use `cds.compile.to.hana` instead of the deprecated `cds.compile.to.hdbtable`. The generated `hdbtable/hdbview/hdbconstraint` output is identical, but may contain additional migration table specific data calculated for a given `beforeImage` model parameter. The latter is only relevant for build tools to determine the actual migration table changes. -The result is a generator function that produces `[ content, {file} ]` for each artifact. The variable `content` contains the SQL DDL statements for the `.hdb*` artifacts, while `file` represents the corresponding filename. For example, use it as follows: ```js @@ -205,6 +213,8 @@ for (const [content, { file }] of all) { } ``` +Additional data for `.hdbmigrationtable` files is calculated if a `beforeImage` parameter is passed in. This is only relevant for build tools to determine the actual migration table changes. + ### .sql() {.method}