Skip to content

Installation

siderite is a Cargo workspace. Until the first crates.io release, depend on the git repository (or a path checkout).

[dependencies]
siderite = { git = "https://github.com/jraavis/siderite" }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

The siderite crate is the public facade. Most applications depend only on it and use siderite::prelude::*;.

Requirement Value
Rust edition 2024
MSRV 1.99
Async runtime Tokio
Terminal window
rustup toolchain install 1.99

SQLite is always available. Other backends are opt-in on siderite-backends (re-exported through the workspace). Enable them on the crate that opens the connection — typically your binary, an example, or siderite-cli.

Feature What it unlocks Live-test variable
(default) SQLite QuerySet backend none
postgres PostgreSQL DATABASE_URL=postgres://...
mysql MySQL 8 MYSQL_URL=mysql://...
mongodb MongoDB (supported QuerySet subset) MONGODB_URL=mongodb://...
redis Redis key/hash/set client and RedisCache REDIS_URL=redis://...

A URL for a backend that was not compiled in is an error. Unsupported QuerySet features fail with a BackendCapabilityError before any I/O. Redis is a typed client, not a QuerySet backend.

See Backends for the feature matrix.

Crate Role
siderite Facade and prelude
siderite-core App, routing, extractors, RFC 7807 errors
siderite-validation Validate, rules, constrained types, Schema
siderite-orm Model, QuerySet, relations, transactions
siderite-backends SQLite, PostgreSQL, MySQL, MongoDB, Redis
siderite-macros Route attributes, routes![], derives
siderite-openapi OpenAPI 3.1 document and UIs
siderite-migrations Autodetector, JSON migrations, schema editor
siderite-config Layered settings, Secret, tracing
siderite-cache Memory/Redis cache, RouteCache
siderite-sessions Cookie sessions and CSRF tokens (not in the facade)
siderite-cli AppCli and the standalone siderite binary
siderite-testkit In-process TestClient and TestDatabase

The full map and dependency rules live in Crate map.

Terminal window
git clone https://github.com/jraavis/siderite
cd siderite
cargo install --path crates/siderite-cli
cd examples/hello_world
siderite run

cargo run -p hello_world -- run is the same thing without installing the CLI.

Open http://127.0.0.1:8000/hello/ann and http://127.0.0.1:8000/docs (Swagger UI).

PostgreSQL, MySQL, MongoDB, and Redis examples need the matching URL. Start them from the repository docker-compose.yml:

Terminal window
docker compose up -d --wait

The compose header lists host ports and credentials. Details are in Testing.