fix(db): Fix Oracle JSON handling

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2025-11-18 10:19:04 +01:00
parent 4676b12a32
commit 60bfab2421
No known key found for this signature in database
GPG key ID: F72FA5B49FFA96B0

View file

@ -27,6 +27,32 @@ class OCIExpressionBuilder extends ExpressionBuilder {
return parent::prepareColumn($column, $type);
}
/**
* @inheritdoc
*/
public function eq($x, $y, $type = null): string {
if ($type === IQueryBuilder::PARAM_JSON) {
$x = $this->prepareColumn($x, $type);
$y = $this->prepareColumn($y, $type);
return (string)(new QueryFunction('JSON_EQUAL(' . $x . ',' . $y . ')'));
}
return parent::eq($x, $y, $type);
}
/**
* @inheritdoc
*/
public function neq($x, $y, $type = null): string {
if ($type === IQueryBuilder::PARAM_JSON) {
$x = $this->prepareColumn($x, $type);
$y = $this->prepareColumn($y, $type);
return (string)(new QueryFunction('NOT JSON_EQUAL(' . $x . ',' . $y . ')'));
}
return parent::neq($x, $y, $type);
}
/**
* @inheritdoc
*/