Documentation
¶
Overview ¶
Package badgerdb is the BadgerDB embedded key-value plugin. Scripts import it as scriptling.badger:
import scriptling.badger as badger
db = badgerdb.open("/var/data/state")
db.set("greeting", "hello", ttl_seconds=60)
print(db.get("greeting"))
db.close()
The API mirrors the valkey plugin exactly, so scripts move between a shared cache and local storage unchanged. The directory must fall inside the host's allowed paths. The same library serves external plugin mode (plugins/badgerdb/cmd) and compiled-in registration (build tag plugin_badgerdb).
Badger allows a single process to open a database; opening the same directory twice fails on its lock file, by design.
Index ¶
Constants ¶
const Description = "BadgerDB embedded key-value store"
Description is the plugin metadata description.
const OpenSource = `def open(path):
return Client(path)
`
OpenSource is the scriptling-source wrapper for open() in external plugin mode, where a Go function cannot return an instance over the wire: it constructs the Client class through the plugin object protocol.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.