plain execute function

This commit is contained in:
Lex Berezhny 2020-05-18 08:14:30 -04:00
parent 5d6388b366
commit d232eeaf81
3 changed files with 7 additions and 5 deletions

View file

@ -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
)

View file

@ -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)

View file

@ -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))