Swift
Requirements
Installation
.package(url: "https://github.com/avelino/chrondb-swift", from: "0.1.0")Quick Start
import ChronDB
// Single path (preferred)
let db = try ChronDB.openPath(dbPath: "./mydb")
// Save a document
try db.put(id: "user:1", jsonDoc: #"{"name": "Alice", "age": 30}"#, branch: nil)
// Retrieve it
let doc = try db.get(id: "user:1", branch: nil)
print(doc) // {"name":"Alice","age":30}API Reference
ChronDB.openPath(dbPath:) throws -> ChronDB
ChronDB.openPath(dbPath:) throws -> ChronDBChronDB.open(dataPath:indexPath:) throws -> ChronDB (deprecated)
ChronDB.open(dataPath:indexPath:) throws -> ChronDB (deprecated)ChronDB.openWithIdleTimeout(dataPath:indexPath:idleTimeoutSecs:) throws -> ChronDB
ChronDB.openWithIdleTimeout(dataPath:indexPath:idleTimeoutSecs:) throws -> ChronDBOperations
Method
Description
Error Handling
Examples
SQL Queries
Idle Timeout
Last updated
Was this helpful?