Skip to content

Respect --limit 0 in sqlite-utils rows - #965

Merged
simonw merged 3 commits into
simonw:mainfrom
LucioLiu:fix/rows-zero-limit
Nov 29, 2026
Merged

simonw merged 3 commits into
simonw:mainfrom
LucioLiu:fix/rows-zero-limit

Conversation

@LucioLiu

@LucioLiu LucioLiu commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes:

Distinguish an omitted limit from an explicit zero when building the SQL for rows. This also keeps the offset-only fallback (limit -1) from overriding a zero limit.

Added two cases to the existing command tests. On main, requesting zero rows returned both fixture records, and adding an offset returned the second record. With the fix both commands produce []. All 15 cases for rows passed locally, and the full suite reported 1,499 passed and 16 skipped.

Prepared and tested with Codex.


📚 Documentation preview 📚: https://sqlite-utils--965.org.readthedocs.build/en/965/

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T13:58:20.859687Z 2c6a6a2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@atishay-kasliwal atishay-kasliwal 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.

Ran sqlite-utils rows on a 5-row table: --limit 0 now returns [], where main returned all 5 rows. --limit 2, --limit 2 --offset 1, --offset 3 and no options give the same rows as main.

@simonw simonw added bug Something isn't working cli-tool labels Nov 29, 2026
@simonw simonw linked an issue Nov 29, 2026 that may be closed by this pull request
simonw and others added 2 commits November 29, 2026 13:20
Brings in the removal of a redundant cast flagged by newer ty and the
removal of the retired macos-14 runner, which were failing CI on this branch.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@simonw
simonw merged commit af6b79a into simonw:main Nov 29, 2026
41 checks passed
simonw added a commit that referenced this pull request Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli-tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rows --limit 0 exports the entire table

3 participants