| Crates.io | start |
| lib.rs | start |
| version | 0.4.4 |
| created_at | 2025-03-30 21:39:59.711964+00 |
| updated_at | 2025-04-25 16:57:53.531606+00 |
| description | StartDB – Embedded NoSQL Database in Rust |
| homepage | |
| repository | https://github.com/leofaraf/start |
| max_upload_size | |
| id | 1612778 |
| size | 82,581 |
A lightweight, in-memory/embedded (single-file) ACID-compliant database designed for simplicity and flexibility.
Add this to your Cargo.toml:
[dependencies]
start = "0.4"
Early stage project — the API is experimental and subject to change.
use serde::{Deserialize, Serialize};
use start::db::query::filtering::{Filter, Value};
type HandleResult<T> = Result<T, Box<dyn std::error::Error>>;
#[derive(Serialize, Deserialize, Debug)]
struct Agent {
name: String,
r#type: String,
score: i32,
}
fn main() -> HandleResult<()> {
let db = start::db_in_memory()?;
let session = db.get_session();
session.start_transaction()?;
session.insert("agents",
&Agent {name: "Cloude".to_string(), r#type: "AI".to_string(), score: 88})?;
session.insert("agents",
&Agent {name: "ChatGPT".to_string(), r#type: "AI".to_string(), score: 90})?;
session.insert("agents",
&Agent {name: "Gemini".to_string(), r#type: "AI".to_string(), score: 85})?;
let result: Vec<Agent> = session.find()
.filter(Filter::Gt("score".into(), Value::Integer(85)))
.from("agents")?;
for entry in result {
println!("Entry: {:?}", entry);
}
// Entry: Agent { name: "Cloude", type: "AI", score: 88 }
// Entry: Agent { name: "ChatGPT", type: "AI", score: 90 }
session.commit_transaction()?;
Ok(())
}