Thanks, I understand the reasoning behind this and appreciate the fix to make it work as expected for Oracle. btw I really like the way types and dialects work in 0.6.
On Mar 11, 5:31 pm, "Michael Bayer" <mike...@zzzcomputing.com> wrote: > Grimsqueaker wrote: > > When I use "autoload=True" to reflect an Oracle table with a DATE > > column containing a full date and time, the resulting python object is > > a datetime.date, not datetime.datetime. Before updating to SA 0.6 I > > used to get a datetime.datetime as expected. > > > If I override the reflected column with the DATETIME type from the > > oracle dialect, I get what I expect. > > > Is there a way to configure the behaviour of the table reflection so > > that I will get the type that I expect without having to explicitly > > override column definitions? > > As I'm sure you're aware, Oracle has no DATETIME type - it only has DATE, > which stores a date + time, as well as TIMESTAMP. So when we reflect > this, we get back "DATE". The generic types.Date, when used with the > cx_oracle backend, as expected chops off the time portion coming back in > result sets, and until now so did the DATE type, which is a subclass. In > 0.5 we apparently had the "DATE" type reflect as DateTime to work around > this, which is not an option here since types in 0.6 reflect exactly as > stated, in this case DATE. So the solution is to make DATE act > identically as it does on Oracle, in that it returns a datetime in all > cases (note this is not the behavior for types.Date, however), so that is > available on the latest default tip rb66411b37ba4. > > > > > Thanks > > > -- > > You received this message because you are subscribed to the Google Groups > > "sqlalchemy" group. > > To post to this group, send email to sqlalch...@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. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@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.