forked from LBRYCommunity/lbry-sdk
plain execute function
This commit is contained in:
parent
5d6388b366
commit
d232eeaf81
3 changed files with 7 additions and 5 deletions
|
@ -3,8 +3,3 @@ from .constants import (
|
|||
TXO_TYPES, SPENDABLE_TYPE_CODES,
|
||||
CLAIM_TYPE_CODES, CLAIM_TYPE_NAMES
|
||||
)
|
||||
from .tables import (
|
||||
Table, Version, metadata,
|
||||
AccountAddress, PubkeyAddress,
|
||||
Block, TX, TXO, TXI, Claim, Tag, Claimtrie
|
||||
)
|
||||
|
|
|
@ -106,6 +106,9 @@ class Database:
|
|||
self.executor, partial(func, *args, **kwargs)
|
||||
)
|
||||
|
||||
async def execute(self, sql):
|
||||
return await self.run_in_executor(q.execute, sql)
|
||||
|
||||
async def execute_fetchall(self, sql):
|
||||
return await self.run_in_executor(q.execute_fetchall, sql)
|
||||
|
||||
|
|
|
@ -365,6 +365,10 @@ def process_claims_and_supports(block_range=None):
|
|||
rows.save()
|
||||
|
||||
|
||||
def execute(sql):
|
||||
return ctx().execute(text(sql))
|
||||
|
||||
|
||||
def execute_fetchall(sql):
|
||||
return ctx().fetchall(text(sql))
|
||||
|
||||
|
|
Loading…
Reference in a new issue