Skip to content

docs(orm): document subquery selects (select_sub, add_select, table) - #70

Merged
tmgbedu merged 1 commit into
mainfrom
docs/orm-subquery-selects
Sep 28, 2026
Merged

tmgbedu merged 1 commit into
mainfrom
docs/orm-subquery-selects

Conversation

@tmgbedu

@tmgbedu tmgbedu commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Documents the query builder additions from fastapi-startkit/fastapi-startkit-framework#170 (released in v0.60.0).

Adds a Subquery selects section to docs/database/models.md under Querying:

  • last_login_at example with its generated SQL
  • select_sub(subquery, alias): builder or callable input, binding order, TypeError for anything else
  • add_select(*columns): variadic, single list, dedup, {alias: subquery} dict (seeds {table}.* when nothing is selected), string values stay plain columns, bare subquery raises TypeError
  • Migration note: add_select(alias, callable) was removed, use select_sub(callable, alias)
  • table(name)

SQL output was checked with to_sql() (Postgres grammar) and against test_select_sub_grammar.py / test_sqlite_select_sub.py. npm run docs:build passes.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmgbedu
tmgbedu merged commit 6931def into main Sep 28, 2026
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