Skip to content

Commit 586cf5b

Browse files
committed
ai-supported edit
1 parent 57bc498 commit 586cf5b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

guides/databases/cdl-to-ddl.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,9 @@ CREATE TABLE Books (
439439

440440
### Invalid Names
441441

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.
443443

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:
445445

446446
::: code-group
447447
```cds [CDS Source]
@@ -491,7 +491,7 @@ If a constraint violation occurs, the error messages coming from the database ar
491491

492492
### Primary Key Constraints
493493

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:
495495

496496
::: code-group
497497
```cds [CDS Source]
@@ -567,7 +567,7 @@ annotate OrderItems with @assert.unique.someOtherConstraint: [ ... ];
567567

568568
- 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:
569569

570-
- scalar types, i.e., `String`, `Integer`, etc.
570+
- scalar types - `String`, `Integer`, and so on
571571
- structured types – **not** elements _within_ structs.
572572
- _managed_ associations – **not** _unmanaged_ associations.
573573

@@ -626,7 +626,7 @@ entity Books {
626626

627627
#### Deferred Enforcement
628628

629-
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:
630630

631631
> [!note] Database constraints are not supported for H2
632632

guides/databases/cql-to-sql.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CDS Compilation to Database-Specific SQL
22

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.
44
{.abstract}
55

66
[[toc]]
@@ -19,7 +19,7 @@ In addition, CQL provides some extended operators as described below.
1919

2020
### Bivalent `==` and `!=` Operators
2121

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:
2323

2424
::: code-group
2525
```SQL [CQL's Two-Valued Logic Operators]
@@ -52,7 +52,7 @@ The result set includes all books where genre is not 'Science Fiction', includin
5252
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.
5353

5454
> [!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.
5656
5757
### Ternary `?:` Operator
5858

@@ -74,14 +74,14 @@ FROM Books;
7474
```
7575
:::
7676

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.
7878

7979

8080
## Functions
8181

8282
### Portable Functions
8383

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.
8585

8686
String functions:
8787

0 commit comments

Comments
 (0)