Skip to content

Commit 90abd4a

Browse files
chore: remove node.js only marker for most standard functions (#2169)
most of the standard database functions are also supported by the java runtime. Hence this section needed to be updated. Date / Aggregation / SAP HANA functions are still a todo for Java. Once the BLIs are implemented, we can also unlock those sections for Java. --------- Co-authored-by: Adrian Görler <adrian.goerler@sap.com>
1 parent e452db4 commit 90abd4a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

guides/databases.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -921,12 +921,12 @@ Instead, they protect the integrity of your data in the database layer against p
921921
922922
## Standard Database Functions
923923
924-
A specified set of standard functions - inspired by [OData](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_StringandCollectionFunctions) and [SAP HANA](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/alphabetical-list-of-functions?locale=en-US) - is supported in a **database-agnostic**, hence portable way, and translated to the best-possible native SQL functions or polyfills during runtime (currently only Node.js) and for your CDL files.
924+
A specified set of standard functions - inspired by [OData](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_StringandCollectionFunctions) and [SAP HANA](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/alphabetical-list-of-functions?locale=en-US) - is supported in a **database-agnostic**, hence portable way. The functions are translated to the best-possible database-specific SQL expressions at runtime and also during compilation of your CDL files.
925925
926926
927927
### OData standard functions
928928
929-
The `@sap/cds-compiler` and all CAP Node.js database services come with out of the box support for common OData functions.
929+
The `@sap/cds-compiler` and the database services come with out of the box support for common OData functions.
930930
931931
::: warning Case Sensitivity
932932
The OData function mappings are case-sensitive and must be written as in the list below.
@@ -1021,6 +1021,8 @@ For example, `startsWith` instead of `startswith` will be passed as-is to the da
10211021
If you provide more than one argument, the `round` function may behave differently depending on the database.
10221022
:::
10231023
1024+
<div class="impl node">
1025+
10241026
#### Date and Time Functions
10251027
10261028
- `year(x)`, `month(x)`, `day(x)`, `hour(x)`, `minute(x)`, `second(x)`
@@ -1038,11 +1040,14 @@ For example, `startsWith` instead of `startswith` will be passed as-is to the da
10381040
- `mindatetime()`
10391041
Returns the earliest possible point in time: `'0001-01-01T00:00:00.000Z'`.
10401042
1043+
</div>
1044+
10411045
#### Aggregate Functions
10421046
10431047
- `min(x)`, `max(x)`, `sum(x)`, `average(x)`, `count(x)`, `countdistinct(x)`
10441048
Standard aggregate functions used to calculate minimum, maximum, sum, average, count, and distinct count of values.
10451049
1050+
<div class="impl node">
10461051
10471052
### SAP HANA Functions
10481053
@@ -1066,7 +1071,7 @@ For the SAP HANA functions, both usages are allowed: all-lowercase as given abov
10661071
10671072
### Special Runtime Functions
10681073
1069-
In addition to the OData and SAP HANA standard functions, the **CAP runtimes** provides special functions that are only available for runtime queries:
1074+
In addition to the OData and SAP HANA standard functions, the **CAP runtime** provides special functions that are only available for runtime queries:
10701075
10711076
- `search(x, y)`
10721077
Checks whether `y` is contained in any element of `x` (fuzzy matching may apply).
@@ -1079,6 +1084,8 @@ In addition to the OData and SAP HANA standard functions, the **CAP runtimes** p
10791084
- `now()`
10801085
Returns the current timestamp.
10811086
1087+
</div>
1088+
10821089
## Using Native Features { #native-db-functions}
10831090
10841091
In general, the CDS 2 SQL compiler doesn't 'understand' SQL functions but translates them to SQL generically as long as they follow the standard call syntax of `function(param1, param2)`. This allows you to use native database functions inside your CDS models.
@@ -1191,4 +1198,4 @@ Once you have 2 non-HANA local databases, you need to have 2 distinct database c
11911198
11921199
</div>
11931200
1194-
CAP samples demonstrate this in [@capire/bookstore](https://github.com/capire/bookstore/tree/main/db).
1201+
CAP samples demonstrate this in [@capire/bookstore](https://github.com/capire/bookstore/tree/main/db).

0 commit comments

Comments
 (0)