Arcadic.Server (Arcadic v0.1.0)

Copy Markdown View Source

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

Create a database. Validates name.

Create a database, raising on error.

Whether a database exists.

Drop a database. Validates name.

Drop a database, raising on error.

List all databases.

Server readiness.

Functions

create_database(conn, name)

@spec create_database(Arcadic.Conn.t(), String.t()) ::
  :ok | {:error, atom() | Exception.t()}

Create a database. Validates name.

create_database!(conn, name)

@spec create_database!(Arcadic.Conn.t(), String.t()) :: :ok

Create a database, raising on error.

database_exists?(conn, name)

@spec database_exists?(Arcadic.Conn.t(), String.t()) ::
  {:ok, boolean()} | {:error, atom() | Exception.t()}

Whether a database exists.

drop_database(conn, name)

@spec drop_database(Arcadic.Conn.t(), String.t()) ::
  :ok | {:error, atom() | Exception.t()}

Drop a database. Validates name.

drop_database!(conn, name)

@spec drop_database!(Arcadic.Conn.t(), String.t()) :: :ok

Drop a database, raising on error.

list_databases(conn)

@spec list_databases(Arcadic.Conn.t()) ::
  {:ok, [String.t()]} | {:error, Exception.t()}

List all databases.

ready?(conn)

@spec ready?(Arcadic.Conn.t()) :: {:ok, boolean()} | {:error, Exception.t()}

Server readiness.