]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Improve SQLite DATETIME storage format handling [ticket:2363]
authorNathan Wright <thatnateguy@gmail.com>
Tue, 13 Mar 2012 04:31:12 +0000 (21:31 -0700)
committerNathan Wright <thatnateguy@gmail.com>
Tue, 13 Mar 2012 04:31:12 +0000 (21:31 -0700)
commit55b4295e39454430211a3c30cb8303a58a024f28
treec1bd59a39d6b4dfb587d3675dac77791bed4058a
parent754e7290b46d96500aea52da76f7c1230cb46fb8
Improve SQLite DATETIME storage format handling [ticket:2363]

This breaks backwards compatibility with old SQLite DATETIME, DATE,
and TIME storage_format strings. Formatting now occurs with named instead
of positional parameters. The regexp argument can still use positional
arguments, but named groupings are also supported. This means that you can
omit fields and change the order of date fields as desired.

SQLite's DATETIME and TIME also gained a truncate_microseconds argument.
This is shorthand for modifying the format string. Fortunately the
str_to_datetime and str_to_time processors written in C already support
omitting microseconds, so we don't have to resort to python processing
for this case.
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/processors.py
test/dialect/test_sqlite.py