-
Notifications
You must be signed in to change notification settings - Fork 22
Description
As described in the migration guide from cds-pg to @cap-js/postgres the
service binding label is postgresql-db
that means that if someone wants to use a PostgreSQL directly from a hyperscaler and does provides the credentials using a user provided service (UPS) the connection will not work out of the box. To make the connection work this additional entry in the package.json of the deployer and service module is needed:
"cds": {
"requires": {
"kinds": {
"postgres": {
"vcap": {
"label": "user-provided"
}
}
}
}
}
If instead tags would be used to to read credentials from VCAP_SERVICES it would be easier to get them from the UPS. Using the UPS configuration via mta.yaml it's possible to set tags:
service-tags: ["relational", "database"]
You can find a working in mta.yaml#L127. This tags mimic the tags that the PostgreSQL on SAP BTP, hyperscaler option creates in VCAP_SERVICES:
"tags": ["relational", "database"]
So I would suggest to read VCAP_SERVICES by the tag "database".