Repositories#

A Repository binds to a single SQLAlchemy model and provides typed synchronous or asynchronous methods (add, get, get_many, get_many_and_count, upsert_many, delete) for CRUD, filtering, pagination, and dialect-translated error handling.

How a repository connects your code and filters to your SQL database How a repository connects your code and filters to your SQL database
Repository Basics

Add, fetch, update, bulk-upsert, and delete records with async or sync repositories.

Repository Basics
Filtering & Pagination

Search text, filter by IDs or dates, and return paginated results with total counts.

Filtering and Pagination
Cursor Pagination

Page large or changing tables by position, with signed tokens and stable ordering.

Cursor Pagination
Advanced Patterns

Work with composite primary keys, row-level locks, and bulk conditional deletes.

Advanced Repository