Codeception / Codeception/module-mongodb

The restore command does not allow additional option flags

未关闭
#15 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
2
派生
11
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。