Repository navigation
Conversation
The command only needs text-format results, so pgx.Conn and its pgtype type registry are unnecessary. Rows are now decoded from the server's text form: ints, floats, bools, bytea and date/time types map to Go types as before; all other types keep the canonical Postgres text. This also fixes output for types pgx decoded into internal structs: json/jsonb rendered as Go maps (and a jsonb string broke JSON output), numeric/uuid/time/interval/arrays/point rendered as struct dumps. Stripped linux/amd64 release build: 55,840,928 -> 53,047,456 bytes (-2.79 MB). Co-authored-by: Isaac <no-reply@databricks.com>
- Decode date/timestamp/timestamptz with pgtype's own text scanners so years above 9999, BC dates and the timestamptz location match the previous pgx.Conn behavior. - Strip pgx-only options (statement_cache_capacity, ...) that a PGSERVICE file may set; pgconn would send them to the server. - Decode non-UTF-8 JSON instead of passing raw bytes to the output. - Decode bytea without an extra copy; defer ResultReader.Close. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: d8a0fc9
Top 6 slowest tests (at least 2 minutes):
|
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.
Changes
Switch from
pgx.Conntopgconn.PgConnand decode rows from the server's text format: ints, floats, bools, bytea and date/time types map to Go types as before; all other types are printed as Postgres' canonical text.Why
Binary size: pgx's
pgtyperegistry costs 2.8 MB (55.8 MB → 53.0 MB, stripped linux/amd64 release build). It also fixes output for types pgx decoded into internal structs: json/jsonb rendered as Go maps (a jsonb string broke--output json), and numeric, uuid, time, interval, arrays and point rendered as struct dumps.Tests
Unit and acceptance tests, plus a throwaway differential test against a fake pgwire server: every value that rendered correctly before renders identically. Not yet tested against a real Lakebase instance.
This pull request and its description were written by Isaac.