feat: add extra_float_digits query parameter to PgConnectOptions URI parser#4175
Open
veeceey wants to merge 1 commit intolaunchbadge:mainfrom
Open
feat: add extra_float_digits query parameter to PgConnectOptions URI parser#4175veeceey wants to merge 1 commit intolaunchbadge:mainfrom
veeceey wants to merge 1 commit intolaunchbadge:mainfrom
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extra_float_digitsquery parameter from PostgreSQL connection URIs (e.g.,postgres://localhost?extra_float_digits=2)build_url()so the parameter is preserved when serializing options back to a URLCloses #501
Context
Issue #501 noted that the
PgConnectOptionsURI parser did not support all query parameters. PR #705 added most of them (user,password,dbname,port,host,hostaddr,application_name,options), butextra_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
extra_float_digits=2from query parameterextra_float_digits=-1cargo test --package sqlx-postgres -- options::parse)🤖 Generated with Claude Code