Toasty v0.9.0 #1120
carllerche
announced in
Announcements
Toasty v0.9.0
#1120
Replies: 1 comment
|
good! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Changelog`:
Highlights
#[document]fields. Store an embedded struct in one document column without giving up typed queries into its fields. PostgreSQL uses JSONB, MySQL uses JSON, SQLite and Turso use JSON text, and DynamoDB uses a map. The same generated path works across backends:Read about document fields.
Atomic upserts.
#[derive(Model)]now generatesupsert_by_*builders for primary keys and unique constraints. An upsert can share assignments across both branches, set create- and update-specific values, apply mutations such asincrement(), or useor_ignore():PostgreSQL, SQLite, and Turso support the complete API. DynamoDB supports primary-key forms; MySQL rejects upserts because its conflict behavior cannot preserve Toasty's targeted semantics. Read about upserts.
Dynamic and native JSON fields. Models can use
serde_json::Valuedirectly for payloads whose structure is not known to Toasty. Bothserde_json::Valueandtoasty::Json<T>can select text, PostgreSQL JSONB, or native JSON storage:Use
#[document]when Toasty should generate typed paths into a fixed structure; use JSON fields for opaque or dynamic values that are read and replaced as a whole. Read about JSON encoding.Filtered and ordered includes. Association paths passed to
.include()now accept.filter()and.order_by(), so applications can preload exactly the related records they need in the required order:Turso Sync. The Turso driver can connect a local database to Turso Cloud or a local sync server. Applications configure authentication and bootstrap behavior on the driver, then explicitly call
push()andpull()when they want to exchange changes. Read about Turso Sync.Embedded enum improvements. Enum variants can declare explicitly shared fields with
#[shared(name)]and define enum-level indexes or unique constraints over those columns. Embedded enums also supportrename_all, explicit integer discriminants, and scalar storage for unit enums.Added
Fixed
This discussion was created from the release Toasty v0.9.0.
All reactions