File tree Expand file tree Collapse file tree 1 file changed +54
-2
lines changed
Expand file tree Collapse file tree 1 file changed +54
-2
lines changed Original file line number Diff line number Diff line change 1+ import dataclasses
2+ from typing import (
3+ Any ,
4+ Dict ,
5+ List ,
6+ Optional ,
7+ Tuple ,
8+ Union ,
9+ )
10+
11+ import ydb
12+
13+
14+ ParametersType = Dict [
15+ str ,
16+ Union [
17+ Any ,
18+ Tuple [Any , Union [ydb .PrimitiveType , ydb .AbstractTypeBuilder ]],
19+ ydb .TypedValue ,
20+ ],
21+ ]
22+
23+
24+ @dataclasses .dataclass
25+ class YdbQuery :
26+ yql_text : str
27+ is_ddl : bool = False
28+
29+
130class Cursor :
2- def __init__ (self ):
31+ def __init__ (
32+ self ,
33+ session_pool : ydb .aio .QuerySessionPool ,
34+ session : ydb .aio .QuerySession ,
35+ tx_mode : ydb .BaseQueryTxMode ,
36+ tx_context : Optional [ydb .QueryTxContext ] = None ,
37+ table_path_prefix : str = "" ,
38+ ):
339 self .arraysize = 1
40+ self ._description = None
41+
42+ self ._pool = session_pool
43+ self ._session = session
44+ self ._tx_mode = tx_mode
45+ self ._tx_context = tx_context
46+ self ._table_path_prefix = table_path_prefix
47+
48+ async def _execute_ddl_query (
49+ self , query : YdbQuery , parameters : Optional [ParametersType ] = None
50+ ) -> List [ydb .convert .ResultSet ]:
51+ return await self ._pool .execute_with_retries (
52+ query = query , parameters = parameters
53+ )
454
5- async def execute (self ):
55+ async def execute (
56+ self , operation : YdbQuery , parameters : Optional [ParametersType ] = None
57+ ):
658 pass
759
860 async def executemany (self ):
You can’t perform that action at this time.
0 commit comments