Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(database): Be more explicit about operators/functions in CDS files #632

Merged
merged 4 commits into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
:::
:::
Loading