Ruby
Requirements
Installation
gem install chrondbQuick Start
require "chrondb"
# Single path (preferred)
db = ChronDB::Client.new("./mydb")
# Save a document
db.put("user:1", { name: "Alice", age: 30 })
# Retrieve it
doc = db.get("user:1")
puts doc # {"name"=>"Alice", "age"=>30}API Reference
ChronDB::Client.new(db_path, idle_timeout: nil)
ChronDB::Client.new(db_path, idle_timeout: nil)Parameter
Type
Description
Legacy: ChronDB::Client.new(data_path, index_path, idle_timeout: nil)
ChronDB::Client.new(data_path, index_path, idle_timeout: nil)Parameter
Type
Description
put(id, doc, branch: nil) -> Hash
put(id, doc, branch: nil) -> HashParameter
Type
Description
get(id, branch: nil) -> Hash
get(id, branch: nil) -> Hashdelete(id, branch: nil) -> true
delete(id, branch: nil) -> truelist_by_prefix(prefix, branch: nil) -> Array<Hash>
list_by_prefix(prefix, branch: nil) -> Array<Hash>list_by_table(table, branch: nil) -> Array<Hash>
list_by_table(table, branch: nil) -> Array<Hash>history(id, branch: nil) -> Array<Hash>
history(id, branch: nil) -> Array<Hash>query(query, branch: nil) -> Hash
query(query, branch: nil) -> Hashexecute(sql, branch: nil) -> Hash
execute(sql, branch: nil) -> HashParameter
Type
Description
Error Handling
Examples
Full CRUD
Idle Timeout (long-running services)
SQL Queries
Query
History (Time Travel)
Last updated
Was this helpful?