feat: add Client::insertPayload()
and slightly refactor sql logging
#1460
Annotations
6 warnings
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Run Infection:
src/Client/Http/RequestFactory.php#L39
Escaped Mutant for Mutator "Identical":
@@ @@
/** @throws InvalidArgumentException */
public function __construct(private ParamValueConverterRegistry $paramValueConverterRegistry, private RequestFactoryInterface $requestFactory, private StreamFactoryInterface $streamFactory, UriFactoryInterface|null $uriFactory = null, UriInterface|string $uri = '')
{
- if ($uriFactory === null && $uri === '') {
+ if ($uriFactory !== null && $uri === '') {
$uri = null;
} elseif (is_string($uri)) {
if ($uriFactory === null) {
|
Run Infection:
src/Client/PsrClickHouseClient.php#L215
Escaped Mutant for Mutator "Identical":
@@ @@
{
$formatSql = $inputFormat::toSql();
$table = Escaper::quoteIdentifier($table);
- $columnsSql = $columns === [] ? '' : sprintf('(%s)', implode(',', $columns));
+ $columnsSql = $columns !== [] ? '' : sprintf('(%s)', implode(',', $columns));
$sql = <<<CLICKHOUSE
INSERT INTO {$table} {$columnsSql} {$formatSql}
CLICKHOUSE;
|
Run Infection:
src/Exception/ServerError.php#L20
Escaped Mutant for Mutator "PregMatchRemoveCaret":
@@ @@
public static function fromResponse(ResponseInterface $response): self
{
$bodyContent = $response->getBody()->__toString();
- return new self($bodyContent, code: preg_match('~^Code: (\d+). DB::Exception:~', $bodyContent, $matches) === 1 ? (int) $matches[1] : 0);
+ return new self($bodyContent, code: preg_match('~Code: (\d+). DB::Exception:~', $bodyContent, $matches) === 1 ? (int) $matches[1] : 0);
}
}
|
Run Infection:
src/Exception/ServerError.php#L20
Escaped Mutant for Mutator "DecrementInteger":
@@ @@
public static function fromResponse(ResponseInterface $response): self
{
$bodyContent = $response->getBody()->__toString();
- return new self($bodyContent, code: preg_match('~^Code: (\d+). DB::Exception:~', $bodyContent, $matches) === 1 ? (int) $matches[1] : 0);
+ return new self($bodyContent, code: preg_match('~^Code: (\d+). DB::Exception:~', $bodyContent, $matches) === 1 ? (int) $matches[1] : -1);
}
}
|
Run Infection:
src/Sql/ValueFormatter.php#L103
Escaped Mutant for Mutator "UnwrapArrayMap":
@@ @@
$firstValue = $value[array_key_first($value)];
$mapper = is_array($firstValue) ? function ($value): string {
assert(is_array($value));
- return sprintf('(%s)', implode(',', array_map(fn($val) => $this->format($val), $value)));
+ return sprintf('(%s)', implode(',', $value));
} : fn($value): string => $value === null ? 'NULL' : $this->format($value);
return implode(',', array_map($mapper, $value));
}
|
Loading