Skip to content
Draft
Show file tree
Hide file tree
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
347 changes: 347 additions & 0 deletions cds/assets/cql/nested-expand.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
320 changes: 320 additions & 0 deletions cds/assets/cql/nested-inline.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
272 changes: 272 additions & 0 deletions cds/assets/cql/postfix-projection.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
365 changes: 365 additions & 0 deletions cds/assets/cql/select-item.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
789 changes: 789 additions & 0 deletions cds/assets/cql/select.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions cds/cql.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,25 @@ CDS Query Language (CQL) is based on standard SQL, which it enhances by...
[[toc]]



## SELECT

![](./assets/cql/select.drawio.svg)

> Using: Query Source, Select Item, Expressions, Ordering Term



## Select Item

![](./assets/cql/select-item.drawio.svg)


## Postfix Projections
{#postfix-projections}

![](./assets/cql/postfix-projection.drawio.svg)

CQL allows to put projections, that means, the `SELECT` clause, behind the `FROM` clause enclosed in curly braces. For example, the following are equivalent:

```sql
Expand All @@ -29,6 +45,10 @@ SELECT from Authors { name, address.street }
### Nested Expands <Beta />
{#nested-expands}


![](./assets/cql/nested-expand.drawio.svg)


Postfix projections can be appended to any column referring to a struct element or an association and hence be nested.
This allows **expand** results along associations and hence read deeply structured documents:

Expand Down Expand Up @@ -125,6 +145,8 @@ results = [

### Nested Inlines <Beta /> {#nested-inlines}

![](./assets/cql/nested-inline.drawio.svg)

Put a **`"."`** before the opening brace to **inline** the target elements and avoid writing lengthy lists of paths to read several elements from the same target. For example:

```sql
Expand Down