Skip to content

Commit dfb8406

Browse files
authored
support user-defined methods executed through an async iterator (#291)
1 parent 83eff37 commit dfb8406

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cterasdk/asynchronous/core/query.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ def create_callback_function(core, path, name=None, *, callback_response=None):
1818
async def database(core, path, name, param):
1919
return callback_response(await core.v1.api.database(path, name, param))
2020

21-
return Command(database, core, path, name or 'query')
21+
async def execute(core, path, name, param):
22+
return callback_response(await core.v1.api.execute(path, name, param))
23+
24+
return Command(execute if name else database, core, path, name or 'query')
2225

2326

2427
def iterator(core, path, param=None, name=None, *, callback_response=None):

0 commit comments

Comments
 (0)