Skip to content

feat: support qualified single-table select columns - #32

Closed
JagritGumber wants to merge 1 commit into
mainfrom
feat/qualified-select-support
Closed

feat: support qualified single-table select columns#32
JagritGumber wants to merge 1 commit into
mainfrom
feat/qualified-select-support

Conversation

@JagritGumber

@JagritGumber JagritGumber commented Apr 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • support able.column and able.column AS alias projections when they resolve against the inferred base table
  • keep multi-table qualified projections rejected with an explicit parse error
  • add parser and CLI regression coverage and update README query-boundary docs

Verification

  • cargo test
  • cargo clippy --all-targets --all-features -- -D warnings

Open with Devin

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

JagritGumber added a commit that referenced this pull request Apr 19, 2026
…solver

When a query contains the JOIN keyword, route each SELECT column through
the multi-table resolver from parser::joins (landed in the prior PR).
Qualified columns now resolve across the alias map and land in QueryDef.returns
with source_table populated.

Queries without JOIN keep the existing single-table path unchanged —
ensure_supported_select_expr still rejects qualified selects there.
Lifting that restriction for single-table queries is a separate effort
(PR #32 was in flight before this series).

Changes:
- resolve_return_columns gains a &[TableDef] schema_tables param
- JOIN_DETECT_RE gates multi-table resolution
- resolve_return_columns_multi_table rejects SELECT * across joins with
  a clear v1.2 pointer
- Parser propagates schema_tables from parse_queries to resolve_return_columns

Tests:
- 5 new postgres parser unit tests (qualified columns, AS aliases, SELECT *
  rejection, LEFT JOIN rejection, single-table rejection still active)
- Updated the cli test that was asserting the old rejection — it now
  asserts the JOIN query succeeds (renamed from cli_generate_rejects_
  qualified_selects to cli_generate_accepts_multi_table_inner_join)

158 lib + 11 CLI + 2 e2e + 4 typecheck tests all pass. Clippy clean.
JagritGumber added a commit that referenced this pull request Apr 20, 2026
…solver

When a query contains the JOIN keyword, route each SELECT column through
the multi-table resolver from parser::joins (landed in the prior PR).
Qualified columns now resolve across the alias map and land in QueryDef.returns
with source_table populated.

Queries without JOIN keep the existing single-table path unchanged —
ensure_supported_select_expr still rejects qualified selects there.
Lifting that restriction for single-table queries is a separate effort
(PR #32 was in flight before this series).

Changes:
- resolve_return_columns gains a &[TableDef] schema_tables param
- JOIN_DETECT_RE gates multi-table resolution
- resolve_return_columns_multi_table rejects SELECT * across joins with
  a clear v1.2 pointer
- Parser propagates schema_tables from parse_queries to resolve_return_columns

Tests:
- 5 new postgres parser unit tests (qualified columns, AS aliases, SELECT *
  rejection, LEFT JOIN rejection, single-table rejection still active)
- Updated the cli test that was asserting the old rejection — it now
  asserts the JOIN query succeeds (renamed from cli_generate_rejects_
  qualified_selects to cli_generate_accepts_multi_table_inner_join)

158 lib + 11 CLI + 2 e2e + 4 typecheck tests all pass. Clippy clean.
@JagritGumber

Copy link
Copy Markdown
Owner Author

Superseded by #66 — same feature, rebased + integrated with the INNER JOIN multi-table resolver work that landed after this PR was written.

@JagritGumber

Copy link
Copy Markdown
Owner Author

Correction to comment above: the replacement is PR #76, not #66.

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.

1 participant