DatabaseHandler
extends ManagesConnection
in package
Manages databases on Arango server
Tags
Table of Contents
Methods
- create() : bool
- Creates a new database on server
- current() : array<string|int, mixed>
- Returns information about the current database
- drop() : bool
- Drops a database from server
- getConnection() : Connection
- Return the connection object
- list() : ArrayList
- Lists databases that exists on server
- setConnection() : void
- Sets a connection for class.
- userDatabases() : ArrayList
- Lists the databases that current user has access
Methods
create()
Creates a new database on server
public
static create(Connection $connection, string $database) : bool
Parameters
- $connection : Connection
-
Connection object to be used
- $database : string
-
Database name
Tags
Return values
bool —True if database was successfully created on server. Throw an exception otherwise.
current()
Returns information about the current database
public
static current(Connection $connection) : array<string|int, mixed>
Parameters
- $connection : Connection
-
Connection object to be used
Tags
Return values
array<string|int, mixed> —An array with information about database.
drop()
Drops a database from server
public
static drop(Connection $connection, string $database) : bool
Parameters
- $connection : Connection
-
Connection object to be used
- $database : string
-
Database name
Tags
Return values
bool —True if database was successfully dropped on server. Throw an exception otherwise.
getConnection()
Return the connection object
public
getConnection() : Connection
Return values
Connectionlist()
Lists databases that exists on server
public
static list(Connection $connection) : ArrayList
Parameters
- $connection : Connection
-
Connection object to be used
Tags
Return values
ArrayList —A list with all databases on server.
setConnection()
Sets a connection for class.
public
setConnection(Connection $connection) : void
Parameters
- $connection : Connection
-
Connection object to use.
userDatabases()
Lists the databases that current user has access
public
static userDatabases(Connection $connection) : ArrayList
Parameters
- $connection : Connection
-
Connection object to be used
Tags
Return values
ArrayList —A list with all databases on server that current user has access.