FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(postgresql): add MERGE support by taua-almeida · Pull Request #4517 · sqlc-dev/sqlc · GitHub

/ sqlc Public

feat(postgresql): add MERGE support - #4517

Open
taua-almeida wants to merge 3 commits into
sqlc-dev:mainfrom
taua-almeida:feat/postgresql-merge-support
Open

feat(postgresql): add MERGE support#4517
taua-almeida wants to merge 3 commits into
sqlc-dev:mainfrom
taua-almeida:feat/postgresql-merge-support

Conversation

Copy link
Copy Markdown

Summary

  • add PostgreSQL MERGE parsing, AST traversal, formatting, analysis, and code-generation support
  • infer parameters across source queries, join conditions, WHEN conditions, updates, and inserts
  • support RETURNING, including source-before-target star expansion, NOT MATCHED BY SOURCE nullability, and typed merge_action()
  • add documentation and end-to-end coverage for database/sql, pgx/v4, and pgx/v5

Fixes #2272

Test plan

  • go test ./internal/compiler ./internal/engine/postgresql ./internal/sql/...
  • MERGE end-to-end replay tests
  • MERGE and UPDATE formatter round-trip tests
  • go test ./... -run '^$'
  • git diff --check
  • make build-endtoend
  • full go test ./... using PostgreSQL 16.14 for base and managed-db contexts

MERGE ... RETURNING, merge_action(), and NOT MATCHED BY SOURCE fixtures remain base-only because those features require PostgreSQL 17 or later.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add MERGE INTO support

1 participant


Back | FazBrowse Home | New Git URL