public function getDumpCommand(string $dumpFile) : string
{
$command = ["'{$this->dumpBinaryPath}pg_dump'", "-U {$this->userName}", '-h ' . ($this->socket === '' ? $this->host : $this->socket), "-p {$this->port}", "--file=\"{$dumpFile}\""];
if ($this->useInserts) {
$command[] = '--inserts';
}
foreach ($this->extraOptions as $extraOption) {
$command[] = $extraOption;
}
if (!empty($this->includeTables)) {
$command[] = '-t ' . implode(' -t ', $this->includeTables);
}
if (!empty($this->excludeTables)) {
$command[] = '-T ' . implode(' -T ', $this->excludeTables);
}
return implode(' ', $command);
}