Skip to content

fix(tables): allow unbounded v1 row queries - #6713

Merged
TheodoreSpeaks merged 4 commits into
stagingfrom
fix/table-limit-block
Aug 15, 2026
Merged

fix(tables): allow unbounded v1 row queries#6713
TheodoreSpeaks merged 4 commits into
stagingfrom
fix/table-limit-block

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • return every matching row when the v1 Table block Query Rows limit is omitted
  • accept any positive integer Limit without a maximum, while retaining fail-fast validation and the 5MB response budget
  • always return totalCount for v1 workflow callers, while skipping execution metadata on omitted or formerly over-limit queries
  • keep bulk-operation and public API pagination limits unchanged

Type of Change

  • Bug fix

Testing

  • Focused tests (76 passing)
  • TypeScript type-check
  • Lint and all repository audits
  • Generated metadata and integration catalog checks

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 15, 2026 12:42am

Request Review

@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Unbounded queries can increase DB work and payload size for workflow callers, though the 5MB fail-fast and skipping execution sidecars on expanded queries limit exposure.

Overview
Query Rows for the v1 Table block and GET /api/table/[tableId]/rows no longer default or cap row count at 1,000. An omitted Limit means return every matching row; any positive integer is accepted. Results still fail fast when they exceed the 5MB response budget.

The row-query drain loop in queryRows drops the former 1,000-batch iteration cap so large under-budget results can be returned in full. For omitted or over-1,000 limits, the rows route skips per-row execution metadata (withExecutions: false) while still returning totalCount. Bulk update/delete limits and public pagination defaults elsewhere are unchanged.

Block param parsing, API Zod schemas (unboundedTableRowsLimitSchema), docs, and LLM tool descriptions are updated to match.

Reviewed by Cursor Bugbot for commit e1d13ff. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes first-party v1 Query Rows requests unbounded when Limit is omitted while retaining validation, bounded database batches, and the 5MB response budget.

  • Removes the obsolete 1,000-batch drain ceiling so under-budget results can be read to exhaustion.
  • Allows omitted or arbitrarily large positive limits in the first-party route while preserving existing public API and bulk-operation limits.
  • Skips execution-sidecar loading for expanded queries, retains total counts, and updates tests, tool metadata, and documentation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/lib/table/rows/service.ts Replaces the fixed iteration ceiling with an exhaustion-, limit-, or byte-budget-driven drain whose pagination state advances on every continuing iteration.
apps/sim/lib/api/contracts/tables.ts Introduces a shared optional positive-integer limit schema without a maximum for the intended first-party query contracts.
apps/sim/app/api/table/[tableId]/rows/route.ts Disables execution-sidecar loading for omitted or formerly over-limit queries while preserving total-count behavior.
apps/sim/blocks/blocks/table.ts Preserves omitted Query Rows limits, validates numeric inputs strictly, and keeps bulk-operation limits capped.
apps/sim/lib/table/tests/service-filter-threading.test.ts Adds regression coverage proving an under-budget query can drain beyond the former 1,000-batch ceiling.

Reviews (6): Last reviewed commit: "fix(tables): always return query totals" | Re-trigger Greptile

Comment thread apps/sim/lib/api/contracts/tables.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/lib/api/contracts/tables.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/lib/table/rows/service.ts Outdated

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a113e08. Configure here.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/blocks/blocks/table.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 0d74b08. Configure here.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e1d13ff. Configure here.

@TheodoreSpeaks
TheodoreSpeaks merged commit ee1fc37 into staging Aug 15, 2026
31 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the fix/table-limit-block branch August 15, 2026 01:08
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