You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/databases/cdl-to-ddl.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -439,9 +439,9 @@ CREATE TABLE Books (
439
439
440
440
### Invalid Names
441
441
442
-
When you use names in your CDS models that conflict with reserved words of underlying databases, or names that contain non-ASCII characters, special characters, or spaces, these names are considered invalid in many databases, and are therefore escaped by CAP in the generated DDL, and all queries sent to the database.
442
+
When you use names in your CDS models that conflict with reserved words of underlying databases, or names that contain non-ASCII characters, special characters, or spaces, these names are considered invalid in many databases. CAP escapes these names in the generated DDL and all queries sent to the database.
443
443
444
-
For example, the following is a valid CDS model, with all database-invalid named elements, so the generated DDL will escape them accordingly with double quotes:
444
+
For example, the following is a valid CDS model with database-invalid named elements. The generated DDL escapes them with double quotes:
445
445
446
446
::: code-group
447
447
```cds [CDS Source]
@@ -491,7 +491,7 @@ If a constraint violation occurs, the error messages coming from the database ar
491
491
492
492
### Primary Key Constraints
493
493
494
-
Primary keys defined in CDS entities are translated into SQL `PRIMARY KEY` constraints in the generated DDL. For example:
494
+
The compiler translates primary keys defined in CDS entities into SQL `PRIMARY KEY` constraints in the generated DDL. For example:
- The argument is expected to be an array of flat [element references](../../cds/cdl#annotation-values) referring to elements in the entity. These elements may have the following types:
569
569
570
-
- scalar types, i.e.,`String`, `Integer`, etc.
570
+
- scalar types -`String`, `Integer`, and so on
571
571
- structured types – **not** elements _within_ structs.
Referential integrity is enforced at the time of transaction commit by using the databases[deferred foreign key constraints](https://www.sqlite.org/foreignkeys.html), which is supported by most relational databases, including SAP HANA, SQLite, and PostgreSQL, but not for H2, hence:
629
+
Referential integrity is enforced at the time of transaction commit. This uses the database's[deferred foreign key constraints](https://www.sqlite.org/foreignkeys.html), which are supported by most relational databases, including SAP HANA, SQLite, and PostgreSQL. However, H2 does not support deferred constraints:
630
630
631
631
> [!note] Database constraints are not supported for H2
Copy file name to clipboardExpand all lines: guides/databases/cql-to-sql.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# CDS Compilation to Database-Specific SQL
2
2
3
-
CAP supports a number of portable functions and operators in CQL, which are automatically translated to the best-possible database-specific native SQL equivalents. These can safely be used in CDS view definitions as well as in runtime queries expressed in CQL.
3
+
CAP supports a number of portable functions and operators in CQL. The compiler automatically translates these to the best-possible database-specific native SQL equivalents. You can safely use these in CDS view definitions and runtime queries expressed in CQL.
4
4
{.abstract}
5
5
6
6
[[toc]]
@@ -19,7 +19,7 @@ In addition, CQL provides some extended operators as described below.
19
19
20
20
### Bivalent `==` and `!=` Operators
21
21
22
-
CQL supports `==` and `!=` operators as bivalent logic variants for SQL's three-valued logic `=` and `<>`. In essence, the differences are as follows:
22
+
CQL supports `==` and `!=` operators as bivalent logic variants for SQL's three-valued logic `=` and `<>`. The differences are as follows:
23
23
24
24
::: code-group
25
25
```SQL [CQL's Two-Valued Logic Operators]
@@ -52,7 +52,7 @@ The result set includes all books where genre is not 'Science Fiction', includin
52
52
The CQL behavior is consistent with common programming languages like JavaScript and Java, as well as with OData semantics. It is implemented in database by, the translation of `!=` to `IS NOT` in SQLite, or to `IS DISTINCT FROM` in standard SQL, and to an equivalent polyfill in SAP HANA.
53
53
54
54
> [!tip] Prefer == and !=
55
-
> Prefer using `==` and `!=` in the very most cases to avoid unexpected `null` results. Only use `=` and `<>` if you _really_ want SQL's three-valued logic behavior.
55
+
> Prefer using `==` and `!=` in most cases to avoid unexpected `null` results. Only use `=` and `<>` if you _really_ want SQL's three-valued logic behavior.
56
56
57
57
### Ternary `?:` Operator
58
58
@@ -74,14 +74,14 @@ FROM Books;
74
74
```
75
75
:::
76
76
77
-
This operator is translated to the best-possible equivalent in the target database, for example to `CASE WHEN ... THEN ... ELSE ... END` in standard SQL, or to`IF(..., ..., ...)` in SAP HANA.
77
+
The compiler translates this operator to the best-possible equivalent in the target database: `CASE WHEN ... THEN ... ELSE ... END` in standard SQL, or `IF(..., ..., ...)` in SAP HANA.
78
78
79
79
80
80
## Functions
81
81
82
82
### Portable Functions
83
83
84
-
Following are portable functions guaranteed by CAP. These can safely be used in CDS view definitions as well as in runtime queries expressed in CQL, and are translated to the best-possible database-specific native SQL equivalents.
84
+
Following are portable functions supported by CAP. You can safely use these in CDS view definitions and runtime queries expressed in CQL. The compiler translates them to the best-possible database-specific native SQL equivalents.
0 commit comments