SAP-samples/cloud-cap-samples

Documentation cds compile --to cdl

andrew-barnard opened this issue · 3 comments

I notice that the documentation shown after entering cds compile ? does not list cdl as a target format for the -2 | --to option. --to cdl is however shown under in the examples section of the displayed help and does appear to produce a valid cdl when an appropriate csn file is provided.

In my use case, I was starting with an external edmx. I imported using cds import to produce csn, then used cds compile --to cds to generate a model definition. The external service was not available for consumption.

My current cds version information:

@sap/cds: 3.34.2
@sap/cds-compiler: 1.26.2
@sap/cds-dk: 1.8.4
@sap/cds-foss: 1.2.0
@sap/cds-reflect: 2.11.0
@sap/cds-runtime: 1.2.2
chgeo commented

Thanks for bringing this up. The sample help for the cdl transformation should actually not have shown up at all. Reason is that --to cdl renders way too technical stuff at the moment (e.g. HANA specifics). In the next major version it's actually not included anymore, until we have cleaned it up.

May I ask why you need it? Is it for making the imported service 'legible'?

Hi Christian,
Sorry for the delay in response - your message was hidden in a deluge of other github correspondence.
Why was using cds compile --to cdl? My primary objective was to take an external EDMX and use the entities and associations in it as a basis for a standalone application in CAP. The intention was not to consume the external service itself - the service wasn't available for consumption.
I imported the edmx with cds import to produce csn. Then used cds compile --to cdl to see the representation in cdl. From there it was quite easy to adapt the cdl to create a schema of the entities and define a whole lot of tailored services on top of these.
Andrew

cds compile -2 cdl was undocumented by intend, nobody should ever have used it / rely on its output.
It's actually not available in upcoming release