Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"[production]": {
"kind": "postgres"
},
"[pg!]": {
"[development]": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

"kind": "postgres",
"credentials": {
"host": "localhost",
Expand All @@ -55,6 +55,12 @@
"password": "postgres",
"database": "postgres"
}
},
"[pg]": {
"kind": "postgres"
},
"[postgres]": {
"kind": "postgres"
}
},
"postgres": {
Expand Down