From c3917ddb9f09b0f77b95433fa2601e53fc33e824 Mon Sep 17 00:00:00 2001 From: Andre Meyering Date: Thu, 25 Jan 2024 11:22:06 +0100 Subject: [PATCH] docs(database): Be more explicit about operators/functions in CDS files (#632) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Jeglinsky Co-authored-by: Johannes Vogel <31311694+johannes-vogel@users.noreply.github.com> --- 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..85c4577d4 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 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. @@ -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 +:::