Skip to Content
0
Aug 08, 2023 at 04:38 PM

SAP CAP: Error: Can't execute query as no primary database is connected.

143 Views Last edit Aug 08, 2023 at 05:12 PM 2 rev

Greetings to all. I've a situation with a code of SAP CAP connected with postgres.

I show you the code.

schema.cds

image.png

annotations.cds

image.pngservices.cds

image.png

service.js

image.png

I want to enable the create button and I understand that I must use the @odata.draft.enabled but when I click on the button it shows me the following error message: "Can't execute query as no primary database is connected."

image.png

Does anyone have any idea why this is happening?

In the same way I leave attached my package.json and my .cdsrc.json

package.json

image.png

.cdsrc.json

image.png

Preview

image.png

Attachments

image.png (246.9 kB)
image.png (399.3 kB)
image.png (53.8 kB)
image.png (217.2 kB)
image.png (38.4 kB)
image.png (140.4 kB)
image.png (61.6 kB)
image.png (226.2 kB)