Expand description
Toasty session store for
tower-sessions.
One store implementation, many backends: SQLite, PostgreSQL, MySQL, and Turso — the store uses only portable Toasty query-builder calls, so every SQL backend shares the same code path. DynamoDB is untested and not supported.
§Usage
With a store-owned database (the store builds its own toasty::Db):
use tower_sessions_toasty_store::ToastyStore;
let store = ToastyStore::connect("sqlite::memory:").await.unwrap();
store.migrate().await.unwrap();With an application-owned toasty::Db, sharing its connection pool.
The Db must register TowerSession — using an unregistered model
panics inside Toasty:
use tower_sessions_toasty_store::{ToastyStore, TowerSession};
let db = toasty::Db::builder()
// your own models join the list: toasty::models!(TowerSession, crate::*)
.models(toasty::models!(TowerSession))
.connect("sqlite::memory:")
.await
.unwrap();
let store = ToastyStore::new(db);
store.migrate().await.unwrap();Re-exports§
pub use toasty;
Structs§
- Toasty
Store - A Toasty session store.
- Tower
Session - The session model, mapped to the
tower_sessionstable.
Enums§
- Toasty
Store Error - An error type for Toasty stores.