Type-Safe by Design
Catch incompatible expressions while compiling.
OxideR Query is a type-safe, multi-dialect SQL query builder for Rust, inspired by Java's QueryDSL. Compose queries from typed primitives, let the compiler reject invalid ones, and render predictable SQL for PostgreSQL, MySQL or SQLite.

use oxider_query::prelude::*;
let rendered = User::query()
.select((User::id, User::name))
.filter(
User::name.contains("nguyen")
.and(User::age.ge(18))
)
.order_by(User::id.desc())
.limit(20)
.to_sql(&Postgres)?;
// SELECT "users"."id", "users"."name" FROM "users"
// WHERE "users"."name" LIKE $1 ESCAPE '!' AND "users"."age" >= $2
// ORDER BY "users"."id" DESC LIMIT 20Catch incompatible expressions while compiling.
Build complex queries from reusable predicates.
Keep abstractions explicit and runtime overhead lean.
Render safe SQL with bound parameters.
Traits, generics and macros shaped around Rust.
The goal is not to hide relational databases behind magic. OxideR Query gives database code a typed vocabulary, while keeping the generated SQL understandable and debuggable.
String operations belong to strings. Numeric comparisons belong to numeric columns.
Filters, ordering, joins and projections should be reusable instead of string-built.
SQL rendering and bind parameters remain explicit parts of the architecture.
// Column<User, i32>
User::age.ge(18)
// Column<User, String>
User::name.contains("oxide")The operation matches the column's capabilities.
// name is a String, not an integer
User::name.eq(123)
// Department is not in this query's scope
User::query().filter(Department::name.eq("AI"))Rejected by the compiler, before it reaches a database.
Derive typed metadata from Rust structs.
Columns, predicates, projection and ordering.
Composable query state independent from raw strings.
PostgreSQL, MySQL and SQLite rendering with safe parameter binding.
OxideR Query is the first module and the only one released today. The other modules are ideas, not commitments: each would be a focused Rust backend primitive adopted independently.

Entity derive, typed columns and operators, every join, CTEs, window functions, subqueries and full DML, rendered for PostgreSQL, MySQL and SQLite.
Optional sqlx execution, typed projections, pagination, streaming, decimal/uuid/json values, and schema codegen for PostgreSQL and SQLite.
PostgreSQL arrays, codegen for MySQL, and English documentation (the guide is currently written in Vietnamese).
Publish to crates.io. More dialects and other OxideR modules only when real users ask for them.
OxideR is an open-source Rust project focused on backend ergonomics. Contributors can help shape API design, macros, SQL rendering, documentation, examples and the long-term ecosystem.
