What is Criteria?
Criteria is a type-safe query builder that provides a fluent API for constructing database-agnostic queries. It handles filtering, ordering, pagination, and search in a way that’s completely decoupled from your persistence layer.Why Use Criteria?
Type-Safe
Field paths, operators, and values are all validated by TypeScript at compile
time
ORM Agnostic
Works with Prisma, Drizzle, TypeORM, or any persistence layer
Serializable
Convert to/from JSON for API transport or caching
Fluent API
Chain methods naturally for readable, maintainable queries