This commit is contained in:
Jack Robison 2019-09-17 10:26:49 -04:00
parent 46b45d0387
commit 02c51c6059
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -3,7 +3,7 @@ import asyncio
from binascii import hexlify from binascii import hexlify
from concurrent.futures.thread import ThreadPoolExecutor from concurrent.futures.thread import ThreadPoolExecutor
from typing import Tuple, List, Union, Callable, Any, Awaitable, Iterable, Optional from typing import Tuple, List, Union, Callable, Any, Awaitable, Iterable, Dict, Optional
import sqlite3 import sqlite3
@ -159,7 +159,7 @@ def constraints_to_sql(constraints, joiner=' AND ', prepend_key=''):
return joiner.join(sql) if sql else '', values return joiner.join(sql) if sql else '', values
def query(select, **constraints): def query(select, **constraints) -> Tuple[str, Dict[str, Any]]:
sql = [select] sql = [select]
limit = constraints.pop('limit', None) limit = constraints.pop('limit', None)
offset = constraints.pop('offset', None) offset = constraints.pop('offset', None)