2026-10-05 18:10:18 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace Pterodactyl\Contracts\Databases;
|
|
|
|
|
|
|
|
|
|
use Pterodactyl\Exceptions\Service\Database\DatabaseClientFeatureNotEnabledException;
|
|
|
|
|
use Pterodactyl\Exceptions\Service\Database\TooManyDatabasesException;
|
|
|
|
|
use Pterodactyl\Models\Database;
|
|
|
|
|
use Pterodactyl\Models\Server;
|
|
|
|
|
use Throwable;
|
|
|
|
|
|
|
|
|
|
interface CreatesDatabases
|
|
|
|
|
{
|
|
|
|
|
public function setValidateDatabaseLimit(bool $validate): self;
|
|
|
|
|
|
2026-10-11 07:34:41 -04:00
|
|
|
/**
|
|
|
|
|
* Create a database for a server on the given database host. The input is validated here,
|
|
|
|
|
* so it can come straight from any caller. The name must already carry the server's
|
|
|
|
|
* "s{server_id}_" prefix (see DatabaseName::generateUnique()); a database given no
|
|
|
|
|
* max_connections takes the column default.
|
|
|
|
|
*
|
|
|
|
|
* @param ActionInput $input database, remote and database_host_id, and optionally max_connections
|
|
|
|
|
*
|
2026-10-05 18:10:18 -04:00
|
|
|
* @throws Throwable
|
|
|
|
|
* @throws TooManyDatabasesException
|
|
|
|
|
* @throws DatabaseClientFeatureNotEnabledException
|
|
|
|
|
*/
|
2026-10-11 07:34:41 -04:00
|
|
|
public function create(Server $server, array $input): Database;
|
2026-10-05 18:10:18 -04:00
|
|
|
}
|