fix dashes on the name and better error handling (#336)

This commit is contained in:
Saeed Vaziry
2024-11-02 22:44:02 +01:00
committed by GitHub
parent f743611b22
commit 6639fac9c0
16 changed files with 53 additions and 96 deletions

View File

@ -2,10 +2,26 @@
namespace App\SSH\Services\Database;
use App\Exceptions\SSHError;
class Postgresql extends AbstractDatabase
{
protected function getScriptsDir(): string
{
return 'postgresql';
}
/**
* @throws SSHError
*/
public function create(string $name): void
{
$this->service->server->ssh()->exec(
$this->getScript($this->getScriptsDir().'/create.sh', [
'name' => $name,
'ssh_user' => $this->service->server->ssh_user,
]),
'create-database'
);
}
}