Skip to main content

Crate alibi_sqlx

Crate alibi_sqlx 

Source
Expand description

SQLx integration for Alibi.

SqlxStore persists every auth table through an application’s own SQLite or PostgreSQL pool. Application-owned models derive sqlx::FromRow and AuthEntity.

Re-exports§

pub use organization_models::OrganizationModels;
pub use hooks::SqlxBackend;
pub use hooks::SqlxHookContext;
pub use json_metadata::JsonMetadata;
pub use model::ActiveRow;
pub use model::ActiveValue;
pub use model::ColumnDef;
pub use model::SqlxModel;
pub use pool::Engine;
pub use pool::SqlxPool;
pub use pool::SqlxRow;
pub use pool::SqlxTransaction;
pub use pool::SqlxTransactionGuard;
pub use rate_limit::SqlxRateLimitStorage;
pub use schema::SqlxAccountModel;
pub use schema::SqlxSessionModel;
pub use schema::SqlxUserModel;
pub use schema::SqlxVerificationModel;
pub use store::SqlxStore;
pub use value::ColumnKind;
pub use value::SqlValue;
pub use value::SqlxValue;
pub use sqlx;

Modules§

additional_fields
Raw configured values staged on actual model columns.
hooks
SQLx bindings for the shared database lifecycle hooks.
json_metadata
JSON metadata storage for bundled and application-owned SQLx models.
model
Column-level write staging for SQLx models.
organization_models
Application-owned organization plugin tables. Models derive crate::SqlxModel and use Rust names for plugin fields, with sqlx(rename) for physical names.
pool
Engine-tagged SQLx pools and transactions, and statement execution.
rate_limit
Atomic rolling rate limits persisted independently of an application’s auth schema.
schema
SQLx model bindings for Alibi schemas.
store
SQLx-backed persistence implementation for built-in auth tables.
value
Typed SQL values bound to SQLx arguments.

Structs§

Integer
Number
Better Auth’s number columns use SQLite INTEGER affinity.

Enums§

HookControl
Control flow returned by database before_* hooks.

Traits§

DatabaseHooks
Lifecycle hooks for intercepting auth writes.

Functions§

current_request_hook_context

Derive Macros§

AuthEntity
Derive macro that generates Auth* trait impls and Sqlx*Model impls for a SQLx model.
SqlxModel
Derive macro that implements SqlxModel for a table-backed row type.