Skip to content

Comments

feat: add extra_float_digits query parameter to PgConnectOptions URI parser#4175

Open
veeceey wants to merge 1 commit intolaunchbadge:mainfrom
veeceey:fix/issue-501-pg-connect-uri-params
Open

feat: add extra_float_digits query parameter to PgConnectOptions URI parser#4175
veeceey wants to merge 1 commit intolaunchbadge:mainfrom
veeceey:fix/issue-501-pg-connect-uri-params

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 20, 2026

Summary

  • Adds support for parsing the extra_float_digits query parameter from PostgreSQL connection URIs (e.g., postgres://localhost?extra_float_digits=2)
  • Adds round-trip support in build_url() so the parameter is preserved when serializing options back to a URL
  • Adds tests for positive values, negative values, and a comprehensive multi-parameter parsing test

Closes #501

Context

Issue #501 noted that the PgConnectOptions URI parser did not support all query parameters. PR #705 added most of them (user, password, dbname, port, host, hostaddr, application_name, options), but extra_float_digits -- which controls floating-point precision in text mode -- was still missing. This PR completes the coverage by adding the last remaining struct field that was not configurable via URI.

Test plan

  • Unit test: parses extra_float_digits=2 from query parameter
  • Unit test: parses negative value extra_float_digits=-1
  • Unit test: parses multiple query parameters together (user, password, host, port, dbname, sslmode, application_name, extra_float_digits)
  • Existing round-trip tests updated and passing
  • All 20 parse tests pass (cargo test --package sqlx-postgres -- options::parse)

🤖 Generated with Claude Code

…tions URI parser

Add support for parsing the `extra_float_digits` query parameter from
PostgreSQL connection URIs, addressing the remaining gap in parameter
coverage noted in launchbadge#501. This allows users to configure floating-point
precision via connection strings like
`postgres://localhost?extra_float_digits=2`.

Also includes round-trip support in `build_url()` and comprehensive
tests for the new parameter.

Closes launchbadge#501

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More parameters/query pairs in the PgConnectOptions uri parser

1 participant