#tower-sessions #surrealdb #axum #tower

tower-sessions-surrealdb-store

SurrealDB session store. Not for direct use; see the tower-sessions crate for details.

11 releases (6 breaking)

0.7.0 Aug 11, 2025
0.6.0 Jan 25, 2025
0.5.1 Dec 7, 2024
0.5.0 Sep 18, 2024
0.1.0 Dec 28, 2023

#6 in #tower-sessions

Download history 2/week @ 2025-10-05 34/week @ 2025-11-16 1/week @ 2025-11-23 27/week @ 2025-11-30 19/week @ 2025-12-07

455 downloads per month

MIT license

40KB
324 lines

tower-sessions-surrealdb-store

SurrealDB session stores for tower-sessions.

This package is in beta. It has automated tests for the basic functionality, but is untested in production.

🎨 Overview

  • Compact encoding: session data is stored in the database using MessagePack, a compact self-describing serialization format.
  • Automatic table setup: only provide a database connection and a table name; the table will be created if it does not exist.

Using surrealdb-nightly

In Config.toml:

tower-sessions-surrealdb-store = { version = "*", features = ["surrealdb-nightly"], default-features = false }

The default-features = false is necessary, otherwise you'll install both surrealdb and surrealdb-nightly and get conflicts.

🤸 Usage Example

See examples/counter.rs.

Dependencies

~73–99MB
~2M SLoC