docs: database efficiency and table recipes#6780
Conversation
Writing Efficient Queries (SQL-side aggregation, N+1 avoidance with .in_() and expanding bindparams, select-what-the-UI-needs), NULL handling with func.coalesce, on-demand related-row queries, per-table pagination state guidance, and debounced table search. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merging this PR will not alter performance
Comparing Footnotes
|
Greptile SummaryThis PR upstreams AI-builder knowledge-base content as first-party docs across three files, adding practical guidance on SQL-side aggregation, NULL handling, on-demand FK lookups, horizontal table scrolling, debounced search inputs, and per-table pagination state.
Confidence Score: 5/5Documentation-only changes with no runtime code paths modified; all code examples in the new sections are correct and consistent with existing patterns in the repo. All three changed files are Markdown documentation. The code snippets are syntactically correct, the scalar unpacking outside the session context is safe for materialized values, func.coalesce guards the nullable aggregate, and the .debounce(500) replacement of lambda handlers is a valid Reflex event-action pattern. Previously flagged issues have been addressed in earlier commits. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "docs: index Flag.post_id so the on-deman..." | Re-trigger Greptile |
FarhanAliRaza
left a comment
There was a problem hiding this comment.
rx.Model is deprecated. do we want to add new docs using deprecated feature ? We can use new code example maybe.
|
Thanks @FarhanAliRaza β addressed this round.
While in here I also fixed two accuracy issues in the new content: "single indexed query" claim (relationships.md, 8b41c43): Reserved keyword in raw SQL (queries.md, 2e6bb28): the expanding |
Fifth batch of upstreaming Reflex Build's AI-builder knowledge base. Database/table techniques, translated into the docs' own ORM idiom:
func.count/group_by, conditional aggregation withcase), avoid N+1 with.in_()(plus a raw-SQLexpanding=Truebindparam alternative), return only what the UI needs (column selection, LIMIT, load-once options, don't cache whole tables in per-user state); new "Handling NULL Values" section (func.coalesce, Python-side guards)overflow_xcontainer guidance, per-table pagination state (reset offset on filter change), debounced search inputs (.debounce(500)) with a per-keystroke-query warningFlexgen-environment rules (raw-SQL-only mandates, schema conventions) were deliberately not upstreamed. Pre-commit clean.
π€ Generated with Claude Code