@@ -179,7 +179,7 @@ public function reset(): void
179
179
public function begin (?string $ database , ?float $ timeout , BookmarkHolder $ holder ): void
180
180
{
181
181
$ this ->consumeResults ();
182
- $ extra = $ this ->buildRunExtra ($ database , $ timeout , $ holder );
182
+ $ extra = $ this ->buildRunExtra ($ database , $ timeout , $ holder, AccessMode:: WRITE () );
183
183
184
184
$ response = $ this ->protocol ()
185
185
->begin ($ extra )
@@ -211,9 +211,9 @@ public function discard(?int $qid): void
211
211
*
212
212
* @return BoltMeta
213
213
*/
214
- public function run (string $ text , array $ parameters , ?string $ database , ?float $ timeout , BookmarkHolder $ holder ): array
214
+ public function run (string $ text , array $ parameters , ?string $ database , ?float $ timeout , BookmarkHolder $ holder, ? AccessMode $ mode ): array
215
215
{
216
- $ extra = $ this ->buildRunExtra ($ database , $ timeout , $ holder );
216
+ $ extra = $ this ->buildRunExtra ($ database , $ timeout , $ holder, $ mode );
217
217
$ response = $ this ->protocol ()->run ($ text , $ parameters , $ extra )
218
218
->getResponse ();
219
219
@@ -293,7 +293,7 @@ public function __destruct()
293
293
}
294
294
}
295
295
296
- private function buildRunExtra (?string $ database , ?float $ timeout , BookmarkHolder $ holder ): array
296
+ private function buildRunExtra (?string $ database , ?float $ timeout , BookmarkHolder $ holder, ? AccessMode $ mode ): array
297
297
{
298
298
$ extra = [];
299
299
if ($ database ) {
@@ -307,6 +307,10 @@ private function buildRunExtra(?string $database, ?float $timeout, BookmarkHolde
307
307
$ extra ['bookmarks ' ] = $ holder ->getBookmark ()->values ();
308
308
}
309
309
310
+ if ($ mode ) {
311
+ $ extra ['mode ' ] = AccessMode::WRITE () === $ mode ? 'w ' : 'r ' ;
312
+ }
313
+
310
314
return $ extra ;
311
315
}
312
316
0 commit comments