Tarun Vishwakarma

Rusticx

Role
Backend & Architecture
Stack
Rust, Tokio, SQLx
License
MIT

Define a model with a derive macro, generate its table, and run full CRUD across PostgreSQL, MySQL/MariaDB and MongoDB from one API, asynchronously or not.

Rusticx documentation site: “Query any database. Zero compromise.”

How it’s built

rusticx
The public facade. Backends are feature-gated, so a project compiles only the databases it uses.
rusticx-core
The Model trait, Repository, QueryBuilder, Value and the DatabaseAdapter every backend implements.
rusticx-macros
The #[derive(Model)] procedural macro that generates the boilerplate from a struct.
rusticx-sql
A SQL dialect compiler producing DDL and DML for PostgreSQL and MySQL.
rusticx-postgres, rusticx-mysql
SQL adapters on sqlx, with its connection pool.
rusticx-mongo
The MongoDB adapter on the official async driver, with its native pool.

What it does

  • Async-first on Tokio, sqlx and the MongoDB async driver, with a SyncAdapter wrapper for blocking contexts.
  • A type-safe, composable query builder: equality, comparison, LIKE and ILIKE, null checks, OR groups, ordering, limit and offset, without raw strings for common queries.
  • Repository methods for insert, insert_many, find_by_id, find, find_one, paginate, count, update, save (insert-or-update) and delete, plus raw SQL when it is needed.
  • Field attributes for table names, primary keys, nullability, uniqueness, defaults, column renames and skipped fields.
  • migrate() creates a model's table if it does not exist.

Screens

Define a model, insert and query, update and delete
Features and supported databases
Docs: overview
Docs: supported databases and their feature flags

Where it sits

Rust · Tokio · sqlx 0.8 · mongodb 3 · syn / quote (proc macros) · serde · thiserror · tracing

By the numbers

Workspace crates
7, all published at 1.0.0
Stable databases
PostgreSQL, MySQL, MariaDB, MongoDB
Planned
CockroachDB, Cassandra, SQLite

Get it

hover-uiCursor component library for ReactNext project