Skip to main content

Module engine

Module engine 

Source
Expand description

Core database engine for Syna.

This module contains the main database implementation:

§Usage Patterns

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.