Skip to main content

Crate phoenix_database

Crate phoenix_database 

Source
Expand description

Phoenix’s stable integration boundary around the Toasty ORM.

Models and queries remain native Toasty types. Phoenix owns connection configuration, backend selection, migrations, and isolated test databases.

Modules§

sql
Raw SQL execution helpers. Raw SQL execution helpers for SQL backends.
stmt
Typed statement, expression, and query builder types.

Macros§

create
Expands struct-literal syntax into create builder method chains. Returns one or more create builders — call .exec(&mut db).await? to insert the record(s).
models
Creates a ModelSet containing the specified models.
query
Builds a query using the Toasty query language. The macro expands into the equivalent method-chain calls on the query builder API. It does not execute the query — chain .exec(&mut db).await? on the result to run it.
update
Expands struct-literal syntax into update-builder method chains. Returns the same builder target.update() would return — call .exec(&mut db).await? to execute the update.

Structs§

Database
A Toasty database handle with Phoenix deployment metadata.
DatabaseBuilder
Connection and pool configuration shared by SQL backends.
Deferred
A field whose value is not loaded by default.
Migration
One ordered, reversible database migration.
MigrationPlan
A read-only description of changes the next command would make.
MigrationRunner
Executes a validated migration list against one Phoenix database.
MigrationStatus
Persisted migration state read from phoenix_migrations.
ModelSet
An ordered collection of Model definitions.
Statement
A typed wrapper around an untyped stmt::Statement.
TestDatabase
A fresh SQLite database owned by one test.
Transaction
An active database transaction.
TransactionBuilder
Builder for configuring a transaction before starting it.

Enums§

Backend
SQL backend selected for this database handle.
DatabaseError
Database setup error with stable Phoenix categories.
MigrationError
Migration validation or execution error.

Traits§

Executor
Anything that can execute queries — Db, Connection, or Transaction.

Functions§

batch
Compose multiple independent queries into a single batched statement.

Derive Macros§

Embed
Derive macro that turns a struct or enum into an embedded type stored inline in a parent model’s table.
Model
Derive macro that turns a struct into a Toasty model backed by a database table.