@sap/cds-compiler 6.4.6 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +34 -1156
  2. package/README.md +1 -10
  3. package/doc/IncompatibleChanges_v5.md +436 -0
  4. package/doc/IncompatibleChanges_v6.md +659 -0
  5. package/doc/Versioning.md +3 -7
  6. package/lib/api/main.js +1 -0
  7. package/lib/api/options.js +5 -0
  8. package/lib/api/validate.js +3 -0
  9. package/lib/base/message-registry.js +23 -0
  10. package/lib/base/messages.js +1 -1
  11. package/lib/base/model.js +3 -2
  12. package/lib/checks/actionsFunctions.js +6 -3
  13. package/lib/checks/existsInForbiddenPlaces.js +32 -0
  14. package/lib/checks/validator.js +2 -0
  15. package/lib/compiler/assert-consistency.js +3 -5
  16. package/lib/compiler/checks.js +4 -8
  17. package/lib/compiler/define.js +244 -459
  18. package/lib/compiler/extend.js +297 -11
  19. package/lib/compiler/finalize-parse-cdl.js +2 -10
  20. package/lib/compiler/generate.js +29 -1
  21. package/lib/compiler/populate.js +21 -63
  22. package/lib/compiler/propagator.js +1 -2
  23. package/lib/compiler/resolve.js +2 -12
  24. package/lib/compiler/shared.js +18 -5
  25. package/lib/compiler/tweak-assocs.js +13 -9
  26. package/lib/compiler/utils.js +97 -0
  27. package/lib/compiler/xpr-rewrite.js +2 -1
  28. package/lib/edm/annotations/edmJson.js +9 -6
  29. package/lib/edm/annotations/genericTranslation.js +8 -4
  30. package/lib/edm/csn2edm.js +3 -4
  31. package/lib/edm/edmInboundChecks.js +1 -2
  32. package/lib/edm/edmPreprocessor.js +3 -3
  33. package/lib/gen/CdlGrammar.checksum +1 -1
  34. package/lib/gen/CdlParser.js +1 -1
  35. package/lib/gen/Dictionary.json +16 -1
  36. package/lib/json/from-csn.js +4 -6
  37. package/lib/json/to-csn.js +3 -3
  38. package/lib/model/csnRefs.js +13 -4
  39. package/lib/model/enrichCsn.js +4 -2
  40. package/lib/optionProcessor.js +8 -4
  41. package/lib/render/utils/sql.js +3 -2
  42. package/lib/transform/db/applyTransformations.js +1 -1
  43. package/lib/transform/db/assertUnique.js +3 -3
  44. package/lib/transform/db/assocsToQueries/normalizeFrom.js +33 -0
  45. package/lib/transform/db/assocsToQueries/transformExists.js +14 -3
  46. package/lib/transform/db/assocsToQueries/utils.js +1 -1
  47. package/lib/transform/db/backlinks.js +4 -4
  48. package/lib/transform/db/cdsPersistence.js +4 -4
  49. package/lib/transform/db/constraints.js +4 -4
  50. package/lib/transform/db/expansion.js +5 -5
  51. package/lib/transform/db/flattening.js +4 -5
  52. package/lib/transform/db/rewriteCalculatedElements.js +3 -3
  53. package/lib/transform/db/temporal.js +11 -11
  54. package/lib/transform/draft/db.js +2 -0
  55. package/lib/transform/draft/odata.js +5 -7
  56. package/lib/transform/effective/flattening.js +1 -2
  57. package/lib/transform/forOdata.js +3 -3
  58. package/lib/transform/forRelationalDB.js +1 -1
  59. package/lib/transform/odata/createForeignKeys.js +1 -2
  60. package/lib/transform/odata/flattening.js +1 -2
  61. package/lib/transform/odata/toFinalBaseType.js +52 -55
  62. package/lib/transform/transformUtils.js +3 -4
  63. package/package.json +1 -1
  64. package/doc/CHANGELOG_BETA.md +0 -464
  65. package/doc/CHANGELOG_DEPRECATED.md +0 -235
@@ -1,235 +0,0 @@
1
- # ChangeLog of deprecated features for CDS compiler and backends
2
-
3
- <!-- markdownlint-disable MD024 -->
4
- <!-- (no-duplicate-heading)-->
5
-
6
- Note: `deprecated` features are listed in this ChangeLog just for information.
7
- `deprecated` features will be removed after a certain grace period.
8
-
9
- **Use `deprecated` features only transitional in productive mode.**
10
-
11
- **When the `deprecated` option is set, the `beta` option is ignored,
12
- and several new features are not available.**
13
-
14
- ## Version 6.0.8 - 2025-05-23
15
-
16
- ### Added `noQuasiVirtualAssocs`
17
-
18
- If set, managed to-many associations will get foreign keys again.
19
- In cds-compiler v6, managed to-many associations without explicit foreign keys
20
- don't get `keys` anymore. This flag restores v5 behavior.
21
-
22
- ### Added `noCompositionIncludes`
23
-
24
- If set, generated entities for composition-of-named-aspect will not
25
- get an `includes` property.
26
-
27
- ### Added `noPersistenceJournalForGeneratedEntities`
28
-
29
- If set, `@cds.persistence.journal` will _not_ be propagated to generated entities,
30
- including generated `.texts` entities for localized entities, nor generated entities
31
- for compositions-of-aspect.
32
-
33
- In cds-compiler v6, this annotation is copied to `.texts` entities as well as
34
- generated composition-of-aspect entities it by default.
35
-
36
- ### Removed `includesNonShadowedFirst`
37
-
38
- ### Removed `eagerPersistenceForGeneratedEntities`
39
-
40
- ### Removed `noKeyPropagationWithExpansions`
41
-
42
-
43
- ## Version 4.2.0 - 2023-08-29
44
-
45
- ### Added `noKeyPropagationWithExpansions`
46
-
47
- When this option is set, element `id` in types `Orig` and `I` are keys,
48
- but `id` in `D` is not.
49
-
50
- ```cds
51
- type Orig { key id: Integer };
52
- type I: Orig {};
53
- type D: Orig;
54
- ```
55
-
56
- When this option is not set, element `id` in all three types are keys.
57
-
58
- ## Version 4.0.0 - 2023-06-06
59
-
60
- ### Added `downgradableErrors`
61
-
62
- Allow to change the severity of some errors which are meant to stay errors in v4.
63
-
64
- ### Added `includesNonShadowedFirst`
65
-
66
- Use this flag to keep adding elements from included definitions first, example:
67
-
68
- ```cds
69
- entity A { one: Integer; two: String(10); three: Integer; }
70
- entity E : A { two: String(12); }
71
- // v3: one, three, two
72
- // v4: one, two, three
73
- ```
74
-
75
- ### Added `ignoreSpecifiedQueryElements`
76
-
77
- Use this flag if you want to ignore a query's `elements`, except for annotations and doc comments.
78
- cds-compiler v3 and earlier simply ignored a query element except for its annotations.
79
- cds-compiler v4 resolves the element's type.
80
-
81
- ### Removed `autoCorrectOrderBySourceRefs`
82
-
83
- Instead of this deprecated flag, you can downgrade error message `ref-deprecated-orderby`.
84
-
85
-
86
- ## Version 3.1.0 - 2022-08-04
87
-
88
- ### Added `autoCorrectOrderBySourceRefs`
89
-
90
- When this option is set, calling `compile` autocorrects direct `order by`
91
- source element references without table alias for SELECT queries by adding the
92
- table alias to the `ref`.
93
-
94
- Using this option might lead to surprising results when elements are added to
95
- existing models: `order by` specifications might change their semantics without
96
- any extra messages.
97
-
98
- ## Version 3.0.0 - 2022-06-23
99
-
100
- Version 3 of the cds-compiler removes all v2 deprecated flags.
101
-
102
- ### Add `eagerPersistenceForGeneratedEntities`
103
-
104
- If enabled, the old behavior regarding `@cds.persistence.skip` and `@cds.persistence.exists`
105
- is restored, i.e. these annotations are not copied from parent to generated child entities, nor
106
- is `@cds.persistence.exists` copied to localized convenience views.
107
-
108
- ### Removed `createLocalizedViews`
109
-
110
- ### Removed `downgradableErrors`
111
-
112
- ### Removed `generatedEntityNameWithUnderscore`
113
-
114
- ### Removed `longAutoexposed`
115
-
116
- ### Removed `noElementsExpansion`
117
-
118
- <!-- fully removed with 3.1.0 -->
119
-
120
- ### Removed `noInheritedAutoexposeViaComposition`
121
-
122
- ### Removed `noScopedRedirections`
123
-
124
- ### Removed `oldVirtualNotNullPropagation`
125
-
126
- ### Removed `parensAsStrings`
127
-
128
- <!-- fully removed with 3.5.0 -->
129
-
130
- ### Removed `projectionAsQuery`
131
-
132
- ### Removed `redirectInSubQueries`
133
-
134
- ### Removed `renderVirtualElements`
135
-
136
- ### Removed `shortAutoexposed`
137
-
138
- ### Removed `unmanagedUpInComponent`
139
-
140
- ### Removed `v1KeysForTemporal`
141
-
142
- ## Version 2.13.0 - 2022-03-22
143
-
144
- ### Added `redirectInSubQueries`
145
-
146
- When this option is set, we auto-redirect associations and composition also in
147
- non-main queries, sometimes without rewriting the `keys`/`on` (there will be no
148
- fix for this).
149
-
150
- ### Added `oldVirtualNotNullPropagation`
151
-
152
- When this option is set, we do not propagate `notNull` along types.
153
- Additionally, we propagate `notNull` and `virtual` from a query source element
154
- to the sub elements of a query entity element, even if the property is not
155
- propagated to the query entity element itself (like with type references).
156
-
157
-
158
- ## Version 2.2.0
159
-
160
- ### Added `noScopedRedirections`
161
-
162
- When this option is set, the definition scope is not taken into account when
163
- trying to find an implicit redirection target. Setting the following
164
- deprecated options also switches off scoped redirections (additionally to their
165
- other effect): `noElementsExpansion`, `generatedEntityNameWithUnderscore`,
166
- `shortAutoexposed`, `longAutoexposed`, `noInheritedAutoexposeViaComposition`.
167
-
168
- ### Added `noInheritedAutoexposeViaComposition`
169
-
170
- When this option is set, only entities directly specified after `Composition of` are
171
- auto-exposed, not entities used as target via explicit or implicit `redirected to`.
172
-
173
- ## Version 2.0.16
174
-
175
- ### Added `downgradableErrors`
176
-
177
- Allow to change the severity of some errors which should stay to be an error.
178
-
179
- ### Added `shortAutoexposed`
180
-
181
- When this option is set (and `generatedEntityNameWithUnderscore`), the names of
182
- autoexposed entities are calculated according to the default compiler v1
183
- behavior (without v1 options `dependentAutoexposed` and `longAutoexposed`).
184
-
185
- ## Version 2.0.10
186
-
187
- ### Added `longAutoexposed`
188
-
189
- When this option is set (and `generatedEntityNameWithUnderscore`),
190
- the names of auto-exposed entities are calculated according to the
191
- compiler v1 option `longAutoexposed`.
192
-
193
- ### Added `generatedEntityNameWithUnderscore`
194
-
195
- Keep using `_` is separator for generated auto-exposed entities and for entities
196
- created for managed compositions. It also disables a definition `A.B.C` if `A`
197
- or `A.B` is a definition other than a context or service (v1 behavior).
198
-
199
- ## Version 2.0.4-ms1
200
-
201
- ### Added `createLocalizedViews`
202
-
203
- Add localized convenience views in `for.odata`.
204
-
205
- ### Added `unmanagedUpInComponent`
206
-
207
- Render association `up_` in composition component unmanaged.
208
-
209
- ## Version 2.0.2-ms1
210
-
211
- ### Added `renderVirtualElements`
212
-
213
- Virtual elements are no longer rendered in views as `null as <id>` or added to potentially generated
214
- draft tables. This behavior can be turned off with `renderVirtualElements` for backward compatibility.
215
-
216
- ### Added `parensAsStrings`
217
-
218
- Represent parentheses in expressions with `'('` and `')'` in `xpr` arrays
219
- instead of using nested `xpr`s or `list`.
220
-
221
- ### Added `v1KeysForTemporal`
222
-
223
- Render old and broken temporal EDM API.
224
-
225
- ### Added `noElementsExpansion`
226
-
227
- When setting it, association in sub elements are not automatically redirected,
228
- and the sub elements cannot be annotated individually.
229
-
230
- Do not use this. Setting it might avoid some compile errors,
231
- but in most cases the reported errors are rightly reported.
232
-
233
- ### Added `projectionAsQuery`
234
-
235
- Render `projection` as `query` in CSN.