Skip to content

Commit f7a1ffe

Browse files
authored
Add key atribute to cds.Decimal (#106)
Signed-off-by: Simon Heimler <simon.heimler@sap.com>
1 parent fa1db7b commit f7a1ffe

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ For a roadmap including expected timeline, please refer to [ROADMAP.md](./ROADMA
1010

1111
## [unreleased]
1212

13+
### Added
14+
15+
- Allow `cds.Decimal` to be used as a key, indicated via `key` boolean
16+
1317
## [1.0.6]
1418

1519
### Added

spec/v1/CSN-Interop-Effective.schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ definitions:
838838
const: cds.Decimal
839839
description: The modeling artefact is a `cds.Decimal` type.
840840
tsType: DecimalCdsType
841-
# key: *elementKey
841+
key: *elementKey
842842
notNull: *elementNotNull
843843
doc: *doc
844844
default:

src/generated/spec-v1/schemas/csn-interop-effective.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,10 @@
18241824
"description": "The modeling artefact is a `cds.Decimal` type.",
18251825
"tsType": "DecimalCdsType"
18261826
},
1827+
"key": {
1828+
"type": "boolean",
1829+
"description": "Indicates that this element is used as a primary key.\nMultiple primary keys MAY be used in case of a composite ID.\n\nElements marked as `key` also imply `notNull: true`."
1830+
},
18271831
"notNull": {
18281832
"type": "boolean",
18291833
"description": "Indicates that this element does not accept NULL values, which means that you cannot insert or update a record without adding a value to this field.\n\nElements marked as `key: true` also imply `notNull: true`."

src/generated/spec-v1/types/csn-interop-effective.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,13 @@ export interface DecimalType {
14411441
* The modeling artefact is a `cds.Decimal` type.
14421442
*/
14431443
type: DecimalCdsType;
1444+
/**
1445+
* Indicates that this element is used as a primary key.
1446+
* Multiple primary keys MAY be used in case of a composite ID.
1447+
*
1448+
* Elements marked as `key` also imply `notNull: true`.
1449+
*/
1450+
key?: boolean;
14441451
/**
14451452
* Indicates that this element does not accept NULL values, which means that you cannot insert or update a record without adding a value to this field.
14461453
*

0 commit comments

Comments
 (0)