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
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>
Copy file name to clipboardExpand all lines: guides/databases.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -921,12 +921,12 @@ Instead, they protect the integrity of your data in the database layer against p
921
921
922
922
## Standard Database Functions
923
923
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.
925
925
926
926
927
927
### OData standard functions
928
928
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.
930
930
931
931
::: warning Case Sensitivity
932
932
The OData functionmappings 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
1021
1021
If you provide more than one argument, the `round`functionmay behave differently depending on the database.
Standard aggregate functions used to calculate minimum, maximum, sum, average, count, and distinct count of values.
1045
1049
1050
+
<div class="impl node">
1046
1051
1047
1052
### SAP HANA Functions
1048
1053
@@ -1066,7 +1071,7 @@ For the SAP HANA functions, both usages are allowed: all-lowercase as given abov
1066
1071
1067
1072
### Special Runtime Functions
1068
1073
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:
1070
1075
1071
1076
- `search(x, y)`
1072
1077
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
1079
1084
- `now()`
1080
1085
Returns the current timestamp.
1081
1086
1087
+
</div>
1088
+
1082
1089
## Using Native Features { #native-db-functions}
1083
1090
1084
1091
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
1191
1198
1192
1199
</div>
1193
1200
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