Skip to content

Commit

Permalink
docs(database): Be more explicit about operators/functions in CDS fil…
Browse files Browse the repository at this point in the history
…es (#632)

Co-authored-by: René Jeglinsky <[email protected]>
Co-authored-by: Johannes Vogel <[email protected]>
  • Loading branch information
3 people authored Jan 25, 2024
1 parent a91c891 commit c3917dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions guides/databases-sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down Expand Up @@ -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}
Expand All @@ -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

> <sup>1</sup> 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.

Expand Down Expand Up @@ -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.
:::
:::

0 comments on commit c3917dd

Please sign in to comment.