Skip to content

database

A per-script persistent key/value store, JSON-encoded on top of the script’s storage directory. 64 KiB per script. Values survive unload and reload.

database.read(key: string): any

Argument Type Description
key string The key.

Reads key. Returns the stored value, or nil when it is absent.

database.write(key: string, value: any): boolean|nil

Argument Type Description
key string The key.
value any Any JSON-encodable value.

Writes value under key. Returns true on success, or nil on failure.