Repository navigation
D1 tables: chunk row counts at celld UNION limit - #108
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Query size limit and chunking crates/outer/src/http/console_data/d1.rs |
build_table_counts rejects inputs with more than five tables. table_count_queries builds queries for chunks of up to five tables. |
Execute chunks and test boundaries crates/outer/src/http/console_data/d1.rs |
list_tables executes each generated query. The documentation describes multiple queries, and tests cover empty input, chunk boundaries, query sizes, table order, and coverage. |
Priority:
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to e4969
-
The chunked table-count implementation appears mergeable with no identified behavior or availability risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
User report (2026-10-28): D1 preview 502s on pacjent-crm (
/console?app=pacjent-crm&t=d1).Root cause, reproduced live against prod celld 0.6.2:
celld d1 executerefuses 6+UNION ALLterms (D1_EXEC_ERROR: too many terms in compound SELECT; without a trailing semicolon the message misleadingly says "incomplete statement"). The D1 tables view runs oneSELECT … UNION ALL …over every visible table, so any app with 6+ visible tables 502s. pacjent-crm has 7 (photos, task, credential, patient, account, session, challenge) since its 4th migration. Verified term count, not content: 5 pure-constant unions pass, 6+ fail regardless of tables.Fix:
MAX_UNION_TERMS = 5;table_count_querieschunks the table list;list_tablesruns one exec per chunk and merges counts.build_table_countsasserts its input fits one exec so the next person to reuse it chunks first.Live on prod (
outer:e49693f, throwaway account, deleted after): the exact 7-table counts query fails as one exec; the 5+2 chunked execs both succeed.Tests: new
table_counts_chunk_at_the_celld_union_limit(0/1/5/7 tables, per-exec term cap, every table counted once); full suite 1103 + 7 green. No migration.Summary by CodeRabbit