On Jul 22, 2009, at 8:48 PM, Randy Syring wrote:

>
> I work with the OP.  The columns are correctly typed and the
> reflection code seems to work correctly with views that are directly
> selecting from tables.  Its when a view selects from another view that
> we have problems with the type being lost.
>
> Can anyone else say for sure whether it is supported to autoload a
> table object from an SQLite view?  If it is, this would seem to be a
> bug.  If not, I guess were are lucky it works in the first place.  New
> feature maybe?

well this is really easy to analyze, turn on echo=debug and see what  
SQLite is returning.  The mapping of SQLite names to SQLA column types  
in the 0.5 series is in sqlalchemy/databases/sqlite.py in a dictionary  
called "ischema_names".  its a straight dictionary lookup.   in fact  
here it is:

ischema_names = {
     'BLOB': SLBinary,
     'BOOL': SLBoolean,
     'BOOLEAN': SLBoolean,
     'CHAR': SLChar,
     'DATE': SLDate,
     'DATETIME': SLDateTime,
     'DECIMAL': SLNumeric,
     'FLOAT': SLFloat,
     'INT': SLInteger,
     'INTEGER': SLInteger,
     'NUMERIC': SLNumeric,
     'REAL': SLNumeric,
     'SMALLINT': SLSmallInteger,
     'TEXT': SLText,
     'TIME': SLTime,
     'TIMESTAMP': SLDateTime,
     'VARCHAR': SLString,
}




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to