A class for managing ArangoDB Databases

This class provides functions to manage Databases through ArangoDB's Database API

link https://docs.arangodb.com/HTTP/Database/index.html
package ArangoDBClient
since 1.4

 Methods

creates a database

create(\ArangoDBClient\Connection $connection, string $name) : array
Static

This creates a new database

link https://docs.arangodb.com/HTTP/Database/index.html

Parameters

$connection

\ArangoDBClient\Connection
  • the connection to be used

$name

string
  • the database specification, for example 'myDatabase'

Exceptions

\ArangoDBClient\Exception
\ArangoDBClient\ClientException

Returns

array$responseArray - The response array.

List databases

databases(\ArangoDBClient\Connection $connection) : array
Static

This will list the databases that exist on the server

link https://docs.arangodb.com/HTTP/Database/index.html

Parameters

$connection

\ArangoDBClient\Connection
  • the connection to be used

Exceptions

\ArangoDBClient\Exception
\ArangoDBClient\ClientException

Returns

array$responseArray - The response array.

Deletes a database

delete(\ArangoDBClient\Connection $connection, string $name) : array
Static

This will delete an existing database.

link https://docs.arangodb.com/HTTP/Database/index.html

Parameters

$connection

\ArangoDBClient\Connection
  • the connection to be used

$name

string
  • the database specification, for example 'myDatabase'

Exceptions

\ArangoDBClient\Exception
\ArangoDBClient\ClientException

Returns

array$responseArray - The response array.

Retrieves information about the current database

getInfo(\ArangoDBClient\Connection $connection) : array
Static

This will get information about the currently used database from the server

link https://docs.arangodb.com/HTTP/Database/index.html

Parameters

$connection

\ArangoDBClient\Connection
  • the connection to be used

Exceptions

\ArangoDBClient\Exception
\ArangoDBClient\ClientException

Returns

array$responseArray - The response array.

List databases

listDatabases(\ArangoDBClient\Connection $connection) : array
Static

This will list the databases that exist on the server

link https://docs.arangodb.com/HTTP/Database/index.html

Parameters

$connection

\ArangoDBClient\Connection
  • the connection to be used

Exceptions

\ArangoDBClient\Exception
\ArangoDBClient\ClientException

Returns

array$responseArray - The response array.

List user databases

listUserDatabases(\ArangoDBClient\Connection $connection) : array
Static

Retrieves the list of all databases the current user can access without specifying a different username or password.

link https://docs.arangodb.com/HTTP/Database/index.html

Parameters

$connection

\ArangoDBClient\Connection
  • the connection to be used

Exceptions

\ArangoDBClient\Exception
\ArangoDBClient\ClientException

Returns

array$responseArray - The response array.

 Constants

 

Databases index

ENTRY_DATABASE_NAME = 'name' 
 

Users index

ENTRY_DATABASE_USERS = 'users'