$db = $client->getModuleDatabase('admin');The database module works on the databases of one user, given when you get the module.
$db->add('database', 'dbuser', 'dbpass'); // creates admin_database with the user admin_dbuser
$db->add('database', 'dbuser', 'dbpass', 'pgsql'); // PostgreSQL, if it is installed on the serverThe type defaults to mysql.
$db->listDatabases(); // ['admin_database' => ['DATABASE' => '...', 'DBUSER' => '...', ...], ...]
$db->listDatabase('admin_database'); // the fields of one database$db->changePassword('admin_database', 'newPa$$word'); // the password of the database user$db->suspend('admin_database');
$db->unsuspend('admin_database');$db->delete('admin_database'); // one database
$db->deleteDatabases(); // every database of the userHestiaCP prefixes the database name and the database user with the owner's username. add() takes the names without the prefix (database); the other methods take the full name (admin_database).
All methods except the list*() methods return true on success and throw an exception on failure (see Error handling).