Files

30 lines
967 B
PHP
Raw Permalink Normal View History

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
/**
2026-10-11 23:50:53 -04:00
* The input is validated here. The name must already carry the server's "s{server_id}_"
* prefix (see DatabaseName::generateUnique()), and a database given no max_connections takes
* the column default.
2026-10-11 07:34:41 -04:00
*
2026-10-11 19:54:55 -04:00
* @param array<string, mixed> $input database, remote and database_host_id, and optionally max_connections
2026-10-11 07:34:41 -04:00
*
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
}