dozer
dozer copied to clipboard
Postgres configuration specification is confusing
https://github.com/getdozer/dozer/blob/main/dozer-types/src/models/connection.rs#L94
PostgresConfig seems to take each field optionally. It should rather be two variations. Either you specify a URL or all mandatory fields specified.
Expected flow:
- when user specify
PostgresConfigwithconnection_urlwe only takes details from the url only
config: !Postgres
connection_url: postgres://postgres:postgres@localhost:5432/dozer
- if the
connection_urlis provided with other mandatory fields manually, we give out error sayingEither you specify connection URL or all mandatory fields.
config: !Postgres
connection_url: postgres://postgres:postgres@localhost:5432/dozer
user: postgres
- when user doesn't specify
connection_urlinPostgresConfig, we try taking details from other mandatory fields, if missing data, we give out error withMissing details for postgres connection config - <fields>
config: !Postgres
user: postgres
password: postgres
host: localhost
port: 5432
database: dozer
name: user