From 813b50ed428a8bc36817d19c84444e96dbe3b668 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 28 Apr 2022 15:15:39 +0200 Subject: make expression build return IQueryFunction instead of string this allows passing the expressions to further expressions without them being escaped as column names Signed-off-by: Robin Appelman --- .../ExpressionBuilder/SqliteExpressionBuilder.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/private/DB/QueryBuilder/ExpressionBuilder/SqliteExpressionBuilder.php') diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/SqliteExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/SqliteExpressionBuilder.php index 289aa09b003..5425138fa6c 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/SqliteExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/SqliteExpressionBuilder.php @@ -23,15 +23,18 @@ */ namespace OC\DB\QueryBuilder\ExpressionBuilder; +use OC\DB\QueryBuilder\QueryFunction; +use OCP\DB\QueryBuilder\IQueryFunction; + class SqliteExpressionBuilder extends ExpressionBuilder { /** * @inheritdoc */ - public function like($x, $y, $type = null): string { - return parent::like($x, $y, $type) . " ESCAPE '\\'"; + public function like($x, $y, $type = null): IQueryFunction { + return new QueryFunction(parent::like($x, $y, $type) . " ESCAPE '\\'"); } - public function iLike($x, $y, $type = null): string { - return $this->like($this->functionBuilder->lower($x), $this->functionBuilder->lower($y), $type); + public function iLike($x, $y, $type = null): IQueryFunction { + return new QueryFunction($this->like($this->functionBuilder->lower($x), $this->functionBuilder->lower($y), $type)); } } -- cgit v1.2.3