diff options
author | Erich Blume <blume.erich@gmail.com> | 2014-02-03 16:55:00 -0800 |
---|---|---|
committer | Erich Blume <blume.erich@gmail.com> | 2014-02-03 16:55:00 -0800 |
commit | e47f99450378a7b1ea29a8493c0692bcf8669da3 (patch) | |
tree | 8add39d04bfb28e187bf6dc8cd90d7e4524c8aeb /lib/sqlalchemy/events.py | |
parent | c188526a74486596bfaef2dadbaeff915ec34812 (diff) | |
download | sqlalchemy-pr/65.tar.gz |
SQLite dialect - support relection from affinitypr/65
SQLite allows column types that aren't technically understood in sqlite
by using 'data affinity', which is an algorithm for converting column
types in to some sort of useful type that can be stored and retrieved
from the db. Unfortunatly, this breaks reflection since we (previously)
expected a sqlite db to reflect column types that we permit in the
`ischema_names` for that dialect.
This patch changes the logic for 'unknown' column types during
reflection to instead run through SQLite's data affinity algorithm, and
assigns appropriate types from that.
It also expands the matching for column type to include column types
with spaces (strongly discouraged but allowed by sqlite) and also
completely empty column types (in which case the NullType is assigned,
which sqlite will treat as a Blob - or rather, Blob is treated as
NullType). These changes mean that SQLite will never raise an error for
an unknown type during reflection - there will always be some 'useful'
type returned, which follows the spirit of SQLite (accomodation before
sanity!).
Diffstat (limited to 'lib/sqlalchemy/events.py')
0 files changed, 0 insertions, 0 deletions