Closed qihuajun closed 2 years ago
this method was added much later than the implementation of the clickhouse component
the setCommandCache method was needed only for this case
$query = new Query;
$query->cache(10);
$command = $query->createCommand();
var_dump($command->queryCacheDuration); // 10
Now, it should work.
Working with the cache is the same as in a standard component
// QueryBuilder
$dd = new kak\clickhouse\Query();
// ...
$dd->cache(5);
$dd->all();
// DAO
$dd = $db->createCommand($sql);
$dd->cache(5);
// ...
$dd->queryAll();
@sanchezzzhak Thanks!
When creating query command, this component's code disable cache.
Here is the code in
\yii\db\Query
:the code in
\kak\clickhouse\Query
:Are there any problems about this component's supporting for query cache?