effect icon indicating copy to clipboard operation
effect copied to clipboard

Replace Postgres.js parsed options in `PgClient.config`

Open giacomoran opened this issue 1 year ago • 1 comments

Type

  • [ ] Refactor
  • [ ] Feature
  • [x] Bug Fix
  • [ ] Optimization
  • [ ] Documentation Update

Description

This PR replaces the connection-related values in PgClient.config with the corresponding values parsed by Postgres.js from the connection string (postgresql://postgres:[email protected]:5432/postgres) and the connection parameters ({ host: "127.0.0.1", port: "5432", ... }).

Currently, the connection string is ignored by the Migrator in @effect/sql-pg, only connection parameters are passed to pg_dump. This PR addresses the issue.

In Postgres.js values specified in the connection string are overwritten by connection parameters. In pg_dump values specified in the connection string overwrite connection parameters. This solutions ensures the Postgres.js and pg_dump connections are consistent, by using the values computed by Postgres.js for both tools.

giacomoran avatar May 20 '24 08:05 giacomoran

🦋 Changeset detected

Latest commit: 528dd8f8bc37f1a5069d10018c16bf765d4ef974

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@effect/sql-pg Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 20 '24 08:05 changeset-bot[bot]