@sap/cds-dk 10.0.7 → 10.1.1
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.
- package/CHANGELOG.md +106 -0
- package/bin/add.js +7 -23
- package/bin/bind.js +14 -0
- package/bin/build.js +21 -34
- package/bin/cds.js +1 -1
- package/bin/compile/index.js +16 -41
- package/bin/completion/completionFs.js +11 -8
- package/bin/completion/index.js +603 -80
- package/bin/completion/scripts/cds.fish +620 -0
- package/bin/completion/scripts/cds.ps1 +403 -0
- package/bin/completion/scripts/cds.sh +327 -0
- package/bin/completion/scripts/cds.zsh +296 -0
- package/bin/completion/templates/cds-tmpl.fish +65 -0
- package/bin/completion/templates/cds-tmpl.ps1 +217 -0
- package/bin/completion/templates/cds-tmpl.sh +93 -0
- package/bin/completion/templates/cds-tmpl.zsh +74 -0
- package/bin/deploy/index.js +11 -1
- package/bin/deploy/options.js +25 -0
- package/{lib → bin}/deploy/to-hana/hana.js +8 -8
- package/{lib → bin}/deploy/to-hana/hdiDeployUtil.js +1 -1
- package/bin/deploy/{to-hana.js → to-hana/index.js} +1 -1
- package/{lib → bin}/deploy/to-hana/mtaUtil.js +1 -1
- package/bin/deploy/to-sql.js +0 -2
- package/bin/env.js +4 -1
- package/bin/export.js +44 -6
- package/bin/help/export.md +3 -0
- package/bin/help.js +1 -5
- package/bin/import.js +9 -0
- package/bin/init.js +6 -24
- package/bin/inspect.js +8 -0
- package/bin/lint.js +5 -3
- package/bin/login.js +26 -20
- package/bin/minify.js +6 -1
- package/bin/pull.js +19 -6
- package/bin/push.js +19 -6
- package/bin/repl.js +11 -2
- package/bin/run.js +12 -1
- package/bin/serve.js +13 -2
- package/bin/up.js +17 -11
- package/{lib → bin}/upgrade/constants.js +1 -1
- package/bin/{upgrade.js → upgrade/index.js} +2 -2
- package/{lib → bin}/upgrade/preflight/consistency.js +1 -1
- package/{lib → bin}/upgrade/preflight/index.js +1 -1
- package/{lib → bin}/upgrade/steps/analyze/index.js +1 -1
- package/{lib → bin}/upgrade/steps/install.js +1 -1
- package/{lib → bin}/upgrade/steps/openrewrite.js +1 -1
- package/{lib → bin}/upgrade/steps/removals.js +1 -1
- package/{lib → bin}/upgrade/steps/rewrite.js +1 -1
- package/{lib → bin}/upgrade/steps/verify.js +1 -1
- package/{lib/upgrade/index.js → bin/upgrade/upgrade.js} +2 -2
- package/{lib → bin}/upgrade/util/pom.js +2 -2
- package/{lib → bin}/upgrade/util/prompt.js +1 -1
- package/bin/util/containerize.js +10 -4
- package/bin/version.js +10 -1
- package/{lib → bin}/watch/hot-reload.js +1 -1
- package/bin/{watch.js → watch/index.js} +24 -9
- package/{lib → bin}/watch/livereload-connect.js +1 -1
- package/{lib → bin}/watch/vite-watch.js +1 -1
- package/{lib → bin}/watch/watched.js +2 -2
- package/lib/build/constants.js +1 -1
- package/lib/build/plugins/fiori/index.js +31 -2
- package/lib/build/plugins/internal.js +4 -2
- package/lib/build/plugins/mtx-sidecar/index.js +7 -8
- package/lib/build/plugins/nodejs/index.js +64 -7
- package/lib/build/util.js +2 -4
- package/lib/compile/to_asyncapi.js +1 -1
- package/lib/env/schema.js +16 -0
- package/lib/env/schemas/cds-rc.js +1 -76
- package/lib/import/importapi.js +2 -3
- package/lib/import/message.js +0 -2
- package/lib/init/constants.js +2 -1
- package/lib/init/index.js +2 -2
- package/lib/init/merge.js +123 -280
- package/lib/init/plugin.js +3 -1
- package/lib/init/projectReader.js +22 -6
- package/lib/init/registries/xs-app.js +3 -5
- package/lib/init/template/ai/files/mta.yaml.hbs +1 -1
- package/lib/init/template/ai/index.js +14 -2
- package/lib/init/template/ams/index.js +2 -2
- package/lib/init/template/app-frontend/files/containerize.yaml.hbs +2 -2
- package/lib/init/template/app-frontend/index.js +4 -4
- package/lib/init/template/application-logging/index.js +2 -2
- package/lib/init/template/approuter/files/package.json +1 -1
- package/lib/init/template/approuter/index.js +8 -3
- package/lib/init/template/attachments/files/package.json.hbs +1 -1
- package/lib/init/template/attachments/index.js +2 -2
- package/lib/init/template/audit-logging/index.js +2 -2
- package/lib/init/template/cloud-logging/files/package.json.hbs +4 -4
- package/lib/init/template/cloud-logging/index.js +2 -2
- package/lib/init/template/completion/completionSetup.js +36 -39
- package/lib/init/template/connectivity/index.js +2 -2
- package/lib/init/template/data/as-csv.js +15 -5
- package/lib/init/template/data/as-json.js +117 -42
- package/lib/init/template/data/index.js +16 -2
- package/lib/init/template/destination/index.js +2 -2
- package/lib/init/template/dynatrace/files/package.json.hbs +3 -3
- package/lib/init/template/dynatrace/index.js +2 -2
- package/lib/init/template/enterprise-messaging/index.js +2 -2
- package/lib/init/template/enterprise-messaging-shared/index.js +2 -2
- package/lib/init/template/extensibility/files/mta.yaml.hbs +11 -0
- package/lib/init/template/extensibility/files/xs-security.json.hbs +1 -1
- package/lib/init/template/extensibility/index.js +3 -3
- package/lib/init/template/github-actions/index.js +2 -2
- package/lib/init/template/hana/index.js +3 -2
- package/lib/init/template/hana-serverless/files/db/package.json +14 -0
- package/lib/init/template/hana-serverless/files/identity.values.yaml.hbs +10 -0
- package/lib/init/template/hana-serverless/files/mta.yaml.hbs +64 -0
- package/lib/init/template/hana-serverless/files/package.json.hbs +35 -0
- package/lib/init/template/hana-serverless/files/src/.hdiconfig +139 -0
- package/lib/init/template/hana-serverless/files/undeploy.json +7 -0
- package/lib/init/template/hana-serverless/files/values.yaml.hbs +18 -0
- package/lib/init/template/hana-serverless/index.js +184 -0
- package/lib/init/template/html5-repo/files/containerize.yaml.hbs +2 -2
- package/lib/init/template/html5-repo/files/mta.yaml.hbs +5 -0
- package/lib/init/template/html5-repo/index.js +18 -14
- package/lib/init/template/http/index.js +123 -26
- package/lib/init/template/ias/index.js +2 -2
- package/lib/init/template/kafka/index.js +2 -2
- package/lib/init/template/kyma/index.js +7 -5
- package/lib/init/template/malware-scanner/index.js +2 -2
- package/lib/init/template/mta/files/mta.yaml.hbs +1 -1
- package/lib/init/template/multitenancy/index.js +18 -3
- package/lib/init/template/notifications/index.js +2 -2
- package/lib/init/template/portal/files/mta.yaml.hbs +4 -0
- package/lib/init/template/portal/index.js +13 -8
- package/lib/init/template/postgres/index.js +2 -2
- package/lib/init/template/redis/index.js +2 -2
- package/lib/init/template/sample/files/db/currencies.cds +2 -0
- package/lib/init/template/sample/files/db/data/sap.capire.bookshop-Authors.csv +1 -1
- package/lib/init/template/tiny-sample/files/nodejs/db/data/CatalogService.Books.csv +2 -2
- package/lib/init/template/workzone-standard/index.js +5 -5
- package/lib/init/template/xsuaa/index.js +20 -2
- package/lib/lint/eslintHelp.json +1 -1
- package/lib/mtx/auth_manager.js +103 -37
- package/lib/mtx/params.js +3 -2
- package/lib/mtx/settings_manager.js +45 -28
- package/lib/mtx/tenant_action.js +0 -1
- package/lib/mtx/util/credentials.js +62 -0
- package/node_modules/@cap-js/db-service/CHANGELOG.md +17 -0
- package/node_modules/@cap-js/db-service/lib/common/generic-pool.js +4 -7
- package/node_modules/@cap-js/db-service/lib/cqn2pql.js +1 -1
- package/node_modules/@cap-js/db-service/lib/cqn2sql.js +15 -11
- package/node_modules/@cap-js/db-service/lib/cqn4sql.js +119 -19
- package/node_modules/@cap-js/db-service/lib/infer/index.js +27 -16
- package/node_modules/@cap-js/db-service/lib/recursion-guard.js +40 -0
- package/node_modules/@cap-js/db-service/lib/search.js +1 -1
- package/node_modules/@cap-js/db-service/package.json +1 -1
- package/node_modules/@cap-js/sqlite/CHANGELOG.md +19 -0
- package/node_modules/@cap-js/sqlite/lib/SQLiteService.js +110 -14
- package/node_modules/@cap-js/sqlite/package.json +3 -3
- package/node_modules/@sap/cds/CHANGELOG.md +57 -0
- package/node_modules/@sap/cds/app/index.js +5 -4
- package/node_modules/@sap/cds/eslint.config.mjs +1 -0
- package/node_modules/@sap/cds/lib/compile/minify.js +14 -10
- package/node_modules/@sap/cds/lib/env/cds-env.js +1 -1
- package/node_modules/@sap/cds/lib/env/cds-requires.js +22 -11
- package/node_modules/@sap/cds/lib/env/defaults.js +4 -1
- package/node_modules/@sap/cds/lib/env/schemas/cds-rc.js +5 -2
- package/node_modules/@sap/cds/lib/plugins.js +9 -5
- package/node_modules/@sap/cds/lib/req/spawn.js +1 -1
- package/node_modules/@sap/cds/lib/srv/srv-dispatch.js +1 -1
- package/node_modules/@sap/cds/lib/srv/srv-models.js +1 -1
- package/node_modules/@sap/cds/lib/utils/cds-utils.js +2 -1
- package/node_modules/@sap/cds/libx/_runtime/common/generic/assert.js +2 -3
- package/node_modules/@sap/cds/libx/_runtime/common/generic/auth/restrict.js +8 -1
- package/node_modules/@sap/cds/libx/_runtime/common/generic/crud.js +18 -8
- package/node_modules/@sap/cds/libx/_runtime/fiori/lean-draft.js +25 -17
- package/node_modules/@sap/cds/libx/_runtime/messaging/enterprise-messaging-utils/registerEndpoints.js +9 -3
- package/node_modules/@sap/cds/libx/_runtime/remote/Service.js +4 -19
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/LruCache.js +42 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/client.js +14 -4
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/cloudSdkProvider.js +2 -9
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/destinationClient.js +150 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/error.js +13 -0
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/fetchClient.js +26 -18
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/query.js +34 -23
- package/node_modules/@sap/cds/libx/_runtime/remote/utils/token.js +82 -0
- package/node_modules/@sap/cds/libx/_runtime/ucl/Service.js +36 -189
- package/node_modules/@sap/cds/libx/common/utils/streaming.js +16 -16
- package/node_modules/@sap/cds/libx/http/location.js +3 -3
- package/node_modules/@sap/cds/libx/odata/middleware/batch.js +16 -10
- package/node_modules/@sap/cds/libx/odata/middleware/metadata.js +9 -6
- package/node_modules/@sap/cds/libx/odata/middleware/service-document.js +1 -1
- package/node_modules/@sap/cds/libx/odata/parse/afterburner.js +19 -3
- package/node_modules/@sap/cds/libx/odata/parse/cqn2odata.js +83 -86
- package/node_modules/@sap/cds/libx/queue/SchedulingService.js +17 -2
- package/node_modules/@sap/cds/libx/queue/processing.js +1 -3
- package/node_modules/@sap/cds/libx/rest/RestAdapter.js +3 -7
- package/node_modules/@sap/cds/libx/rest/middleware/delete.js +3 -3
- package/node_modules/@sap/cds/libx/rest/middleware/parse.js +13 -8
- package/node_modules/@sap/cds/libx/rest/middleware/read.js +3 -3
- package/node_modules/@sap/cds/libx/rest/middleware/upsert.js +2 -2
- package/node_modules/@sap/cds/package.json +1 -1
- package/node_modules/@sap/cds-compiler/CHANGELOG.md +75 -8
- package/node_modules/@sap/cds-compiler/bin/cdsc.js +2 -2
- package/node_modules/@sap/cds-compiler/doc/IncompatibleChanges_v7.md +46 -19
- package/node_modules/@sap/cds-compiler/lib/api/main.js +10 -7
- package/node_modules/@sap/cds-compiler/lib/api/options.js +8 -2
- package/node_modules/@sap/cds-compiler/lib/base/csnRefs.js +5 -2
- package/node_modules/@sap/cds-compiler/lib/base/message-registry.js +4 -0
- package/node_modules/@sap/cds-compiler/lib/base/optionProcessor.js +12 -0
- package/node_modules/@sap/cds-compiler/lib/checks/enricher.js +1 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/assert-consistency.js +8 -7
- package/node_modules/@sap/cds-compiler/lib/compiler/checks.js +3 -3
- package/node_modules/@sap/cds-compiler/lib/compiler/define.js +301 -75
- package/node_modules/@sap/cds-compiler/lib/compiler/dictionaries.js +2 -0
- package/node_modules/@sap/cds-compiler/lib/compiler/extend.js +40 -26
- package/node_modules/@sap/cds-compiler/lib/compiler/populate.js +45 -60
- package/node_modules/@sap/cds-compiler/lib/compiler/propagator.js +16 -7
- package/node_modules/@sap/cds-compiler/lib/compiler/resolve.js +48 -18
- package/node_modules/@sap/cds-compiler/lib/compiler/shared.js +7 -6
- package/node_modules/@sap/cds-compiler/lib/compiler/tweak-assocs.js +62 -50
- package/node_modules/@sap/cds-compiler/lib/compiler/utils.js +29 -14
- package/node_modules/@sap/cds-compiler/lib/edm/edmAnnoPreprocessor.js +6 -5
- package/node_modules/@sap/cds-compiler/lib/gen/CdlGrammar.checksum +1 -1
- package/node_modules/@sap/cds-compiler/lib/gen/CdlParser.js +1119 -1109
- package/node_modules/@sap/cds-compiler/lib/gen/Dictionary.json +19 -3
- package/node_modules/@sap/cds-compiler/lib/json/from-csn.js +10 -16
- package/node_modules/@sap/cds-compiler/lib/json/to-csn.js +58 -39
- package/node_modules/@sap/cds-compiler/lib/main.d.ts +8 -0
- package/node_modules/@sap/cds-compiler/lib/main.js +1 -0
- package/node_modules/@sap/cds-compiler/lib/model/csnUtils.js +4 -0
- package/node_modules/@sap/cds-compiler/lib/parsers/AstBuildingParser.js +2 -1
- package/node_modules/@sap/cds-compiler/lib/parsers/XprTree.js +8 -0
- package/node_modules/@sap/cds-compiler/lib/render/toCdl.js +22 -1
- package/node_modules/@sap/cds-compiler/lib/render/toSql.js +17 -2
- package/node_modules/@sap/cds-compiler/lib/render/utils/common.js +6 -1
- package/node_modules/@sap/cds-compiler/lib/render/utils/operators.js +27 -0
- package/node_modules/@sap/cds-compiler/lib/render/utils/standardDatabaseFunctions.js +125 -3
- package/node_modules/@sap/cds-compiler/lib/tool-lib/revealInternalProperties.js +2 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/applyTransformations.js +15 -0
- package/node_modules/@sap/cds-compiler/lib/transform/db/associations.js +10 -2
- package/node_modules/@sap/cds-compiler/lib/transform/db/backlinks.js +22 -6
- package/node_modules/@sap/cds-compiler/lib/transform/db/constraints.js +62 -1
- package/node_modules/@sap/cds-compiler/lib/transform/db/flattening.js +4 -3
- package/node_modules/@sap/cds-compiler/lib/transform/effective/annotations.js +40 -0
- package/node_modules/@sap/cds-compiler/lib/transform/effective/flattening.js +17 -1
- package/node_modules/@sap/cds-compiler/lib/transform/effective/main.js +20 -0
- package/node_modules/@sap/cds-compiler/lib/transform/fioriTreeViews.js +12 -1
- package/node_modules/@sap/cds-compiler/lib/transform/forRelationalDB.js +7 -2
- package/node_modules/@sap/cds-compiler/lib/transform/odata/adaptAnnotationRefs.js +11 -5
- package/node_modules/@sap/cds-compiler/lib/transform/translateAssocsToJoins.js +48 -10
- package/node_modules/@sap/cds-compiler/package.json +1 -1
- package/node_modules/@sap/cds-mtxs/CHANGELOG.md +49 -0
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx-migrate.js +26 -5
- package/node_modules/@sap/cds-mtxs/bin/cds-mtx.js +37 -16
- package/node_modules/@sap/cds-mtxs/lib/utils.js +23 -7
- package/node_modules/@sap/cds-mtxs/package.json +1 -1
- package/node_modules/@sap/cds-mtxs/srv/cf/abstract-provisioning-service.js +63 -8
- package/node_modules/@sap/cds-mtxs/srv/cf/saas-provisioning-service.js +1 -1
- package/node_modules/@sap/cds-mtxs/srv/cf/sms-provisioning-service.js +23 -3
- package/node_modules/@sap/cds-mtxs/srv/extensibility/compat/update.js +15 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/annotations.js +2 -2
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/config.js +2 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/index.js +2 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/protected-namespace.js +45 -0
- package/node_modules/@sap/cds-mtxs/srv/extensibility-service.js +30 -16
- package/node_modules/@sap/cds-mtxs/srv/jobs-service.js +49 -10
- package/node_modules/@sap/cds-mtxs/srv/model-provider.js +28 -4
- package/node_modules/@sap/cds-mtxs/srv/plugins/common.js +19 -12
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/ctnr-mgr-base.js +1 -1
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi-ctnr-mgr.js +6 -3
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana/serverless.js +271 -0
- package/node_modules/@sap/cds-mtxs/srv/plugins/hana.js +7 -10
- package/node_modules/@sap/cds-mtxs/srv/worker/job-worker-pool.js +212 -0
- package/node_modules/@sap/cds-mtxs/srv/worker/job-worker.js +61 -0
- package/node_modules/@sap/xsenv/CHANGELOG.md +7 -0
- package/node_modules/@sap/xsenv/package.json +10 -7
- package/node_modules/body-parser/node_modules/content-type/README.md +2 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/body-parser/node_modules/content-type/package.json +1 -1
- package/node_modules/hdb/cfg/VERSION +1 -1
- package/node_modules/hdb/lib/protocol/ClientInfo.js +16 -3
- package/node_modules/hdb/lib/protocol/Connection.js +1 -0
- package/node_modules/hdb/package.json +3 -2
- package/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/negotiator/lib/charset.js +10 -34
- package/node_modules/negotiator/lib/encoding.js +9 -30
- package/node_modules/negotiator/lib/language.js +15 -36
- package/node_modules/negotiator/lib/mediaType.js +16 -134
- package/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
- package/node_modules/negotiator/node_modules/content-type/README.md +71 -0
- package/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/negotiator/node_modules/content-type/package.json +52 -0
- package/node_modules/negotiator/package.json +16 -10
- package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
- package/node_modules/qs/CHANGELOG.md +15 -0
- package/node_modules/qs/README.md +19 -1
- package/node_modules/qs/dist/qs.js +21 -21
- package/node_modules/qs/eslint.config.mjs +1 -1
- package/node_modules/qs/lib/parse.js +3 -4
- package/node_modules/qs/lib/stringify.js +23 -8
- package/node_modules/qs/lib/utils.js +10 -3
- package/node_modules/qs/package.json +4 -4
- package/node_modules/qs/test/parse.js +192 -3
- package/node_modules/qs/test/stringify.js +317 -0
- package/node_modules/qs/test/utils.js +12 -0
- package/node_modules/type-is/node_modules/content-type/README.md +2 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/type-is/node_modules/content-type/package.json +1 -1
- package/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/ws/package.json +1 -1
- package/package.json +2 -2
- package/bin/completion/scripts/cds-bash.sh +0 -20
- package/bin/completion/scripts/cds-fish.fish +0 -13
- package/bin/completion/scripts/cds-ps.ps1 +0 -19
- package/bin/completion/scripts/cds-zsh.sh +0 -13
- package/lib/deploy/index.js +0 -25
- package/lib/import/asyncapi/importAsyncAPI.js +0 -33
- package/lib/import/asyncapi/index.js +0 -18
- package/lib/import/asyncapi/parserContext.js +0 -454
- package/lib/import/asyncapi/utils.js +0 -49
- package/node_modules/@sap/cds/libx/_runtime/ucl/queries.js +0 -61
- package/node_modules/negotiator/HISTORY.md +0 -114
- /package/{lib → bin}/upgrade/context.js +0 -0
- /package/{lib → bin}/upgrade/migrations/cds10/migrations.json +0 -0
- /package/{lib → bin}/upgrade/preflight/cds-version.js +0 -0
- /package/{lib → bin}/upgrade/preflight/project-type.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/classification.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/detector.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/evaluator.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/reporter.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/setup.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/utils/detection.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/utils/files.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/utils/grep.js +0 -0
- /package/{lib → bin}/upgrade/steps/analyze/utils/yaml.js +0 -0
- /package/{lib → bin}/upgrade/util/workspaces.js +0 -0
- /package/{lib → bin}/watch/esm-resolve-registration.js +0 -0
- /package/{lib → bin}/watch/livereload-server.js +0 -0
- /package/{lib → bin}/watch/node-watch.js +0 -0
- /package/{lib → bin}/watch/open.js +0 -0
- /package/{lib → bin}/watch/watcher.js +0 -0
- /package/node_modules/@sap/cds-mtxs/srv/worker/{pool.js → model-worker-pool.js} +0 -0
- /package/node_modules/@sap/cds-mtxs/srv/worker/{load.js → model-worker.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Incompatible Changes in CDS Compiler Version 7
|
|
2
2
|
|
|
3
3
|
This document lists (potentially) incompatible changes
|
|
4
|
-
which came with Compiler Version 7.
|
|
4
|
+
which came with Compiler Version 7, including the fixes of Version 7.0.2.
|
|
5
5
|
|
|
6
6
|
<!-- toc: start -->
|
|
7
7
|
|
|
@@ -17,15 +17,16 @@ which came with Compiler Version 7.
|
|
|
17
17
|
1. [name-deprecated-$self](#name-deprecated-self)
|
|
18
18
|
2. [String representation for expression-like annotation values](#string-representation-for-expression-like-annotation-values)
|
|
19
19
|
3. [Default for structures](#default-for-structures)
|
|
20
|
-
4. [Default for arrays
|
|
20
|
+
4. [Default for arrays](#default-for-arrays)
|
|
21
21
|
5. [Extend builtin with type properties](#extend-builtin-with-type-properties)
|
|
22
|
-
6. [Key propagation](#key-propagation)
|
|
23
|
-
7. [
|
|
24
|
-
8. [
|
|
25
|
-
9. [
|
|
26
|
-
10. [
|
|
27
|
-
11. [
|
|
28
|
-
12. [
|
|
22
|
+
6. [Key propagation in projections](#key-propagation-in-projections)
|
|
23
|
+
7. [Key propagation for types](#key-propagation-for-types)
|
|
24
|
+
8. [Annotate with invalid target](#annotate-with-invalid-target)
|
|
25
|
+
9. [Duplicate element via extend with aspect](#duplicate-element-via-extend-with-aspect)
|
|
26
|
+
10. [Extend ... with definitions](#extend--with-definitions)
|
|
27
|
+
11. [Propagate value null](#propagate-value-null)
|
|
28
|
+
12. [Expression as UP TO value](#expression-as-up-to-value)
|
|
29
|
+
13. [Associations defined via backlink associations](#associations-defined-via-backlink-associations)
|
|
29
30
|
6. [Changes in OData/EDM](#changes-in-odataedm)
|
|
30
31
|
1. [Vocabulary change for Common.SideEffectsType](#vocabulary-change-for-commonsideeffectstype)
|
|
31
32
|
7. [Changes in to.sql()](#changes-in-tosql)
|
|
@@ -53,7 +54,7 @@ Such changes always have a reason, and we don't introduce them "just for the sak
|
|
|
53
54
|
| Default for structures | 2 | low |
|
|
54
55
|
| Default for arrays | 2 | low |
|
|
55
56
|
| Extend builtin with type properties | 2 | very low |
|
|
56
|
-
| Key propagation | 3
|
|
57
|
+
| Key propagation | 3+4 | medium |
|
|
57
58
|
| Sec-Annotate with invalid target | 2 | high |
|
|
58
59
|
| Duplicate elem by extend w/ aspect | 2 | low |
|
|
59
60
|
| Extend ... with definitions | 4 | zero |
|
|
@@ -136,7 +137,7 @@ It was ...
|
|
|
136
137
|
|
|
137
138
|
The error could be downgraded with
|
|
138
139
|
```sh
|
|
139
|
-
cdsc
|
|
140
|
+
cdsc <file> --warn syntax-unsupported-masked --deprecated downgradableErrors
|
|
140
141
|
```
|
|
141
142
|
|
|
142
143
|
In cds-compiler v7:
|
|
@@ -195,7 +196,7 @@ entity E {
|
|
|
195
196
|
a : Integer;
|
|
196
197
|
b : Integer;
|
|
197
198
|
}
|
|
198
|
-
entity P as projection on E { a as x, b as y};
|
|
199
|
+
entity P as projection on E { a as x, b as y };
|
|
199
200
|
```
|
|
200
201
|
Resulting CSN:
|
|
201
202
|
```jsonc
|
|
@@ -334,9 +335,9 @@ the compiler throws configurable errors for these situations.
|
|
|
334
335
|
Planned to make non-configurable in v8.
|
|
335
336
|
|
|
336
337
|
|
|
337
|
-
### Key propagation
|
|
338
|
+
### Key propagation in projections
|
|
338
339
|
|
|
339
|
-
Before cds-compiler v7:
|
|
340
|
+
Before cds-compiler v7 or when the v7 option `v6KeyPropagation` is set with truthy value:
|
|
340
341
|
A view or projection inherits the key of the underlying base entity, if ...
|
|
341
342
|
* no explicit key is set in the query
|
|
342
343
|
* all key elements of the primary base entity are selected
|
|
@@ -346,25 +347,51 @@ A view or projection inherits the key of the underlying base entity, if ...
|
|
|
346
347
|
(key = the entirety of the key elements)
|
|
347
348
|
|
|
348
349
|
Essentially this means: we propagate the key only in situations
|
|
349
|
-
where we are (almost) sure that the result is a valid key.
|
|
350
|
+
where we are (almost) sure that the result is a valid key. This was the intention, but
|
|
350
351
|
a path with a to-many association isn't recognized inside an expression.
|
|
351
352
|
|
|
352
353
|
These rules are unnecessarily complex.
|
|
353
354
|
|
|
354
|
-
In cds-compiler v7:
|
|
355
|
+
In cds-compiler v7 or when the v6.9 option `v7KeyPropagation` is set with truthy value:
|
|
355
356
|
Simplify rules: a view or projection inherits the key of the
|
|
356
357
|
underlying base entity, if ...
|
|
357
358
|
* no explicit key is set in the query
|
|
358
359
|
* all key elements of the primary base entity and all key elements of joined
|
|
359
360
|
entities are selected
|
|
360
361
|
|
|
361
|
-
Note: second rule is very strict, as
|
|
362
|
+
Note: second rule is very strict, as often not all key elements of the target need
|
|
362
363
|
to be selected because they are tied to a key element of the source via the ON condition.
|
|
363
364
|
In these situations no key is propagated and we basically have the same situation as before v7.
|
|
364
365
|
|
|
365
366
|
This change means:
|
|
366
|
-
we would propagate the key also in
|
|
367
|
-
result is a valid key.
|
|
367
|
+
we would propagate the key also in situations where we are not sure the
|
|
368
|
+
result is a valid key, e.g. with a union query.
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
### Key propagation for types
|
|
372
|
+
|
|
373
|
+
An element of an entity can be key with implications for the compiler-calculated foreign keys
|
|
374
|
+
of an association, SQL constraints in the OData protocol, ….
|
|
375
|
+
|
|
376
|
+
Inconsistencies arise when a _sub element_ of an entity is declared to be a key,
|
|
377
|
+
especially if structure flattening comes into play.
|
|
378
|
+
Thus, the compiler issues a warning for `key` on a sub element, and for `key` inside a structured type.
|
|
379
|
+
|
|
380
|
+
Before cds-compiler v7 or when the v7 option `v6KeyPropagation` is set with truthy value:
|
|
381
|
+
|
|
382
|
+
* an element in a structure type doesn't inherit the key of the underlying base element
|
|
383
|
+
if the structure type is a derived type (`type D: T`) or is defined via `projection on`,
|
|
384
|
+
* an element in a structure type _does inherit_ the key of the underlying base element
|
|
385
|
+
if the structure type includes a structure.
|
|
386
|
+
|
|
387
|
+
In cds-compiler v7 or when the v6.9 option `v7KeyPropagation` is set with truthy value:
|
|
388
|
+
|
|
389
|
+
* an element in a structure type _never inherits_ the key of an underlying base element.
|
|
390
|
+
|
|
391
|
+
This way, key sub elements (with their inconsistencies) only arise
|
|
392
|
+
with dubious user-provided element definitions, never for compiler-inferred elements.
|
|
393
|
+
|
|
394
|
+
Users who use a type basically as include should consider using an aspect instead.
|
|
368
395
|
|
|
369
396
|
|
|
370
397
|
### Annotate with invalid target
|
|
@@ -522,6 +522,16 @@ function sqlMigration( csn, options, messageFunctions, beforeImage ) {
|
|
|
522
522
|
}, {}),
|
|
523
523
|
};
|
|
524
524
|
|
|
525
|
+
// Sort before the loop below sets `@cds.persistence.skip=true`
|
|
526
|
+
// on unchanged artifacts as a `toSqlDdl` suppression hint; `sortViews`
|
|
527
|
+
// does not process non-persisted entities
|
|
528
|
+
const sortOrder = sortViews({ sql: {}, csn: afterImage });
|
|
529
|
+
|
|
530
|
+
const dependentsDict = {};
|
|
531
|
+
sortOrder.forEach(({ name, dependents }) => {
|
|
532
|
+
dependentsDict[name] = dependents;
|
|
533
|
+
});
|
|
534
|
+
|
|
525
535
|
const markedSkipByUs = {};
|
|
526
536
|
const cleanup = [];
|
|
527
537
|
// Delete artifacts that are already present in csn
|
|
@@ -548,13 +558,6 @@ function sqlMigration( csn, options, messageFunctions, beforeImage ) {
|
|
|
548
558
|
});
|
|
549
559
|
}
|
|
550
560
|
|
|
551
|
-
const sortOrder = sortViews({ sql: {}, csn: afterImage });
|
|
552
|
-
|
|
553
|
-
const dependentsDict = {};
|
|
554
|
-
sortOrder.forEach(({ name, dependents }) => {
|
|
555
|
-
dependentsDict[name] = dependents;
|
|
556
|
-
});
|
|
557
|
-
|
|
558
561
|
const stack = Object.keys(drops.creates);
|
|
559
562
|
while (stack.length > 0) {
|
|
560
563
|
const name = stack.pop();
|
|
@@ -37,12 +37,15 @@ const publicOptionsNewAPI = [
|
|
|
37
37
|
'magicVars', // deprecated, not removed in v3 as we have specific error messages for it
|
|
38
38
|
'variableReplacements',
|
|
39
39
|
'pre2134ReferentialConstraintNames',
|
|
40
|
+
'draftAdminDataConstraints',
|
|
40
41
|
'betterSqliteSessionVariables',
|
|
41
42
|
'decimal_affinity',
|
|
42
43
|
'withHanaAssociations',
|
|
43
44
|
'standardDatabaseFunctions',
|
|
44
45
|
'booleanEquality',
|
|
45
46
|
'dollarNowAsTimestamp',
|
|
47
|
+
'vectorEmbeddingDefaultModel',
|
|
48
|
+
'vectorEmbeddingHanaDefaultRemoteSource',
|
|
46
49
|
// ODATA
|
|
47
50
|
'odataOpenapiHints',
|
|
48
51
|
'edm4OpenAPI',
|
|
@@ -68,6 +71,7 @@ const publicOptionsNewAPI = [
|
|
|
68
71
|
// for.effective
|
|
69
72
|
'resolveSimpleTypes',
|
|
70
73
|
'resolveProjections',
|
|
74
|
+
'stringifyAnnoXpr',
|
|
71
75
|
'remapOdataAnnotations',
|
|
72
76
|
'keepLocalized',
|
|
73
77
|
'effectiveServiceName',
|
|
@@ -190,6 +194,7 @@ module.exports = {
|
|
|
190
194
|
booleanEquality: true,
|
|
191
195
|
dollarNowAsTimestamp: false,
|
|
192
196
|
decimal_affinity: 'real',
|
|
197
|
+
draftAdminDataConstraints: false,
|
|
193
198
|
};
|
|
194
199
|
const processed = translateOptions(options, defaultOptions, hardOptions, {}, [ 'sql-dialect-and-naming' ], 'to.sql');
|
|
195
200
|
|
|
@@ -204,6 +209,7 @@ module.exports = {
|
|
|
204
209
|
withHanaAssociations: false,
|
|
205
210
|
booleanEquality: true,
|
|
206
211
|
dollarNowAsTimestamp: false,
|
|
212
|
+
draftAdminDataConstraints: false,
|
|
207
213
|
};
|
|
208
214
|
return translateOptions(options, defaultOptions, hardOptions, { sqlDialect: generateStringValidator([ 'hana' ]) }, undefined, 'to.hdi');
|
|
209
215
|
},
|
|
@@ -241,7 +247,7 @@ module.exports = {
|
|
|
241
247
|
effective: (options) => {
|
|
242
248
|
const hardOptions = { addCdsPersistenceName: false, deriveAnalyticalAnnotations: false };
|
|
243
249
|
const defaultOptions = {
|
|
244
|
-
sqlMapping: 'plain', resolveSimpleTypes: true, resolveProjections: true, remapOdataAnnotations: false, keepLocalized: false,
|
|
250
|
+
sqlMapping: 'plain', resolveSimpleTypes: true, resolveProjections: true, stringifyAnnoXpr: false, remapOdataAnnotations: false, keepLocalized: false,
|
|
245
251
|
};
|
|
246
252
|
const processed = translateOptions(options, defaultOptions, hardOptions, null, [ 'sql-dialect-and-naming', 'effectiveServiceName-and-type-resolution' ], 'for.effective');
|
|
247
253
|
|
|
@@ -251,7 +257,7 @@ module.exports = {
|
|
|
251
257
|
const hardOptions = {
|
|
252
258
|
sqlMapping: 'plain', resolveSimpleTypes: true, resolveProjections: true, keepLocalized: false, addCdsPersistenceName: true,
|
|
253
259
|
};
|
|
254
|
-
const defaultOptions = { remapOdataAnnotations: true, deriveAnalyticalAnnotations: false };
|
|
260
|
+
const defaultOptions = { stringifyAnnoXpr: false, remapOdataAnnotations: true, deriveAnalyticalAnnotations: false };
|
|
255
261
|
const processed = translateOptions(options, defaultOptions, hardOptions, null, [ 'sql-dialect-and-naming' ], 'for.effective');
|
|
256
262
|
|
|
257
263
|
return Object.assign({}, processed);
|
|
@@ -244,6 +244,7 @@ const referenceSemantics = {
|
|
|
244
244
|
expand: { lexical: justDollar, dynamic: 'expand' }, // ...using baseEnv
|
|
245
245
|
inline: { lexical: justDollar, dynamic: 'inline' }, // ...using baseEnv
|
|
246
246
|
ref_where: { lexical: justDollar, dynamic: 'ref-target' }, // ...using baseEnv
|
|
247
|
+
from_where: { lexical: justDollar, dynamic: 'ref-target' }, // ...using baseEnv
|
|
247
248
|
on: { lexical: justDollar, dynamic: 'query' }, // assoc defs, redirected to
|
|
248
249
|
// there are also 'on_join' and 'on_mixin' with default semantics
|
|
249
250
|
$calc: { lexical: justDollar, dynamic: 'query' }, // calculation for draft
|
|
@@ -770,7 +771,9 @@ function csnRefs( csn, universalReady ) {
|
|
|
770
771
|
if (head.charAt(0) === '$') {
|
|
771
772
|
if (head !== '$self' && head !== '$projection')
|
|
772
773
|
return { scope: '$magic' };
|
|
773
|
-
|
|
774
|
+
// $self in filter of from -> TODO v8: disallow in core compiler?
|
|
775
|
+
const fcache = (refCtx === 'from_where' && qcache) ? qcache.$next : qcache;
|
|
776
|
+
const self = fcache && fcache.$queryNumber > 1 ? fcache._select : main;
|
|
774
777
|
return resolvePath( path, self, null, '$self' );
|
|
775
778
|
}
|
|
776
779
|
}
|
|
@@ -1131,7 +1134,7 @@ function analyseCsnPath( csnPath, csn, resolve ) {
|
|
|
1131
1134
|
else if (prop === 'where' && refCtx === 'ref') {
|
|
1132
1135
|
if (resolve)
|
|
1133
1136
|
baseEnv = resolve.ref_where( obj, baseRef, baseCtx, main, query, parent, baseEnv );
|
|
1134
|
-
refCtx = 'ref_where';
|
|
1137
|
+
refCtx = (baseCtx === 'from') ? 'from_where' : 'ref_where';
|
|
1135
1138
|
}
|
|
1136
1139
|
else if (prop === 'expand' || prop === 'inline') {
|
|
1137
1140
|
if (obj.ref) {
|
|
@@ -154,6 +154,7 @@ const centralMessages = {
|
|
|
154
154
|
|
|
155
155
|
'extend-repeated-intralayer': { severity: 'Warning' },
|
|
156
156
|
'extend-unrelated-layer': { severity: 'Info' },
|
|
157
|
+
'ext-unstable-order': { severity: 'Warning' },
|
|
157
158
|
|
|
158
159
|
'ext-duplicate-extend-type': { severity: 'Error' },
|
|
159
160
|
'ext-duplicate-extend-type-unrelated-layer': { severity: 'Error', configurableFor: true },
|
|
@@ -232,6 +233,7 @@ const centralMessages = {
|
|
|
232
233
|
'def-missing-virtual': { severity: 'Error', configurableFor: true },
|
|
233
234
|
'def-expected-structured': { severity: 'Error', configurableFor: true },
|
|
234
235
|
'def-unsupported-calc-elem': { severity: 'Error', configurableFor: true },
|
|
236
|
+
'def-unsupported-assoc': { severity: 'Warning' },
|
|
235
237
|
|
|
236
238
|
'def-invalid-key-cardinality': { severity: 'Error' },
|
|
237
239
|
|
|
@@ -550,6 +552,7 @@ const centralMessageTexts = {
|
|
|
550
552
|
'syntax-invalid-anno-struct': {
|
|
551
553
|
std: 'Objects with properties $(PROP) and $(SIBLINGPROP) are reserved for expressions and can\'t be used as structures',
|
|
552
554
|
xpr: 'Objects with $(PROP) as only property are reserved for expressions and can\'t be used as structures',
|
|
555
|
+
'...': 'Objects with $(PROP) as only property are reserved for appending arrays and can\'t be used as structures',
|
|
553
556
|
'#': 'Objects with a property $(PROP) are reserved for enum values and can\'t be used as structures',
|
|
554
557
|
ref: 'The value of property $(PROP) in structures must be a non-empty string',
|
|
555
558
|
},
|
|
@@ -584,6 +587,7 @@ const centralMessageTexts = {
|
|
|
584
587
|
},
|
|
585
588
|
'syntax-unexpected-sql-clause': {
|
|
586
589
|
std: 'Unexpected $(KEYWORD) clause for path filter',
|
|
590
|
+
one: '$(CODE) is supported only in standalone queries, not in CDS models',
|
|
587
591
|
},
|
|
588
592
|
|
|
589
593
|
// Syntax messages, CSN parser - default: Error ------------------------------
|
|
@@ -303,6 +303,7 @@ optionProcessor.command('Q, toSql')
|
|
|
303
303
|
.option(' --assert-integrity-type <type>', { valid: [ 'RT', 'DB' ], ignoreCase: true })
|
|
304
304
|
.option(' --constraints-in-create-table')
|
|
305
305
|
.option(' --pre2134ReferentialConstraintNames')
|
|
306
|
+
.option(' --draft-admin-data-constraints')
|
|
306
307
|
.option(' --disable-hana-comments')
|
|
307
308
|
.option(' --generated-by-comment')
|
|
308
309
|
.option(' --better-sqlite-session-variables <bool>')
|
|
@@ -359,6 +360,9 @@ optionProcessor.command('Q, toSql')
|
|
|
359
360
|
part of the "CREATE TABLE" statements rather than as separate
|
|
360
361
|
"ALTER TABLE ADD CONSTRAINT" statements
|
|
361
362
|
--pre2134ReferentialConstraintNames Do not prefix the constraint identifier with "c__"
|
|
363
|
+
--draft-admin-data-constraints Generate an "ON DELETE CASCADE" referential constraint on the
|
|
364
|
+
DraftAdministrativeData_DraftUUID foreign key of draft shadow
|
|
365
|
+
tables. Independent of assertIntegrity / assertIntegrityType.
|
|
362
366
|
--disable-hana-comments Disable rendering of doc comments as SAP HANA comments.
|
|
363
367
|
--generated-by-comment Enable rendering of the initial SQL comment for HDI-based artifacts
|
|
364
368
|
--better-sqlite-session-variables <bool>
|
|
@@ -540,6 +544,7 @@ optionProcessor.command('forEffective')
|
|
|
540
544
|
.option('-h, --help')
|
|
541
545
|
.option('--resolve-simple-types <val>', { valid: [ 'true', 'false' ] } )
|
|
542
546
|
.option('--resolve-projections <val>', { valid: [ 'true', 'false' ] } )
|
|
547
|
+
.option('--stringify-anno-xpr <val>', { valid: [ 'true', 'false' ] } )
|
|
543
548
|
.option('--remap-odata-annotations <val>', { valid: [ 'true', 'false' ] } )
|
|
544
549
|
.option('--keep-localized <val>', { valid: [ 'true', 'false' ] } )
|
|
545
550
|
.option('--effective-service-name <name>')
|
|
@@ -559,6 +564,9 @@ optionProcessor.command('forEffective')
|
|
|
559
564
|
--resolve-projections <val> Resolve projections:
|
|
560
565
|
true: (default) transform projections into ordinary views with SELECT
|
|
561
566
|
false: leave them as real projections
|
|
567
|
+
--stringify-anno-xpr <val> Stringify annotation expressions:
|
|
568
|
+
true: convert annotation expression nodes to CDL-like strings
|
|
569
|
+
false:(default) keep annotation expressions as structured CSN objects
|
|
562
570
|
--remap-odata-annotations <val> Remap OData annotations to ABAP annotations:
|
|
563
571
|
true: remap annotations
|
|
564
572
|
false:(default) leave them as is
|
|
@@ -570,6 +578,7 @@ optionProcessor.command('forEffective')
|
|
|
570
578
|
|
|
571
579
|
optionProcessor.command('forSeal')
|
|
572
580
|
.option('-h, --help')
|
|
581
|
+
.option('--stringify-anno-xpr <val>', { valid: [ 'true', 'false' ] } )
|
|
573
582
|
.option('--remap-odata-annotations <val>', { valid: [ 'true', 'false' ] } )
|
|
574
583
|
.option('--derive-analytical-annotations <val>', { valid: [ 'true', 'false' ] })
|
|
575
584
|
.positionalArgument('<files...>')
|
|
@@ -580,6 +589,9 @@ optionProcessor.command('forSeal')
|
|
|
580
589
|
|
|
581
590
|
Options
|
|
582
591
|
-h, --help Show this help text
|
|
592
|
+
--stringify-anno-xpr <val> Stringify annotation expressions:
|
|
593
|
+
true: convert annotation expression nodes to CDL-like strings
|
|
594
|
+
false:(default) keep annotation expressions as structured CSN objects
|
|
583
595
|
--remap-odata-annotations <val> Remap OData annotations to ABAP annotations:
|
|
584
596
|
true: (default) remap annotations
|
|
585
597
|
false: leave them as is
|
|
@@ -284,15 +284,15 @@ function assertConsistency( model, stage ) {
|
|
|
284
284
|
optional: [
|
|
285
285
|
'quantifier', 'orderBy', 'limit', 'name', '$parens', 'kind',
|
|
286
286
|
'_origin', '$contains', // TODO tmp, see TODO in getOriginRaw()
|
|
287
|
-
'_parent', '_main', '
|
|
287
|
+
'_parent', '_main', '_effectiveType', '$effectiveSeqNo', // in FROM
|
|
288
288
|
'$expand', '_$next', // parsing error: tableTerm with UNION on rhs.
|
|
289
289
|
],
|
|
290
290
|
},
|
|
291
291
|
select: { // sub query
|
|
292
292
|
requires: [ 'op', 'location', 'from' ],
|
|
293
293
|
optional: [
|
|
294
|
-
'name', '$parens', 'quantifier', 'mixin', 'excludingDict', 'columns', 'elements',
|
|
295
|
-
'$calcDepElement',
|
|
294
|
+
'name', '$parens', 'quantifier', 'one', 'mixin', 'excludingDict', 'columns', 'elements',
|
|
295
|
+
'_deps', '$calcDepElement',
|
|
296
296
|
'where', 'groupBy', 'having', 'orderBy', '$orderBy', 'limit', '$limit',
|
|
297
297
|
'_origin', '_block', '$contains',
|
|
298
298
|
'_projections', '_complexProjections',
|
|
@@ -311,7 +311,7 @@ function assertConsistency( model, stage ) {
|
|
|
311
311
|
'on', '$parens', 'cardinality',
|
|
312
312
|
'kind', 'name', '_block', '_parent', '_main', '_user',
|
|
313
313
|
'$tableAliases', '_combined', '_joinParent', '$joinArgsIndex',
|
|
314
|
-
'
|
|
314
|
+
'_$next', '_deps', '$expand',
|
|
315
315
|
],
|
|
316
316
|
},
|
|
317
317
|
ref: {
|
|
@@ -453,6 +453,7 @@ function assertConsistency( model, stage ) {
|
|
|
453
453
|
optional: [
|
|
454
454
|
'scope', 'variant', '_artifact', '_originalArtifact',
|
|
455
455
|
'$inferred', '$parens', 'sort', 'nulls', '$syntax',
|
|
456
|
+
'$extended', '_block', '_outer', // for where/having
|
|
456
457
|
],
|
|
457
458
|
},
|
|
458
459
|
none: { optional: () => true }, // parse error
|
|
@@ -479,6 +480,7 @@ function assertConsistency( model, stage ) {
|
|
|
479
480
|
'sort', 'nulls', // if used in GROUP BY
|
|
480
481
|
// `elements` of type is not put into cast, many will be cds.LargeString
|
|
481
482
|
...typeProperties, // for CAST
|
|
483
|
+
'$extended', '_block', '_outer', // for where/having
|
|
482
484
|
],
|
|
483
485
|
},
|
|
484
486
|
query: { requires: [ 'query', 'location' ], optional: [ 'stored', '$parens' ] },
|
|
@@ -570,6 +572,7 @@ function assertConsistency( model, stage ) {
|
|
|
570
572
|
virtual: { kind: true, test: locationVal() },
|
|
571
573
|
key: { kind: true, test: locationVal(), also: [ null, undefined ] },
|
|
572
574
|
notNull: { kind: true, test: locationVal() },
|
|
575
|
+
one: { kind: true, test: locationVal() },
|
|
573
576
|
includes: {
|
|
574
577
|
kind: true,
|
|
575
578
|
test: isArray(),
|
|
@@ -659,19 +662,17 @@ function assertConsistency( model, stage ) {
|
|
|
659
662
|
'_effectiveType', '$effectiveSeqNo', '$parens',
|
|
660
663
|
'_deps', '$calcDepElement', '$expand', '$contains',
|
|
661
664
|
// query specific
|
|
662
|
-
'where', 'columns', 'mixin', 'quantifier', 'offset',
|
|
665
|
+
'where', 'columns', 'mixin', 'quantifier', 'one', 'offset',
|
|
663
666
|
'orderBy', '$orderBy', 'groupBy', 'excludingDict', 'having',
|
|
664
667
|
'$limit', 'limit', '_status', '_origin',
|
|
665
668
|
// via casts
|
|
666
669
|
'enum',
|
|
667
670
|
],
|
|
668
671
|
},
|
|
669
|
-
_leadingQuery: { kind: true, test: TODO },
|
|
670
672
|
$replacement: { kind: true, test: TODO }, // for smart * in queries
|
|
671
673
|
_origin: { kind: true, test: TODO },
|
|
672
674
|
_calcOrigin: { kind: true, test: TODO },
|
|
673
675
|
_columnParent: { kind: [ 'element', undefined ], test: TODO }, // column or * (wildcard)
|
|
674
|
-
_from: { kind: true, test: TODO }, // TODO: not necessary anymore ?
|
|
675
676
|
// array of $tableAlias (or includes) for explicit and implicit redirection:
|
|
676
677
|
_redirected: { kind: true, test: TODO },
|
|
677
678
|
// ...array of table aliases for targets from orig to new
|
|
@@ -857,9 +857,9 @@ function check( model ) {
|
|
|
857
857
|
{ '#': 'struct-expr', elemref: xpr } );
|
|
858
858
|
}
|
|
859
859
|
else if (xpr._artifact.target !== undefined &&
|
|
860
|
-
(!lastStep.where ||
|
|
861
|
-
// Allow using an association _with
|
|
862
|
-
// calculated elements.
|
|
860
|
+
(!lastStep.where || isStored)) {
|
|
861
|
+
// Allow using an association _with a (possibly empty) filter_, but only
|
|
862
|
+
// for on-read calculated elements.
|
|
863
863
|
// TODO: Also allow bare unmanaged association references and remove beta.
|
|
864
864
|
const variant = (isStored && lastStep.where && 'assoc-stored') ||
|
|
865
865
|
(isComposition( model, xpr._artifact ) && 'expr-comp') ||
|