feat: provide postgres profile#1491
Conversation
this does the same as the already existing `pg` profile. People can provide their service credentials and just do a `cds deploy --profile postgres` which is symmetrical to the `cds deploy --profile sqlite`
| "credentials": { | ||
| "host": "localhost", | ||
| "port": 5432, | ||
| "user": "postgres", | ||
| "password": "postgres", | ||
| "database": "postgres" | ||
| } |
There was a problem hiding this comment.
These credentials could be moved into the postgres kind under the [development] profile. Then both pg and postgres can just be the kind: postgres ?
|
do we need the |
| "kind": "postgres" | ||
| }, | ||
| "[pg!]": { | ||
| "[development]": { |
There was a problem hiding this comment.
This makes Postgres the default for all non-production scenarios though. Might be intended, but we defaulted to SQLite before so this is an incompatible change.
It's then also doing this merge of SQLite and Postgres credentials for a new project:
cds init bookshop --add sample --nodejs && cd bookshop && cds add postgres && cds env requires.db:
{
impl: '@cap-js/sqlite',
credentials: {
url: ':memory:',
host: 'localhost',
port: 5432,
user: 'postgres',
password: 'postgres',
database: 'postgres'
},
data: [ 'db/data', 'db/csv', 'test/data' ],
pool: { max: 1 },
kind: 'sqlite'
}I propose instead you put the credentials under cds.requires.kinds.postgres, similar to how it's done in @cap-js/hana:
https://github.com/cap-js/cds-dbs/blob/main/hana/package.json#L58-L72
b99d378 to
756d43d
Compare
this does the same as the already existing
pgprofile. People can provide their service credentials and just do a
cds deploy --profile postgreswhich is symmetrical to thecds deploy --profile sqlitefor #1471