{"categories":[{"label":"Database","url":"https://skillfed.io/packages/category/database/2"}],"enrichment":{"capability":"Implements keyset-based paging for SQLAlchemy queries, replacing offset-based pagination to avoid performance degradation and result skipping on large datasets.","skillfed_tags":["pagination","sqlalchemy","cursor-based"],"use_cases":["Paginating large result sets in web applications without performance degradation as users navigate deeper into results.","Implementing cursor-based API pagination where clients receive opaque bookmark strings to request next/previous pages.","Handling frequently-changing datasets where offset-based pagination risks skipping or repeating rows between page requests.","Building async database applications with keyset pagination using AsyncSession.","Sorting by nullable columns by wrapping them with coalesce() to ensure consistent, non-null ordering keys."],"what_it_does":"sqlakeyset replaces SQL OFFSET-based pagination with keyset (cursor) pagination for SQLAlchemy. Traditional offset queries slow down as you page deeper into results and can skip or repeat rows if data changes between requests; keyset paging avoids both problems by bookmarking your position using the actual row values and fetching only rows after that bookmark. The library works with both SQLAlchemy ORM and Core, supports SQLAlchemy 2 with full type hints, and includes async support via sqlakeyset.asyncio.\n\nYou order your query normally, then call select_page() or get_page() to fetch a page and receive a Page object (a list with attached paging metadata). The metadata includes next and previous markers\u2014tuples of the row's key values\u2014which you serialize to bookmarks (strings) for passing around URLs or APIs. On the next request, you pass that bookmark back to fetch the next or previous page. The library handles all the WHERE clause manipulation and ordering reversal internally.","worth_installing":"Yes. sqlakeyset solves a real performance and correctness problem in paginated queries\u2014offset pagination degrades as you go deeper and can lose or duplicate rows in changing datasets. The library is actively maintained, has no known vulnerabilities, requires only common dependencies, and supports both modern SQLAlchemy 2 and legacy ORM styles. The Unlicense places no restrictions. Install if you paginate large or frequently-changing result sets."},"id":"sqlakeyset","links":{"html":"https://skillfed.io/packages/sqlakeyset","md":"https://skillfed.io/packages/sqlakeyset.md","pypi":"https://pypi.org/project/sqlakeyset/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-03","license_spdx":null,"license_treatment":"permissive","name":"sqlakeyset","python_support":"supports_current","summary":"offset-free paging for sqlalchemy"},"popularity":{"monthly_downloads":1295563,"position":4094,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"2.0.1775222100"}
