Skip to main content

Module sqlx

Module sqlx 

Source
Expand description

SQLx integration re-exports, gated behind the default sqlx feature or one of its engines, sqlx-sqlite and sqlx-postgres.

Modules§

__private_core
Alibi Core
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.
sqlx
The async SQL toolkit for Rust, built with ❤️ by the LaunchBadge team.
store
SQLx-backed persistence implementation for built-in auth tables.
value
Typed SQL values bound to SQLx arguments.

Structs§

ActiveRow
Per-column write state of one model row, in model column order.
ColumnDef
A physical model column.
JsonMetadata
JSON storage preserving every application object key.
OrganizationModels
Bind the three organization entities to application models and ID factories. This affects every plugin operation, including invitation transactions.
SqlxBackend
The SQLx hook backend: implement DatabaseHooks<S, SqlxBackend> to receive its pool and transaction.
SqlxRateLimitStorage
Shared database storage. Run SchemaMigrator::migrate before serving requests; ordinary auth migrations do not create or claim its table. Compare-and-swap predicates preserve quotas across independent application instances.
SqlxStore
SqlxTransaction
An auth transaction shared with lifecycle hooks.
SqlxTransactionGuard
Exclusive access to an open auth transaction.

Enums§

ActiveValue
One column’s write state.
ColumnKind
Storage category of a model column, derived from its Rust field type.
Engine
The database engine behind a pool.
HookControl
Control flow returned by database before_* hooks.
SqlValue
A typed value bound to one SQL parameter.
SqlxPool
An application’s SQLx pool. Better Auth shares it with the application.

Traits§

DatabaseHooks
Lifecycle hooks for intercepting auth writes.
SqlxAccountModel
SqlxModel
A table-backed SQLx model.
SqlxRow
A model decodable from the rows of every enabled engine.
SqlxSessionModel
SqlxUserModel
SqlxValue
A model field type which converts to and from a bound SqlValue.
SqlxVerificationModel

Functions§

current_request_hook_context

Type Aliases§

SqlxHookContext
Context passed to SQLx lifecycle hooks.

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.