Codeception / Codeception/module-mongodb

The restore command does not allow additional option flags

Aperta
#15 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
PHP
Stelle
2
Fork
11
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

HI there,

The connection to Drop the db takes the DSN as configured in the codeception.yml incl. any additional option flags sent over via the DSN string. So far so good.
But the restore command does only take the domain name and skips all the option flags.
Would be cool if there would be a new attribute, like "option flags" where we could add these to the codeception.yml.

Then in the Driver/MonogoDB.php Something like this:

private string $options;

// where this could be something like "--writeConcern" etc.
......
public function loadFromMongoDump(string $dumpFile): void
{
[$host, $port] = $this->getHostPort();
$cmd = sprintf(
"mongorestore %s --host %s --port %s %s -d %s %s %s",
$this->quiet,
$host,
$port,
$this->dbName,
$this->options
$this->createUserPasswordCmdString(),
escapeshellarg($dumpFile)
);
shell_exec($cmd);
}

Is this feasable?
Or is there another way to do this with the code as is already?
Thanks for any feedbak.

gb5256

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.