File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,11 @@ class Session
65
65
*/
66
66
protected $ is_alive = false ;
67
67
68
+ /**
69
+ * @var bool
70
+ */
71
+ protected $ keep_query_in_cache = false ;
72
+
68
73
/**
69
74
* @param Table $table
70
75
* @param string $session_id
@@ -295,6 +300,17 @@ public function rollBack()
295
300
return $ this ->rollbackTransaction ();
296
301
}
297
302
303
+ /**
304
+ * Set whether to keep query in cache.
305
+ *
306
+ * @return $this
307
+ */
308
+ public function keepInCache ($ value = true )
309
+ {
310
+ $ this ->keep_query_in_cache = (bool )$ value ;
311
+ return $ this ;
312
+ }
313
+
298
314
/**
299
315
* @param string $yql
300
316
* @param array|null $parameters
@@ -326,7 +342,9 @@ public function query($yql, array $parameters = null)
326
342
// 'commit_tx' => true,
327
343
]);
328
344
329
- $ query_cache_policy = new QueryCachePolicy ;
345
+ $ query_cache_policy = new QueryCachePolicy ([
346
+ 'keep_in_cache ' => $ this ->keep_query_in_cache ,
347
+ ]);
330
348
331
349
$ data = [
332
350
'session_id ' => $ this ->session_id ,
You can’t perform that action at this time.
0 commit comments