Rust
Requirements
Stack Size (Handled Automatically)
Installation
cargo add chrondbNative shared library
Configure the runtime library path
Library path (advanced)
Quick Start
API Reference
ChronDB::open_path(db_path) -> Result<ChronDB>
ChronDB::open_path(db_path) -> Result<ChronDB>Parameter
Type
Description
ChronDB::open(data_path, index_path) -> Result<ChronDB> (deprecated)
ChronDB::open(data_path, index_path) -> Result<ChronDB> (deprecated)Parameter
Type
Description
ChronDB::builder(data_path, index_path) -> ChronDBBuilder
ChronDB::builder(data_path, index_path) -> ChronDBBuilderParameter
Type
Description
ChronDBBuilder::idle_timeout(duration) -> Self
ChronDBBuilder::idle_timeout(duration) -> SelfParameter
Type
Description
ChronDBBuilder::open() -> Result<ChronDB>
ChronDBBuilder::open() -> Result<ChronDB>Example
put(&self, id, doc, branch) -> Result<serde_json::Value>
put(&self, id, doc, branch) -> Result<serde_json::Value>Parameter
Type
Description
get(&self, id, branch) -> Result<serde_json::Value>
get(&self, id, branch) -> Result<serde_json::Value>Parameter
Type
Description
delete(&self, id, branch) -> Result<()>
delete(&self, id, branch) -> Result<()>Parameter
Type
Description
list_by_prefix(&self, prefix, branch) -> Result<serde_json::Value>
list_by_prefix(&self, prefix, branch) -> Result<serde_json::Value>Parameter
Type
Description
list_by_table(&self, table, branch) -> Result<serde_json::Value>
list_by_table(&self, table, branch) -> Result<serde_json::Value>Parameter
Type
Description
history(&self, id, branch) -> Result<serde_json::Value>
history(&self, id, branch) -> Result<serde_json::Value>Parameter
Type
Description
query(&self, query, branch) -> Result<serde_json::Value>
query(&self, query, branch) -> Result<serde_json::Value>Parameter
Type
Description
execute_sql(&self, sql, branch) -> Result<serde_json::Value>
execute_sql(&self, sql, branch) -> Result<serde_json::Value>Parameter
Type
Description
last_error(&self) -> Option<String>
last_error(&self) -> Option<String>Drop
DropDocument ID Convention
Error Handling
ChronDBError Enum
ChronDBError EnumConversion
Example
Examples
Full CRUD
Query
History (Time Travel)
SQL Queries
Using with Drop (automatic cleanup)
Drop (automatic cleanup)Idle Timeout (long-running services)
Building from Source
build.rs Behavior
build.rs BehaviorLast updated
Was this helpful?