Skip to content

Accept exp.Expr (incl. exp.Query) as sqlglot query type - #57

Merged
aersam merged 5 commits into
mainfrom
fix-expr-type
Oct 9, 2026
Merged

aersam merged 5 commits into
mainfrom
fix-expr-type

Conversation

@aersam

@aersam aersam commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #56

SqlQueryNoTemplate (and so SqlQuery, used by fetch_all/fetch_one/fetch_scalar/execute/PostgresJsonResponse) now accepts any sqlglot exp.Expr instead of exp.Expression. In sqlglot 30 exp.Query (base of Select/Union/Subquery) is an exp.Expr but not an exp.Expression, so a type checker such as pyright rejected exp.Query-typed values. The exp import stays under TYPE_CHECKING (sqlglot is still not imported by import pgdevkit.db).

  • Runtime tests: Union/Subquery through _render, PostgresJsonResponse and live fetch_all; nested exp.Command / invalid placeholder names are still rejected.
  • Docs: README/SKILL.md wording, comment on the alias explaining why it is exp.Expr.
  • Version 0.15.2.

🤖 Generated with Claude Code

@aersam
aersam marked this pull request as ready for review October 9, 2026 17:33
@aersam
aersam merged commit 09236ca into main Oct 9, 2026
2 checks passed
aersam and others added 5 commits October 9, 2026 19:25
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

SqlQuery should accept sqlglot exp.Expr (exp.Query isn't an exp.Expression in sqlglot 30)

1 participant