Skip to content

paginator-rs

Production-ready pagination for Rust — supporting SQLx, SeaORM, SurrealDB, Axum, Rocket, and Actix-web

Fluent builder API

Ergonomic builder pattern with chainable sub-builders for sorting, filtering, search, and cursor pagination.

Multi-database support

First-class integrations for SQLx (PostgreSQL, MySQL, SQLite), SeaORM, and SurrealDB.

Web framework ready

Drop-in extractors and responders for Axum, Rocket, and Actix-web with automatic pagination headers.

Advanced filtering

14 filter operators including eq, ne, gt, lt, like, ilike, in, between, is_null, contains, and more.

Cursor pagination

Keyset-based pagination for large datasets with consistent results and no offset overhead.

SQL injection safe

All database integrations use parameterized queries. Filter values and search terms are never concatenated into SQL.

use paginator_rs::Paginator;
let params = Paginator::new()
.page(1)
.per_page(20)
.sort().desc("created_at")
.filter()
.eq("status", "active")
.gt("age", 18)
.apply()
.search()
.query("developer")
.fields(["title", "bio"])
.apply()
.build();
// Use with SQLx
let result = paginate_query::<_, User>(
&pool,
"SELECT * FROM users",
&params,
).await?;
println!("Page {}/{}", result.meta.page, result.meta.total_pages.unwrap());