Create columns before querying them.
This commit is contained in:
parent
6bbe8a0486
commit
c61d4c6df7
@ -2,6 +2,7 @@ import logging
|
|||||||
from itertools import count
|
from itertools import count
|
||||||
|
|
||||||
from sqlalchemy.sql import expression, and_
|
from sqlalchemy.sql import expression, and_
|
||||||
|
from sqlaload.schema import _ensure_columns
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ def find_one(engine, table, **kw):
|
|||||||
|
|
||||||
def find(engine, table, _limit=None, _step=5000, _offset=0,
|
def find(engine, table, _limit=None, _step=5000, _offset=0,
|
||||||
order_by=None, **kw):
|
order_by=None, **kw):
|
||||||
|
_ensure_columns(engine, table, kw)
|
||||||
|
|
||||||
if order_by is None:
|
if order_by is None:
|
||||||
order_by = [table.c.id.asc()]
|
order_by = [table.c.id.asc()]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user