Server-level admin: create/drop/list databases, existence, readiness. Every
identifier is allowlist-validated BEFORE any request reaches the wire (fixes the
interpolation surface a hand-written create database <name> would open). Returns
are tagged tuples — a transport failure is never swallowed into a bare boolean.
Not delegated from the Arcadic facade: destructive admin stays namespaced.
Summary
Functions
Cluster-realign a database. CLUSTER-ONLY — a single-server node returns a server error
(java.lang.UnsupportedOperationException, surfaced as {:error, %Arcadic.Error{reason: :server_error}}).
Validates name.
Run CHECK DATABASE [FIX] on conn.database. fix: true repairs. Returns the integrity map.
Close an open database on the server. Validates name.
Create a database. Validates name.
Create a database, raising on error.
Whether a database exists.
Database-level info for conn.database — %{database, type, records, classes, size_bytes}. Fields a
transport can't cheaply provide are nil (HTTP gives name/size; gRPC gives all). :not_supported on
a transport without the callback (e.g. Bolt).
Drop a database. Validates name.
Drop a database, raising on error.
Server event log map (%{"events" => [...], "files" => [...]}).
Liveness probe (GET /api/v1/health → 204).
Server info map. :mode ∈ [:basic, :default, :cluster] (default :basic); :default/:cluster add metrics/settings.
List all databases.
The server metrics map (info(conn, mode: :default)["metrics"]).
Open a closed database on the server. Validates name.
Control the server profiler. action ∈ [:results, :start, :stop, :reset].
Server readiness.
Set a setting on conn.database (set database setting <db> `k` `v`). Guards as set_server_setting/3.
Set a server-level setting (set server setting `k` `v`). key is allowlist-validated
(dotted); value must not contain a backtick, backslash, or control character (the backtick-quoting
and escape context) — non-ASCII printable values are allowed. Both are rejected value-free
({:error, :invalid_setting_key | :invalid_setting_value}).
Shut the server down (shutdown). DESTRUCTIVE — halts shared infrastructure. The server stops
responding mid-request, so a SUCCESSFUL shutdown typically surfaces as
{:error, %Arcadic.TransportError{reason: :closed}} (connection reset), not :ok — treat a
transport-closed error here as success, not a retryable failure.
Functions
@spec align_database(Arcadic.Conn.t(), String.t()) :: {:ok, map()} | {:error, atom() | Exception.t()}
Cluster-realign a database. CLUSTER-ONLY — a single-server node returns a server error
(java.lang.UnsupportedOperationException, surfaced as {:error, %Arcadic.Error{reason: :server_error}}).
Validates name.
@spec align_database!(Arcadic.Conn.t(), String.t()) :: map()
@spec check_database( Arcadic.Conn.t(), keyword() ) :: {:ok, map()} | {:error, Exception.t()}
Run CHECK DATABASE [FIX] on conn.database. fix: true repairs. Returns the integrity map.
@spec check_database!( Arcadic.Conn.t(), keyword() ) :: map()
@spec close_database(Arcadic.Conn.t(), String.t()) :: :ok | {:error, atom() | Exception.t()}
Close an open database on the server. Validates name.
@spec close_database!(Arcadic.Conn.t(), String.t()) :: :ok
@spec create_database(Arcadic.Conn.t(), String.t()) :: :ok | {:error, atom() | Exception.t()}
Create a database. Validates name.
@spec create_database!(Arcadic.Conn.t(), String.t()) :: :ok
Create a database, raising on error.
@spec database_exists?(Arcadic.Conn.t(), String.t()) :: {:ok, boolean()} | {:error, atom() | Exception.t()}
Whether a database exists.
@spec database_info(Arcadic.Conn.t()) :: {:ok, map()} | {:error, atom() | Exception.t()}
Database-level info for conn.database — %{database, type, records, classes, size_bytes}. Fields a
transport can't cheaply provide are nil (HTTP gives name/size; gRPC gives all). :not_supported on
a transport without the callback (e.g. Bolt).
@spec drop_database(Arcadic.Conn.t(), String.t()) :: :ok | {:error, atom() | Exception.t()}
Drop a database. Validates name.
@spec drop_database!(Arcadic.Conn.t(), String.t()) :: :ok
Drop a database, raising on error.
@spec events(Arcadic.Conn.t()) :: {:ok, map()} | {:error, Exception.t()}
Server event log map (%{"events" => [...], "files" => [...]}).
@spec events!(Arcadic.Conn.t()) :: map()
@spec health?(Arcadic.Conn.t()) :: {:ok, boolean()} | {:error, Exception.t()}
Liveness probe (GET /api/v1/health → 204).
@spec info( Arcadic.Conn.t(), keyword() ) :: {:ok, map()} | {:error, Exception.t()}
Server info map. :mode ∈ [:basic, :default, :cluster] (default :basic); :default/:cluster add metrics/settings.
@spec info!( Arcadic.Conn.t(), keyword() ) :: map()
@spec list_databases(Arcadic.Conn.t()) :: {:ok, [String.t()]} | {:error, Exception.t()}
List all databases.
@spec metrics(Arcadic.Conn.t()) :: {:ok, map()} | {:error, Exception.t()}
The server metrics map (info(conn, mode: :default)["metrics"]).
@spec metrics!(Arcadic.Conn.t()) :: map()
@spec open_database(Arcadic.Conn.t(), String.t()) :: :ok | {:error, atom() | Exception.t()}
Open a closed database on the server. Validates name.
@spec open_database!(Arcadic.Conn.t(), String.t()) :: :ok
@spec profiler(Arcadic.Conn.t(), atom()) :: {:ok, map()} | {:error, Exception.t()}
Control the server profiler. action ∈ [:results, :start, :stop, :reset].
@spec profiler!(Arcadic.Conn.t(), atom()) :: map()
@spec ready?(Arcadic.Conn.t()) :: {:ok, boolean()} | {:error, Exception.t()}
Server readiness.
@spec set_database_setting(Arcadic.Conn.t(), String.t(), String.t()) :: :ok | {:error, atom() | Exception.t()}
Set a setting on conn.database (set database setting <db> `k` `v`). Guards as set_server_setting/3.
@spec set_database_setting!(Arcadic.Conn.t(), String.t(), String.t()) :: :ok
@spec set_server_setting(Arcadic.Conn.t(), String.t(), String.t()) :: :ok | {:error, atom() | Exception.t()}
Set a server-level setting (set server setting `k` `v`). key is allowlist-validated
(dotted); value must not contain a backtick, backslash, or control character (the backtick-quoting
and escape context) — non-ASCII printable values are allowed. Both are rejected value-free
({:error, :invalid_setting_key | :invalid_setting_value}).
@spec set_server_setting!(Arcadic.Conn.t(), String.t(), String.t()) :: :ok
@spec shutdown(Arcadic.Conn.t()) :: :ok | {:error, Exception.t()}
Shut the server down (shutdown). DESTRUCTIVE — halts shared infrastructure. The server stops
responding mid-request, so a SUCCESSFUL shutdown typically surfaces as
{:error, %Arcadic.TransportError{reason: :closed}} (connection reset), not :ok — treat a
transport-closed error here as success, not a retryable failure.
@spec shutdown!(Arcadic.Conn.t()) :: :ok