Kotlin
Requirements
Installation
dependencies {
implementation("run.avelino.chrondb:chrondb:0.1.0")
}Quick Start
import chrondb.ChronDB
import org.json.JSONObject
// Single path (preferred)
val db = ChronDB.openPath("./mydb")
// Save a document
val doc = JSONObject().put("name", "Alice").put("age", 30)
db.put("user:1", doc.toString(), null)
// Retrieve it
val result = db.get("user:1", null)
println(result) // {"name":"Alice","age":30}API Reference
ChronDB.openPath(dbPath: String): ChronDB
ChronDB.openPath(dbPath: String): ChronDBChronDB.open(dataPath: String, indexPath: String): ChronDB (deprecated)
ChronDB.open(dataPath: String, indexPath: String): ChronDB (deprecated)ChronDB.openWithIdleTimeout(dataPath: String, indexPath: String, idleTimeoutSecs: ULong): ChronDB
ChronDB.openWithIdleTimeout(dataPath: String, indexPath: String, idleTimeoutSecs: ULong): ChronDBOperations
Method
Description
Error Handling
Examples
SQL Queries
Idle Timeout
Last updated
Was this helpful?