Expand description
Core database engine for Syna.
This module contains the main database implementation:
SynaDB- The core database structDbConfig- Runtime configuration options- Global registry functions:
open_db,close_db,with_db
§Usage Patterns
§Direct Instance (Recommended for Rust)
use synadb::{SynaDB, Atom};
let mut db = SynaDB::new("my.db").unwrap();
db.append("key", Atom::Int(42)).unwrap();§Global Registry (Used by FFI)
use synadb::{open_db, with_db, close_db, Atom};
open_db("my.db").unwrap();
with_db("my.db", |db| db.append("key", Atom::Int(42))).unwrap();
close_db("my.db").unwrap();Structs§
- DbConfig
- Runtime configuration for the database.
- SynaDB
- The core database struct managing file I/O and indexing.
Functions§
- close_
db - Closes a database and removes it from the global registry.
- free_
tensor ⚠ - Frees memory allocated by
get_history_tensor(). - open_db
- Opens a database at the given path and registers it in the global registry.
- open_
db_ with_ config - Opens a database with custom configuration and registers it in the global registry.
- with_db
- Executes a closure with a mutable reference to the database at the given path.