- Added caching mechanism as an event listener
This commit is contained in:
1 parent
b601939459
commit
9eed2fe1a8
25 files changed
+607
-402
No files matched your search
@@ -7,6 +7,9 @@ use Ulmus\Query\QueryFragmentInterface;
|
||||
# TODO -> Extract from MysqlQueryBuilder to build an ISO/IEC 9075:2023 compatible layer for a basic SQL QueryBuilder
|
||||
class SqlQueryBuilder implements QueryBuilderInterface
|
||||
{
|
||||
protected string $rendered;
|
||||
|
||||
protected string $hash;
|
||||
|
||||
public function push(QueryFragmentInterface $queryFragment): QueryBuilderInterface
|
||||
{
|
||||
@@ -18,7 +21,7 @@ class SqlQueryBuilder implements QueryBuilderInterface
|
||||
// TODO: Implement pull() method.
|
||||
}
|
||||
|
||||
public function render(bool $skipToken = false)
|
||||
public function render(bool $skipToken = false) : mixed
|
||||
{
|
||||
// TODO: Implement render() method.
|
||||
}
|
||||
@@ -37,4 +40,9 @@ class SqlQueryBuilder implements QueryBuilderInterface
|
||||
{
|
||||
// TODO: Implement removeFragment() method.
|
||||
}
|
||||
|
||||
public function hashSerializedQuery(): string
|
||||
{
|
||||
return $this->hash ??= md5(sprintf("%s:%s", $this->render(), serialize($this->parameters)));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user