| Crates.io | lupabase |
| lib.rs | lupabase |
| version | 2.0.0-dev.1 |
| created_at | 2025-08-13 12:07:16.318774+00 |
| updated_at | 2025-11-25 10:14:53.44191+00 |
| description | Blazingly fast (work-in-progress) database engine written entirely in Rust |
| homepage | |
| repository | https://github.com/sonicjhon1/lupabase |
| max_upload_size | |
| id | 1793580 |
| size | 147,703 |
Lupabase is a blazingly fast (work-in-progress) database, written entirely in Rust. It focuses on simplicity, portability with flexible storage backends.
Multiple Database engines 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 by DatabaseRecord. Recommended ✅DatabaseRecordsUtils for database records utilities:
DatabaseTransaction for ACID-like transactions:
Raw database I/O with serde through DatabaseIO:
SerializeDeserializeuse lupabase::prelude::*;
use serde::{Serialize, Deserialize};
// Setup Record
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
struct User {
id: u32,
name: String,
}
impl DatabaseRecordPartitioned for User {
const PARTITION: &str = "users";
}
impl DatabaseRecord for User {
type Unique = u32;
fn unique_value(&self) -> Self::Unique {
self.id
}
}
// Create a new Database (This example uses in-memory database that is wiped on exit)
let db = memorydb::MemoryDB::new("Test");
let users = vec![
User { id: 0, name: "Alice".into() },
User { id: 1, name: "Bob".into() },
];
// Initialize the Database
db.try_initialize_storage::<User, _>(users.clone()).unwrap();
// Query
let users_db = db.get_all::<User>().unwrap();
assert_eq!(users_db, users);
// Initialize the Database with a custom storage path
// The ::<Vec<User>> parameter is optional if the default_record is inferable / not empty
db.try_initialize_storage_with_path::<Vec<User>>(vec![], "custom_path").unwrap();
// Query from custom storage path
db.insert_with_path(User { id: 2, name: "Lupa".into() }, "custom_path").unwrap();
let users_custom_db = db.get_all_with_path::<User>("custom_path").unwrap();
assert_eq!(users_custom_db.len(), 1);
assert_eq!(users_custom_db[0].unique_value(), 2);
// Additional helpers
use lupabase::record_utils::*;
let uniques = users_db.as_uniques();
println!("Unique IDs: {:?}", uniques);
if let Some(user) = users_db.find_by_unique(&1) {
println!("Found user: {}", user.name);
}
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.
All code in this repository is dual-licensed under either:
at your option.
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.