@@ -69,6 +69,7 @@ class QueryContext(typing.NamedTuple):
69
69
state : typing .Optional [options .State ]
70
70
warning_handler : options .WarningHandler
71
71
annotations : typing .Dict [str , str ]
72
+ transaction_options : typing .Optional [options .TransactionOptions ]
72
73
73
74
def lower (
74
75
self , * , allow_capabilities : enums .Capability
@@ -86,6 +87,7 @@ def lower(
86
87
allow_capabilities = allow_capabilities ,
87
88
state = self .state .as_dict () if self .state else None ,
88
89
annotations = self .annotations ,
90
+ transaction_options = self .transaction_options ,
89
91
)
90
92
91
93
@@ -96,6 +98,7 @@ class ExecuteContext(typing.NamedTuple):
96
98
state : typing .Optional [options .State ]
97
99
warning_handler : options .WarningHandler
98
100
annotations : typing .Dict [str , str ]
101
+ transaction_options : typing .Optional [options .TransactionOptions ]
99
102
100
103
def lower (
101
104
self , * , allow_capabilities : enums .Capability
@@ -111,6 +114,7 @@ def lower(
111
114
allow_capabilities = allow_capabilities ,
112
115
state = self .state .as_dict () if self .state else None ,
113
116
annotations = self .annotations ,
117
+ transaction_options = self .transaction_options ,
114
118
)
115
119
116
120
@@ -220,6 +224,7 @@ def query(self, query: str, *args, **kwargs) -> list:
220
224
query_options = _query_opts ,
221
225
retry_options = self ._get_retry_options (),
222
226
state = self ._get_state (),
227
+ transaction_options = self ._get_active_tx_options (),
223
228
warning_handler = self ._get_warning_handler (),
224
229
annotations = self ._get_annotations (),
225
230
))
@@ -233,6 +238,7 @@ def query_single(
233
238
query_options = _query_single_opts ,
234
239
retry_options = self ._get_retry_options (),
235
240
state = self ._get_state (),
241
+ transaction_options = self ._get_active_tx_options (),
236
242
warning_handler = self ._get_warning_handler (),
237
243
annotations = self ._get_annotations (),
238
244
))
@@ -244,6 +250,7 @@ def query_required_single(self, query: str, *args, **kwargs) -> typing.Any:
244
250
query_options = _query_required_single_opts ,
245
251
retry_options = self ._get_retry_options (),
246
252
state = self ._get_state (),
253
+ transaction_options = self ._get_active_tx_options (),
247
254
warning_handler = self ._get_warning_handler (),
248
255
annotations = self ._get_annotations (),
249
256
))
@@ -255,6 +262,7 @@ def query_json(self, query: str, *args, **kwargs) -> str:
255
262
query_options = _query_json_opts ,
256
263
retry_options = self ._get_retry_options (),
257
264
state = self ._get_state (),
265
+ transaction_options = self ._get_active_tx_options (),
258
266
warning_handler = self ._get_warning_handler (),
259
267
annotations = self ._get_annotations (),
260
268
))
@@ -266,6 +274,7 @@ def query_single_json(self, query: str, *args, **kwargs) -> str:
266
274
query_options = _query_single_json_opts ,
267
275
retry_options = self ._get_retry_options (),
268
276
state = self ._get_state (),
277
+ transaction_options = self ._get_active_tx_options (),
269
278
warning_handler = self ._get_warning_handler (),
270
279
annotations = self ._get_annotations (),
271
280
))
@@ -277,6 +286,7 @@ def query_required_single_json(self, query: str, *args, **kwargs) -> str:
277
286
query_options = _query_required_single_json_opts ,
278
287
retry_options = self ._get_retry_options (),
279
288
state = self ._get_state (),
289
+ transaction_options = self ._get_active_tx_options (),
280
290
warning_handler = self ._get_warning_handler (),
281
291
annotations = self ._get_annotations (),
282
292
))
@@ -293,6 +303,7 @@ def query_sql(self, query: str, *args, **kwargs) -> list[datatypes.Record]:
293
303
query_options = _query_opts ,
294
304
retry_options = self ._get_retry_options (),
295
305
state = self ._get_state (),
306
+ transaction_options = self ._get_active_tx_options (),
296
307
warning_handler = self ._get_warning_handler (),
297
308
annotations = self ._get_annotations (),
298
309
))
@@ -307,6 +318,7 @@ def execute(self, commands: str, *args, **kwargs) -> None:
307
318
cache = self ._get_query_cache (),
308
319
retry_options = self ._get_retry_options (),
309
320
state = self ._get_state (),
321
+ transaction_options = self ._get_active_tx_options (),
310
322
warning_handler = self ._get_warning_handler (),
311
323
annotations = self ._get_annotations (),
312
324
))
@@ -322,6 +334,7 @@ def execute_sql(self, commands: str, *args, **kwargs) -> None:
322
334
cache = self ._get_query_cache (),
323
335
retry_options = self ._get_retry_options (),
324
336
state = self ._get_state (),
337
+ transaction_options = self ._get_active_tx_options (),
325
338
warning_handler = self ._get_warning_handler (),
326
339
annotations = self ._get_annotations (),
327
340
))
@@ -349,6 +362,7 @@ async def query(self, query: str, *args, **kwargs) -> list:
349
362
query_options = _query_opts ,
350
363
retry_options = self ._get_retry_options (),
351
364
state = self ._get_state (),
365
+ transaction_options = self ._get_active_tx_options (),
352
366
warning_handler = self ._get_warning_handler (),
353
367
annotations = self ._get_annotations (),
354
368
))
@@ -360,6 +374,7 @@ async def query_single(self, query: str, *args, **kwargs) -> typing.Any:
360
374
query_options = _query_single_opts ,
361
375
retry_options = self ._get_retry_options (),
362
376
state = self ._get_state (),
377
+ transaction_options = self ._get_active_tx_options (),
363
378
warning_handler = self ._get_warning_handler (),
364
379
annotations = self ._get_annotations (),
365
380
))
@@ -376,6 +391,7 @@ async def query_required_single(
376
391
query_options = _query_required_single_opts ,
377
392
retry_options = self ._get_retry_options (),
378
393
state = self ._get_state (),
394
+ transaction_options = self ._get_active_tx_options (),
379
395
warning_handler = self ._get_warning_handler (),
380
396
annotations = self ._get_annotations (),
381
397
))
@@ -387,6 +403,7 @@ async def query_json(self, query: str, *args, **kwargs) -> str:
387
403
query_options = _query_json_opts ,
388
404
retry_options = self ._get_retry_options (),
389
405
state = self ._get_state (),
406
+ transaction_options = self ._get_active_tx_options (),
390
407
warning_handler = self ._get_warning_handler (),
391
408
annotations = self ._get_annotations (),
392
409
))
@@ -398,6 +415,7 @@ async def query_single_json(self, query: str, *args, **kwargs) -> str:
398
415
query_options = _query_single_json_opts ,
399
416
retry_options = self ._get_retry_options (),
400
417
state = self ._get_state (),
418
+ transaction_options = self ._get_active_tx_options (),
401
419
warning_handler = self ._get_warning_handler (),
402
420
annotations = self ._get_annotations (),
403
421
))
@@ -414,6 +432,7 @@ async def query_required_single_json(
414
432
query_options = _query_required_single_json_opts ,
415
433
retry_options = self ._get_retry_options (),
416
434
state = self ._get_state (),
435
+ transaction_options = self ._get_active_tx_options (),
417
436
warning_handler = self ._get_warning_handler (),
418
437
annotations = self ._get_annotations (),
419
438
))
@@ -430,6 +449,7 @@ async def query_sql(self, query: str, *args, **kwargs) -> typing.Any:
430
449
query_options = _query_opts ,
431
450
retry_options = self ._get_retry_options (),
432
451
state = self ._get_state (),
452
+ transaction_options = self ._get_active_tx_options (),
433
453
warning_handler = self ._get_warning_handler (),
434
454
annotations = self ._get_annotations (),
435
455
))
@@ -444,6 +464,7 @@ async def execute(self, commands: str, *args, **kwargs) -> None:
444
464
cache = self ._get_query_cache (),
445
465
retry_options = self ._get_retry_options (),
446
466
state = self ._get_state (),
467
+ transaction_options = self ._get_active_tx_options (),
447
468
warning_handler = self ._get_warning_handler (),
448
469
annotations = self ._get_annotations (),
449
470
))
@@ -459,6 +480,7 @@ async def execute_sql(self, commands: str, *args, **kwargs) -> None:
459
480
cache = self ._get_query_cache (),
460
481
retry_options = self ._get_retry_options (),
461
482
state = self ._get_state (),
483
+ transaction_options = self ._get_active_tx_options (),
462
484
warning_handler = self ._get_warning_handler (),
463
485
annotations = self ._get_annotations (),
464
486
))
0 commit comments