barrel_server_dbs (barrel_server v1.5.0)
View SourceServer-side database access: a thin, stateless shim over Barrel's database lifecycle manager (barrel_dbs), which owns the open handles, touches them on use, closes idle ones, and bounds the open set. This module adds only the HTTP concerns: name validation and the server-wide open options from the app env.
Summary
Functions
Fork Parent into BranchName. Opts: at => now | HlcT.
Close and forget the database Name. Idempotent.
Destroy the database Name: close it and delete its files.
Return the (possibly newly opened) handle for Name.
Same as ensure/1, with Opts (e.g. #{docdb => #{att_opts => ...}}) merged over the server-wide open_opts() baseline -- only takes effect on a cold open (genuinely new, or reopened after being closed): an already-open Name short-circuits in barrel_dbs before Opts is ever consulted.
Names of the currently open databases.
Functions
Fork Parent into BranchName. Opts: at => now | HlcT.
-spec close(binary()) -> ok.
Close and forget the database Name. Idempotent.
Destroy the database Name: close it and delete its files.
Return the (possibly newly opened) handle for Name.
Same as ensure/1, with Opts (e.g. #{docdb => #{att_opts => ...}}) merged over the server-wide open_opts() baseline -- only takes effect on a cold open (genuinely new, or reopened after being closed): an already-open Name short-circuits in barrel_dbs before Opts is ever consulted.
-spec list() -> [binary()].
Names of the currently open databases.