Commit 5f89eb2
feat(postgresql): Add star expander for SELECT * and RETURNING *
Adds a new expander package that expands * expressions in SQL queries
to explicit column names by preparing the query against a PostgreSQL
database.
Features:
- Expands SELECT * to explicit column list
- Preserves table prefix for qualified stars (e.g., table.*)
- Handles RETURNING * in INSERT/UPDATE/DELETE statements
- Recursively expands CTEs, including dependent CTEs
- Supports subqueries in FROM clause
- Works with both cgo (pganalyze/pg_query_go) and non-cgo
(wasilibs/go-pgquery) builds
Example:
SELECT * FROM authors
→ SELECT id, name, bio FROM authors
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ebd32cf commit 5f89eb2
4 files changed
Lines changed: 739 additions & 0 deletions
File tree
- internal/engine/postgresql/expander
0 commit comments