Cargo features
Choose features on the Git dependency. For SQLite with Rustls and Axum:
alibi = { version = "0.1.1", default-features = false, features = ["axum", "sqlx-sqlite", "rustls"] }| Feature | Default | Enables |
|---|---|---|
axum |
no | Axum: AxumIntegration, CurrentSession, OptionalSession |
poem |
no | Poem: PoemIntegration, session extractors |
sqlx |
yes | SQLx store for SQLite and PostgreSQL (sqlx-sqlite + sqlx-postgres) |
sqlx-sqlite |
via sqlx |
SQLx with SQLite only |
sqlx-postgres |
via sqlx |
SQLx with PostgreSQL only |
seaorm |
no | SeaORM store |
redis-cache |
no | RedisAdapter for secondary storage and shared rate limits |
native-tls |
yes | OpenSSL for outbound HTTP (OAuth, email verification, CAPTCHA, …) and the SQLx/SeaORM PostgreSQL drivers |
rustls |
no | Rustls instead of OpenSSL |
Rules of thumb
Section titled “Rules of thumb”- Pick exactly one TLS feature. The default is
native-tls; to userustls, disable default features. - Pick the engine you use. Disabling default features and selecting
sqlx-sqliteorsqlx-postgresremoves the other engine’s code.SqlxPool::connectreturns a configuration error for a URL whose engine is not compiled in. - Frameworks are opt-in. Without
axumorpoem, useBetterAuth::handle_requestdirectly (Other frameworks). - SeaORM and SQLx are independent. Enable one or both; each provides its own store, hooks and rate-limit storage.
Common combinations
Section titled “Common combinations”# PostgreSQL + Axum + Rustls (typical production)alibi = { version = "0.1.1", default-features = false, features = ["axum", "sqlx-postgres", "rustls"] }
# SeaORM + Poem + Rustlsalibi = { version = "0.1.1", default-features = false, features = ["poem", "seaorm", "rustls"] }
# Axum + SQLx + Redis-backed sessions and rate limitsalibi = { version = "0.1.1", features = ["axum", "redis-cache"] }Your own sqlx dependency must enable the same engine ("sqlite" and/or "postgres") plus chrono, json and derive, because the generated models derive sqlx::FromRow.