flask-sqlalchemy icon indicating copy to clipboard operation
flask-sqlalchemy copied to clipboard

Add `paginate_rows()` method

Open jwodder opened this issue 2 years ago • 3 comments

This PR adds a paginate_rows() method to the extension object that behaves like paginate(), except its items are sqlalchemy.Row instances instead of whatever was the in the first column of the select(). This makes it possible to paginate compound selects without having to fall back to the legacy Query API.

  • Fixes #1168.

Checklist:

  • [x] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • [x] Add or update relevant docs, in the docs folder and in code.
  • [x] Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • [x] Add .. versionchanged:: entries in any relevant code docs.
  • [x] Run pre-commit hooks and fix any issues.
  • [x] Run pytest and tox, no tests failed.

jwodder avatar Oct 14 '23 17:10 jwodder