Quick Start
Embedded (Rust)
use oxidb::OxiDb;
use serde_json::json;
fn main() {
let db = OxiDb::open("./my_data").unwrap();
// Insert a document
db.insert("users", json!({
"name": "Alice",
"age": 30,
"department": "Engineering"
})).unwrap();
// Query
let results = db.find("users", json!({"age": {"$gte": 25}}), None).unwrap();
// Update
db.update("users", json!({"name": "Alice"}), json!({
"$set": {"age": 31}
})).unwrap();
}
Server Mode
# Start the server
OXIDB_ADDR=127.0.0.1:4444 OXIDB_DATA=./data oxidb-server
# Environment variables:
# OXIDB_ADDR - Bind address (default: 127.0.0.1:4444)
# OXIDB_DATA - Data directory (default: ./oxidb_data)
# OXIDB_POOL_SIZE - Worker threads (default: 4)
# OXIDB_IDLE_TIMEOUT - Connection timeout in seconds (default: 30)
Python
from oxidb import OxiDbClient
with OxiDbClient("127.0.0.1", 4444) as db:
db.insert("users", {"name": "Alice", "age": 30})
docs = db.find("users", {"age": {"$gte": 25}})
db.update("users", {"name": "Alice"}, {"$inc": {"age": 1}})
Go
client, _ := oxidb.ConnectDefault()
defer client.Close()
client.UseOxiWire() // enable binary protocol (fastest)
client.Insert("users", map[string]any{
"name": "Alice", "age": 30,
})
docs, _ := client.Find("users", map[string]any{
"age": map[string]any{"$gte": 25},
}, nil)
.NET (EF Core)
// Configure in Program.cs
builder.Services.AddOxiDb(options => {
options.UseTcp("127.0.0.1", 4444);
// or: options.UseEmbedded("./data");
});
// Use with EF Core
var users = await db.Users
.Where(u => u.Age >= 25)
.OrderBy(u => u.Name)
.ToListAsync();