Rick Morrison wrote:
>> Such operations will likely trigger a full table scan
>
> SQLite dates are stored as strings anyway, AFAIK there is little one can do
> to avoid table-scans in SQLite based solely on date criteria. I use julian
> dates stored as integers when working with large datasets in
--On 18. Januar 2008 12:08:46 -0500 Rick Morrison <[EMAIL PROTECTED]>
wrote:
There are no generic date functions in SQLAlchemy (although work has begun
on them). So for now, you'll need to use date functions native to your
database.
For sqlite something like,
func.strftime('%Y', Mikrop
> Such operations will likely trigger a full table scan
SQLite dates are stored as strings anyway, AFAIK there is little one can do
to avoid table-scans in SQLite based solely on date criteria. I use julian
dates stored as integers when working with large datasets in SQLite, and
convert as needed.
Would "create_date >= '2007-01-01' and create_date < '2008-01-01'" be
acceptable?
If so, something like this should work
from sqlalchemy import and_
from datetime import date
data = Table.query().filter(and_([Mikropost.c.create_date >= date(2007,
1, 1),
Mikropo
There are no generic date functions in SQLAlchemy (although work has begun
on them). So for now, you'll need to use date functions native to your
database.
For sqlite something like,
func.strftime('%Y', Mikropost.c.create_date) == '2008'
should work -- you may need to add additional percent