ArangoDB's Databases operations.
Every function takes the pool as its first argument and returns the decoded
response body. See Arangox.API.Client for the options they all accept and
for what a 404 returns.
Summary
Functions
List all databases
List all databases. Raises on error.
List the accessible databases
List the accessible databases. Raises on error.
Create a database
Create a database. Raises on error.
Get information about the current database
Get information about the current database. Raises on error.
Drop a database
Drop a database. Raises on error.
Functions
@spec all( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
List all databases
Retrieves the list of all existing databases
INFO: Retrieving the list of databases is only possible from within the
_systemdatabase.
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => [string]
}
@spec all!( Arangox.conn(), keyword() ) :: term()
List all databases. Raises on error.
See all/1.
@spec all_user_accessible( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
List the accessible databases
Retrieves the list of all databases the current user can access without specifying a different username or password.
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => [string]
}
@spec all_user_accessible!( Arangox.conn(), keyword() ) :: term()
List the accessible databases. Raises on error.
@spec create(Arangox.conn(), term(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Create a database
Creates a new database.
The response is a JSON object with the attribute result set to true.
INFO: Creating a new database is only possible from within the
_systemdatabase.
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => boolean
}
@spec create!(Arangox.conn(), term(), keyword()) :: term()
Create a database. Raises on error.
See create/2.
@spec current( Arangox.conn(), keyword() ) :: {:ok, term()} | {:error, Exception.t()}
Get information about the current database
Retrieves the properties of the current database
The response is a JSON object with the following attributes:
name: the name of the current databaseid: the id of the current databasepath: the filesystem path of the current databaseisSystem: whether or not the current database is the_systemdatabasesharding: the default sharding method for collections created in this databasereplicationFactor: the default replication factor for collections in this databasewriteConcern: the default write concern for collections in this database
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => %{
"id" => string,
"isSystem" => boolean,
"name" => string,
"path" => string
}
}
@spec current!( Arangox.conn(), keyword() ) :: term()
Get information about the current database. Raises on error.
See current/1.
@spec delete(Arangox.conn(), binary(), keyword()) :: {:ok, term()} | {:error, Exception.t()}
Drop a database
Drops the database along with all data stored in it.
INFO: Dropping a database is only possible from within the
_systemdatabase. The_systemdatabase itself cannot be dropped.
Returns
Recorded against ArangoDB 3.12.10:
%{
"code" => integer,
"error" => boolean,
"result" => boolean
}
@spec delete!(Arangox.conn(), binary(), keyword()) :: term()
Drop a database. Raises on error.
See delete/2.