Skip to content

Make LLM agent upgrade to pgx v5#109

Open
meoyawn wants to merge 17 commits into
jschaf:mainfrom
meoyawn:meoyawn/pgxv5
Open

Make LLM agent upgrade to pgx v5#109
meoyawn wants to merge 17 commits into
jschaf:mainfrom
meoyawn:meoyawn/pgxv5

Conversation

@meoyawn

@meoyawn meoyawn commented May 6, 2026

Copy link
Copy Markdown

blocker: #108

building upon: #99

prompt:

we're finishing work started in https://github.com/jschaf/pggen/pull/99 (study PR and comments thorougly)

goal:
- `make lint` passes
- `make update-acceptance-test` passes (should not update anything because no `*.sql` is changed)
- `make test` passes

gpt-5.5-xhigh output:

• Completed PR #99 cleanup.

  Changed:

  - Restored declarer emission and removed old q.types / pgx v4 transcoder paths.
  - Switched generated queries to pgx v5 collection helpers, with db tags for RowToStructByName.
  - Added pgx v5 RegisterTypes generation for custom enum/composite/array types, including quoted type names and retry ordering.
  - Updated known pgx v5 type mappings and regenerated acceptance outputs.
  - Fixed void-result scanning and pgx v5 test expectations.

  Verified:

  - make lint passes.
  - make update-acceptance-test passes.
  - Final update run produced no additional git status change.
  - git diff --name-only | rg '\.sql$' found no changed .sql files.
  - make test passes.

  Goal marked complete. Final goal time used: 1766 seconds.

jschaf and others added 13 commits January 4, 2024 22:24
- For pggen row structs, implement pgx.RowScanner.
- Remove the typeResolver, since we're punting type resolution to the pgx.Conn
  type map for now.

jschaf#74
# Conflicts:
#	example/composite/query.sql_test.go
#	example/custom_types/query.sql_test.go
#	example/device/query.sql_test.go
#	example/enums/query.sql_test.go
#	example/erp/order/customer.sql_test.go
#	example/inline_param_count/inline0/query.sql_test.go
#	example/inline_param_count/inline1/query.sql_test.go
#	example/inline_param_count/inline2/query.sql_test.go
#	example/inline_param_count/inline3/query.sql_test.go
#	example/ltree/query.sql_test.go
#	generate.go
#	go.mod
#	go.sum
#	internal/codegen/golang/gotype/known_types.go
#	internal/codegen/golang/templater.go
#	internal/pg/column.go
#	internal/pg/column_test.go
#	internal/pg/known_types.go
#	internal/pg/type_cache.go
#	internal/pg/type_fetcher.go
#	internal/pg/types.go
#	internal/pgdocker/pgdocker.go
#	internal/pginfer/pginfer.go
#	internal/pgplan/pgplan.go
#	internal/pgtest/pg_test_db.go

@meoyawn meoyawn left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README still documents the pgx v4 custom-type flow (pgtype.BinaryDecoder, pgtype.TextDecoder, ConnInfo.RegisterDataType, pgx v4 pool links). This PR now generates RegisterTypes(ctx, *pgx.Conn) and uses pgx/v5, so docs need updating before merge.

Comment thread internal/codegen/golang/templated_file.go Outdated
Comment thread internal/codegen/golang/templated_file.go Outdated
Comment thread internal/codegen/golang/query.gotemplate Outdated
Comment thread example/void/query.sql.go Outdated
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.

2 participants