Skip to content

fix: Apply findMany limit in the SQL query - #117

Merged
erayhanoglu merged 6 commits into
mainfrom
dev
Oct 30, 2026
Merged

erayhanoglu merged 6 commits into
mainfrom
dev

Conversation

@erayhanoglu

Copy link
Copy Markdown
Member

Summary

  • Fix: findMany({ limit }) puts the limit in the SQL. The limit only reached the driver as fetchRows, so findOne(), exists() and a limited findMany() made the database compute every matching row. The mysql, mariadb and mssql adapters even fetched all of them before slicing. The query now carries LIMIT (OFFSET ... FETCH on mssql, rownum on oracle).
  • CI: the tests run when the lockfile, rman/lint config or test data change. release.yml skips the tests for a pull request merged from dev, so a change the push filter missed reached a release untested; the last commit of chore: switch the repository from npm to pnpm #116 did. Added pnpm-lock.yaml, pnpm-workspace.yaml, .rmanrc.yml, eslint.config.mjs and .prettierrc. support/test/** matched no directory and is now support/**.
  • Tests: write tests get a schema of their own. All connect test files shared one schema per run, so rows a write test left behind reached the read tests after it. The tests that insert, update or delete now use test_sqb_connect_writes.
  • CodeQL: advanced setup replaces the default setup (already turned off in the repository settings). Same languages, query suite and weekly schedule. Pushes that touch only the version bumps, changelog, lockfile and src/constants.ts are skipped, so a release no longer re-scans the code it just merged.
  • Lockfile sync from the clean install (rman 2.40.3, @azure/identity 4.14.1).

Release note

findOne(), exists() and findMany({ limit }) now send LIMIT to the database. The rows returned are the same as before.

Test plan

  • rman ci, rman check, rman lint
  • pnpm test with every database running locally: 858 passing
  • The new findMany test fails without the fix; the find-many-o2o tests fail without the schema split
  • CI on this PR, including the first run of the new CodeQL workflow

🤖 Generated with Claude Code

github-actions Bot and others added 6 commits October 29, 2026 20:47
The version bump, the source stamps and the changelog entry are written on
'main' by `rman version`. Merging them back keeps this branch reporting the
version that actually shipped, and keeps the next pull request carrying only its own work.

[skip ci]
The limit was only passed to the driver as fetchRows, so findOne(),
exists() and a limited findMany() made the database compute every
matching row; the mysql, mariadb and mssql adapters even fetched them
all before slicing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… change

release.yml skips the tests for a pull request merged from dev, so a
change the push filter missed reached a release untested. The filter
now covers pnpm-lock.yaml, pnpm-workspace.yaml, .rmanrc.yml,
eslint.config.mjs and .prettierrc, and support/** replaces
support/test/**, which matched no directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All connect test files shared one schema, created once per run, so the
rows a write test left behind reached the read tests that ran after it;
the find-many-o2o sort tests failed on customers inserted without a
country. Write tests now use test_sqb_connect_writes, and the o2o tests
expect a country on every row again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default setup analyzed every push to main, and a release pushes to
main again after the merge it releases, so each release scanned the
same code two or three times. An advanced-setup workflow keeps the
default setup's languages, query suite and weekly schedule, and skips
pushes that touch only the version bumps, changelog, lockfile and
version stamp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@erayhanoglu
erayhanoglu merged commit 64b6f81 into main Oct 30, 2026
5 checks passed
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