Arex.Database (arex v0.1.0)

Copy Markdown View Source

Database-level administrative helpers.

These functions operate on ArcadeDB databases themselves rather than records inside a database. They are typically used in setup, provisioning, test workflows, and lightweight operational inspection.

Reach for this module when you need to create or drop databases, check server visibility, or collect a compact type summary for a target database.

This module stays narrow on purpose. It does not try to expose every server-level administrative operation, only the ones that are common in test setup, local development, and operational checks.

Summary

Functions

Creates a database and returns {:ok, :created} on success.

Drops a database when it exists.

Returns whether the named database exists.

Lists database names visible to the configured ArcadeDB server credentials.

Returns a lightweight summary for the current database in opts.

Returns a lightweight summary for the named database.

Functions

create(name, opts \\ [])

Creates a database and returns {:ok, :created} on success.

The database name is validated before the command is sent to ArcadeDB.

drop(name, opts \\ [])

Drops a database when it exists.

Returns {:ok, :missing} when the database does not exist.

exists?(name, opts \\ [])

Returns whether the named database exists.

This checks the server-scoped existence endpoint rather than querying inside the database.

list(opts \\ [])

Lists database names visible to the configured ArcadeDB server credentials.

stats(opts)

Returns a lightweight summary for the current database in opts.

The result includes :type_count and the raw type rows returned from schema:types.

stats(name, opts)

Returns a lightweight summary for the named database.

This variant injects db: name into the query options before loading schema:types.