Toasty v0.7.0
Relations are now plain fields, with eager loading by default. The HasMany, HasOne, and BelongsTo wrapper types are gone. A relation field is just its target type, and whether you wrap it in Deferred controls when it loads: a bare field loads eagerly with its parent, a Deferred<...> field loads on demand (via .include() or an accessor).
#[has_many]
posts: Vec<Post>, // eager — loaded with the User
#[has_one]
profile: toasty::Deferred<Option<Profile>>, // on demand
Multi-step via relations. Declare relations that traverse an intermediate relation, and load them with .include():
#[has_many(via = posts.comments)]
comments: toasty::Deferred<Vec<Comment>>,
update! macro. A new macro for updates, mirroring create!. Set multiple fields in one call, with field shorthand, embedded-struct patches, and has-many inserts:
toasty::update!(user {
name: "Carlos",
email: "carlos@example.com",
})
.exec(&mut db)
.await?;
Arithmetic updates. Numeric fields get increment, decrement, add, and subtract, compiled to in-place column updates and usable as method shorthand inside update!:
toasty::update!(comment { views.increment() }).exec(&mut db).await?;
Turso driver. libSQL now joins SQLite, PostgreSQL, MySQL, and DynamoDB. On SQLite and Turso, TransactionMode lets you pick the lock-acquisition strategy for concurrent writers.
Raw SQL. An escape hatch for queries the builder doesn't cover, with typed results.
New field wrappers. Deferred<T> (replaces #[deferred]) and toasty::Json<T> (replaces #[serialize(json)]) are ordinary types — they compose with Option, embeds, and derives.
- Derive
Cloneand addDeserializeforDeferred<T>(#994) - [breaking] Increment, decrement, add, and subtract update operators (#979)
update!macro for concise field updates (#980)- Reject
create()on multi-step relation scopes at compile time (#978) - Raw SQL execution API (#965)
- Remove the
#[deferred]attribute in favor ofDeferred<T>(#961) - Eager relation fields (#958)
.include()of multi-stepviarelations (#946)- Expose migration core from
toasty(#944) - Turso driver with TransactionMode-aware concurrent writes (#938)
- Dispatch has-many
stmt::applybatches per entry (#932) TransactionModefor SQLite lock-acquisition control (#931)- Allow
#[version]on tuple-newtype embeds ofu64(#930) - Serialize
SELECT DISTINCT(#934) - [breaking] Replace
#[serialize(json)]with thetoasty::Json<T>wrapper (#926) - Expose the primary-key type via
Model::PrimaryKey(#921) - Fold simple
Batchassignments in update lowering (#917) - Multi-step (
via)has_manyandhas_onerelations (#890) - Non-panicking
try_geton relation types (#918)
- Deserialize a present
Deferred<T>value as loaded (#999) - Lift relation-path
LIKEinto a foreign-key subquery (#992) - Lift relation-path
IN-subquery throughBelongsTochains (#990) - Make
starts_withcase-sensitive on SQLite and MySQL (#983) - Handle
ExprOrinevalverify_expr(#959) - [breaking] Scope
.ilike()to PostgreSQL and document operator pass-through (#937)
- [breaking] Merge one-relation field traits (#971)
- Simplify
Fieldbounds now thatLoad<Output = Self>is required (#976) - Move
UpdateTarget::Queryrewrite into lower (#975) - [breaking] Delete the
Relationtrait, tighten relation field shapes (#967) - Split
viarelations into a field variant (#966) - [breaking] Merge has-relation field variants (#964)
- [breaking] Require
Deferredrelation fields (#954) - Gate the SQLite connect doctest (#953)
- Split relation field traits from targets (#950)
- Unify lazy-slot relation encoding (#949)
- [breaking] Move schema diff types to
schema::diff(#929) - Consolidate migration types and reorganize the
db::diffAPI (#928)
- INNER join variant (#922)
- Cap SQLite auto-increment integer storage at 4 bytes (#969)
- [breaking] Remove singular has-many create-builder methods (#977)
- Respect the
pairattribute in the#[has_one]macro (#927)
- Rename types in
toasty_core::schema::diff(#942)
- Adopt
tokio-postgres-rustls0.14 (#952)
- Accept libpq query-param connection options (#985)
- Omit empty
ExpressionAttributeValuesonIS NULL/IS NOT NULLscans (#940)
toasty-driver-mysql, toasty-driver-sqlite, toasty-driver-turso, toasty-cli, and the integration-suite crates received the shared changes listed above (raw SQL API, Turso driver, required Deferred relation fields, schema-diff move) with no crate-specific entries.
Toasty v0.6.0
- Vec model fields with push, extend, clear, pop, remove_at, and remove operations on PostgreSQL, MySQL, SQLite, and DynamoDB (#866, #872, #880, #887)
- Connection pooling improvements: lifetime capping, idle time limits, and automatic broken connection detection and eviction (#879, #882, #874, #867)
- Query capabilities: .select() projection through BelongsTo relations, per-call column projection, ilike() filter method, filtering by associated model fields, all-condition filters for associations, and latest_by queries (#827, #820, #801, #781, #784, #707)
- Compile-time validation for column storage types and create! macro field sets (#832, #648)
- Auto proxying through tuple-newtype Embed types (#836)
- #[deferred] field attribute and Deferred wrapper with embedded type support (#793, #799)
- Backward pagination driver capability (#757)
- Full-table scan support on DynamoDB (#821)
- IN-list parameter optimization for PostgreSQL (#818)