Skip to content

Commit ef6e7a9

Browse files
Merge branch 'main' into add_open_rewrite
2 parents 44bc91a + bb9d5c3 commit ef6e7a9

File tree

6 files changed

+63
-62
lines changed

6 files changed

+63
-62
lines changed

.vitepress/theme/components/ConfigInspect.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@
3636
import FloatingVue from 'floating-vue'
3737
import yaml from 'yaml'
3838
39-
const { java, keyOnly, filesOnly, showPrivate, label:labelProp } = defineProps<{
39+
const { java, keyOnly, filesOnly, showPrivate, label:labelProp, keyDelim } = defineProps<{
4040
java?: boolean,
4141
keyOnly?: boolean,
4242
filesOnly?: boolean,
4343
showPrivate?: boolean,
44-
label?: string
44+
label?: string,
45+
keyDelim?: string
4546
}>()
4647
4748
// sub component that renders code blocks similar to the markdown `::: code-block` syntax
@@ -85,6 +86,7 @@
8586
8687
const [key, val] = slotVal.split(/\s*[:=]\s*(.*)/) // split on first `:` or `=`
8788
const label = labelProp || `${keyOnly ? key: slotVal}`
89+
const keyDel = keyDelim ?? '.'
8890
8991
const cfgKey = ref()
9092
const popperVisible = ref(false)
@@ -114,25 +116,25 @@
114116
115117
let jsonVal
116118
if (typeof value === 'string' && value.trim().match(/^[[{].*[\]}]$/)) { try { jsonVal = JSON.parse(value) } catch {/*ignore*/ } }
117-
const pkg = toJson(key, jsonVal ?? value)
119+
const pkg = toJson(key, jsonVal ?? value, keyDel)
118120
119121
pkgStr.value = JSON.stringify(pkg, null, 2)
120122
rcJsonStr.value = JSON.stringify(pkg.cds??{}, null, 2)
121123
rcJsStr.value = 'module.exports = ' + rcJsonStr.value.replace(/"(\w*?)":/g, '$1:')
122124
rcYmlStr.value = yaml.stringify(pkg.cds)
123-
propStr.value = `${key}=${jsonVal ? JSON.stringify(jsonVal) : value}`
124125
125-
let envKey = key.replaceAll('_', '__').replaceAll('.', '_')
126+
let envKey = key.replaceAll('_', '__').replaceAll(keyDel, '_')
126127
if (/^[a-z_]+$/.test(envKey)) envKey = envKey.toUpperCase() // only uppercase if not camelCase
127128
envStr.value = `${envKey}=${jsonVal ? JSON.stringify(jsonVal) : value}`
129+
propStr.value = `${envKey}=${jsonVal ? JSON.stringify(jsonVal) : value}`
128130
129131
javaAppyml.value = yaml.stringify(pkg)
130132
javaEnvStr.value = `-D${propStr.value}`
131133
})
132134
133-
function toJson(key:string, value:string): Record<string, any> {
135+
function toJson(key:string, value:string, delim:string): Record<string, any> {
134136
let res = {}
135-
const parts = key.split('.')
137+
const parts = key.split(delim)
136138
parts.reduce((r:Record<string,any>, a, i) => {
137139
r[a] = r[a] || (i < parts.length-1 ? {} : value)
138140
return r[a];

.vitepress/theme/styles.scss

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ main {
115115
// Custom list styles for nested items
116116
ul {
117117
list-style-type: disc; // First level: filled circle
118-
118+
119119
ul {
120120
list-style-type: circle; // Second level: empty circle
121-
122-
121+
122+
123123
ul {
124124
list-style-type: square; // Third level: square
125125
}
@@ -551,15 +551,14 @@ html.node {
551551
pre.log:focus {
552552
min-width: fit-content;
553553
padding-right: 40px;
554-
z-index: 1; // draw over outline
554+
z-index: 1; position: relative; // draw over outline
555555
}
556556
table:hover,
557557
table:focus {
558558
min-width: fit-content;
559559
}
560-
tr { // make wide rows go over outline, not below it
561-
z-index: 1;
562-
position: relative;
560+
tr {
561+
z-index: 1; position: relative; // draw wide rows over outline
563562
}
564563
[class*='language-'] pre {
565564
overflow: hidden !important;

cds/cdl.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The *Conceptual Definition Language (CDL)* is a human-readable language for defi
4141

4242
```cds
4343
namespace capire.bookshop;
44-
using { managed, cuid } from `@sap/cds/common`;
44+
using { managed, cuid } from '@sap/cds/common';
4545
aspect primary : managed, cuid {}
4646
4747
entity Books : primary {
@@ -85,7 +85,7 @@ The following literals can be used in CDL (mostly as in JavaScript, Java, and SQ
8585
<!-- cds-mode: ignore; values only, no valid CDS file -->
8686
```cds
8787
true , false , null // as in all common languages
88-
11 , 2.4 , 1e3, 1.23e-11 // for numbers
88+
11 , 2.4 , 1e3 , 1.23e-11 // for numbers
8989
'A string''s literal' // for strings
9090
`A string\n paragraph` // for strings with escape sequences
9191
{ foo:'boo', bar:'car' } // for records
@@ -130,6 +130,10 @@ entity DocumentedEntity {
130130
}
131131
```
132132

133+
::: tip
134+
These annotations are illustrative only and are not defined nor have any meaning beyond this example.
135+
:::
136+
133137
Within those strings, escape sequences from JavaScript, such as `\t` or `\u0020`, are supported. Line endings are normalized. If you don't want a line ending at that position, end a line with a backslash (`\`). For string literals inside triple backticks, indentation is stripped and tagging is possible.
134138

135139

@@ -238,7 +242,7 @@ context scoped {
238242

239243
You can define types and entities with other definitions' names as prefixes:
240244

241-
```cds
245+
```cds [prefixes.cds]
242246
namespace foo.bar;
243247
entity Foo {} //> foo.bar.Foo
244248
entity Foo.Bar {} //> foo.bar.Foo.Bar
@@ -248,7 +252,7 @@ type Foo.Bar.Car {} //> foo.bar.Foo.Bar.Car
248252

249253
#### Fully Qualified Names
250254

251-
A model ultimately is a collection of definitions with unique, fully qualified names. For example, the second model above would compile to this [CSN](./csn):
255+
A model ultimately is a collection of definitions with unique, fully qualified names. For example, the model in `contexts.cds` would compile to the following [CSN](./csn):
252256

253257
::: code-group
254258

cds/types.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ These types are used to define the structure of entities and services, and are m
3636
| `Decimal` (`prec`, `scale`) | A *decfloat* type is used if arguments are omitted | _DECIMAL_ |
3737
| `Double` | Floating point with binary mantissa | _DOUBLE_ |
3838
| `Date` | e.g. `2022-12-31` | _DATE_ |
39-
| `Time` | e.g. `24:59:59` | _TIME_ |
39+
| `Time` | e.g. `23:59:59` | _TIME_ |
4040
| `DateTime` | _sec_ precision | _TIMESTAMP_ |
4141
| `Timestamp` | _µs_ precision, with up to 7 fractional digits | _TIMESTAMP_ |
4242
| `String` (`length`) | Default *length*: 255; on HANA: 5000 <sup>(4)(5)</sup> | _NVARCHAR_ |
@@ -46,8 +46,6 @@ These types are used to define the structure of entities and services, and are m
4646
| `Map` | Mapped to *NCLOB* for HANA. | *JSON* type |
4747
| `Vector` (`dimension `) | Requires SAP HANA Cloud QRC 1/2024, or later | _REAL_VECTOR_ |
4848

49-
These types are used to define the structure of entities and services, and are mapped to respective database types when the model is deployed.
50-
5149
> <sup>(1)</sup> Concrete mappings to specific databases may differ.
5250
>
5351
> <sup>(2)</sup> See also [Best Practices](../guides/domain-modeling#don-t-interpret-uuids).

java/cqn-services/persistence-services.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ CAP Java SDK is tested on [PostgreSQL](https://www.postgresql.org/) 15 and suppo
5050

5151
1. No locale specific sorting. The sort order of queries behaves as configured on the database.
5252
2. Write operations through CDS views are only supported for views that can be [resolved](../working-with-cql/query-execution#updatable-views) or are [updatable](https://www.postgresql.org/docs/14/sql-createview.html#SQL-CREATEVIEW-UPDATABLE-VIEWS) in PostgreSQL.
53-
3. The CDS type `UInt8` can't be used with PostgreSQL, as there's no `TINYINT`. Use `Int16` instead.
54-
4. [Multitenancy](../../guides/multitenancy/) and [extensibility](../../guides/extensibility/) aren't yet supported on PostgreSQL.
53+
3. [Multitenancy](../../guides/multitenancy/) and [extensibility](../../guides/extensibility/) aren't yet supported on PostgreSQL.
5554

5655
### H2 Database
5756

@@ -62,8 +61,7 @@ CAP Java SDK is tested on [PostgreSQL](https://www.postgresql.org/) 15 and suppo
6261
3. By default, views aren't updatable on H2. However, the CAP Java SDK supports some views to be updatable as described [here](../working-with-cql/query-execution#updatable-views).
6362
4. Although referential and foreign key constraints are supported, H2 [doesn't support deferred checking](https://www.h2database.com/html/grammar.html#referential_action). As a consequence, schema SQL is never generated with referential constraints.
6463
5. In [pessimistic locking](../working-with-cql/query-execution#pessimistic-locking), _shared_ locks are not supported but an _exclusive_ lock is used instead.
65-
6. The CDS type `UInt8` can't be used with H2, as there is no `TINYINT`. Use `Int16` instead.
66-
7. For regular expressions, H2's implementation is compatible with Java's: the matching behaviour is an equivalent of the `Matcher.find()` call for the given pattern.
64+
6. For regular expressions, H2's implementation is compatible with Java's: the matching behaviour is an equivalent of the `Matcher.find()` call for the given pattern.
6765

6866
::: warning
6967
Support for localized and temporal data via session context variables requires H2 v2.2.x or later.

package-lock.json

Lines changed: 37 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)