You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For count() function possible to use user-defined DQL function like this:
<?php
namespace Trim\Clickhouse\DQL;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
/**
* ROWS_COUNT(str)
* "ROWS_COUNT" "(" ")".
*/
class RowsCountFunction extends FunctionNode
{
public function getSql(SqlWalker $sqlWalker)
{
return 'COUNT(*)';
}
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER); // ROWS_COUNT
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
But yeah, yet I didn't found a way how to remove aliases from ORM query builder. I tried just to specify alias as empty string, but got other ORM error, like expected end of string, but got other.
Hello,
I tried to create a query using QueryBuilder, but got error:
The code which produces this error:
It produces DQL:
SELECT count(c) FROM Trim\Clickhouse\Model\ClickStat c WHERE c.link = :link_id
Can you suggest where there is an error?
Btw, example with the connection use is working:
The text was updated successfully, but these errors were encountered: