lupabase
Lupabase is a blazingly fast (work-in-progress) database, written entirely in Rust. It focuses on simplicity, portability with flexible storage backends.
Features
-
Multiple
Databaseengines built-in: -
Flexible database record:
DatabaseRecord: A minimal, general-purpose record type for database operations that support custom paths. Suitable record that needs to be stored at custom file paths.DatabaseRecordPartitioned: A partitioned (named) record type that enables full feature support across all database operations. This includes everything supported byDatabaseRecord. Recommended ✅
-
DatabaseRecordsUtilsfor database records utilities:- Filter records by unique key
- Detect intersecting and non-intersecting records
- Easily extract unique identifiers
-
DatabaseTransactionfor ACID-like transactions:- Start transactions
- Commit stored transations
- Rollback transactions to a previous snapshot
-
Raw database I/O with
serdethroughDatabaseIO:- Store any type that implements
Serialize - Retrieve any type that implements
Deserialize
- Store any type that implements
This is not
- A standalone database server
- A relational database
Example/Usage
use *;
use ;
// Setup Record
// Create a new Database (This example uses in-memory database that is wiped on exit)
let db = new;
let users = vec!;
// Initialize the Database
db..unwrap;
// Query
let users_db = db..unwrap;
assert_eq!;
// Initialize the Database with a custom storage path
// The ::<Vec<User>> parameter is optional if the default_record is inferable / not empty
db..unwrap;
// Query from custom storage path
db.insert_with_path.unwrap;
let users_custom_db = db..unwrap;
assert_eq!;
assert_eq!;
// Additional helpers
use *;
let uniques = users_db.as_uniques;
println!;
if let Some = users_db.find_by_unique
Roadmap
- Variadic / multiple path (partition) function call
- Concurrency-safe multi-threaded transactions
- Improved tests and docs
- Examples
Status
This project is under active development and not yet production-ready. Although it is in active use for my own projects, you should expect breaking changes if you use this library in the current status.
License
All code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
Your contributions
Any contribution submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.