From de8ecd338ddd0391aad76e4c7bd323af4330c0c4 Mon Sep 17 00:00:00 2001 From: Andre Meyering Date: Wed, 17 Jan 2024 08:48:34 +0100 Subject: [PATCH 1/3] docs(database): Be more explicit about operators/functions in CDS files --- guides/databases-sqlite.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/guides/databases-sqlite.md b/guides/databases-sqlite.md index 1347775d4..cd0890812 100644 --- a/guides/databases-sqlite.md +++ b/guides/databases-sqlite.md @@ -319,8 +319,8 @@ The following is an overview of advanced features supported by the new database The new database service provides **full support** for all kinds of [path expressions](../cds/cql#path-expressions), including [infix filters](../cds/cql#with-infix-filters) and [exists predicates](../cds/cql#exists-predicate). For example, you can try this out with *[cap/samples](https://github.com/sap-samples/cloud-cap-samples)* as follows: -```sh -cds repl --profile better-sqlite +```js +// $ cds repl --profile better-sqlite var { server } = await cds.test('bookshop'), { Books, Authors } = cds.entities await INSERT.into (Books) .entries ({ title: 'Unwritten Book' }) await INSERT.into (Authors) .entries ({ name: 'Upcoming Author' }) @@ -397,6 +397,7 @@ The new database services guarantee identical behavior of these logic operators: In particular, the translation of `!=` to `IS NOT` in SQLite — or to `IS DISTINCT FROM` in standard SQL, or to an equivalent polyfill in SAP HANA — greatly improves the portability of your code. +> These operators are available for runtime queries, but not in CDS files. ### Standard Functions {.impl .node} @@ -419,6 +420,7 @@ A specified set of standard functions is now supported in a **database-agnostic* * `year` `month`, `day`, `hour`, `minute`, `second` — return parts of a datetime > 1 Argument `n` is optional. +> These functions are only supported at runtime via the database service, but in CDS files. The database service implementation translates these to the best-possible native SQL functions, thus enhancing the extent of **portable** queries. @@ -812,4 +814,4 @@ Having said this, there can indeed be scenarios where SQLite might also be used ::: warning SQLite only has limited support for concurrent database access due to its very coarse lock granularity. This makes it badly suited for applications with high concurrency. -::: \ No newline at end of file +::: From 7c023681ed500aa36c5bc826daadcdc3325e8bdd Mon Sep 17 00:00:00 2001 From: Andre Meyering Date: Wed, 17 Jan 2024 09:11:59 +0100 Subject: [PATCH 2/3] Update guides/databases-sqlite.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Jeglinsky --- guides/databases-sqlite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/databases-sqlite.md b/guides/databases-sqlite.md index cd0890812..0de494825 100644 --- a/guides/databases-sqlite.md +++ b/guides/databases-sqlite.md @@ -420,7 +420,7 @@ A specified set of standard functions is now supported in a **database-agnostic* * `year` `month`, `day`, `hour`, `minute`, `second` — return parts of a datetime > 1 Argument `n` is optional. -> These functions are only supported at runtime via the database service, but in CDS files. +> These functions are only supported at runtime using the database service, but not in CDS files. The database service implementation translates these to the best-possible native SQL functions, thus enhancing the extent of **portable** queries. From 1a63219afc0a59a0ea514448ce3bd1bad260f14a Mon Sep 17 00:00:00 2001 From: Andre Meyering Date: Thu, 25 Jan 2024 10:11:48 +0100 Subject: [PATCH 3/3] Update guides/databases-sqlite.md Co-authored-by: Johannes Vogel <31311694+johannes-vogel@users.noreply.github.com> --- guides/databases-sqlite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/databases-sqlite.md b/guides/databases-sqlite.md index 0de494825..85c4577d4 100644 --- a/guides/databases-sqlite.md +++ b/guides/databases-sqlite.md @@ -420,7 +420,7 @@ A specified set of standard functions is now supported in a **database-agnostic* * `year` `month`, `day`, `hour`, `minute`, `second` — return parts of a datetime > 1 Argument `n` is optional. -> These functions are only supported at runtime using the database service, but not in CDS files. +> These functions are only supported within runtime queries, but not in CDS files. The database service implementation translates these to the best-possible native SQL functions, thus enhancing the extent of **portable** queries.