Important Update: This crate struct_db
has been renamed to native_db
to better reflect its functionality and purpose. Please update your dependencies to use native_db
for the latest features and updates.
Struct DB 🔧🔩
Provides a drop-in, fast, and embedded database solution based on redb, focusing on maintaining coherence between Rust types and stored data with minimal boilerplate. It supports multiple indexes, real-time watch with filters, schema migration, enjoy 😌🍃.
Features
- Almost as fast as the storage engine redb.
- Embedded database (Linux, macOS, Windows, Android, iOS).
- Support multiple indexes (unique secondary keys).
- Compatible with all Rust types (
enum
,struct
,tuple
etc.). - Query data (
get
,watch
,iter
etc.) using explicit type or type inference. - Real-time subscription with filters for
insert
,update
anddelete
operations. - Schema migration using native Rust coercion.
- Fully ACID-compliant transactions.
- Add your own serialization/deserialization logic planned* (e.g: zero-copy).
- Thread-safe.
Status
Early development. Not ready for production. Follow the roadmap for the 1.0 release.
How to use?
See docs.rs.
Example
use ;
use *;
;
Roadmap
The following features are planned before the 1.0 release
- Add benchmarks tests.
- Add documentation.
- Stable release of redb or implement another stable storage engine(s) for Linux, macOS, Windows, Android, iOS.
- Add support for custom serialization/deserialization logic.
- Add CI for Linux, macOS, Windows, Android, iOS.
- Use in a real-world project.