|
I had this same problem and it took me a little while to figure it out, so adding a comment about it would be worth while IMHO. In my case I assumed that Date was like Oracles Date and contained a time as well. I then created tables with Date colums and everything was great as long as I put past dates it them without times. Later I used the datetime module to put a Date and Time into the field which SQLite readily took, but I could no longer read that date into SA as there was always a time remainder. I then learned about and changed the column format from Date to DateTime. SQLite still behaved resonably but SA wouldn't ready ANY of my old data files because the format field didn't match what it read in from SQLite. At the time I kind of wondered why, given the SQLite behavior, it wouldn't make sense to try both Date and DateTime formats before failing. In my case the simple solution was to just to append a ' 00:00:00' to the column value in my existing tables. Another problem I have is that I have yet to figure out a way to pass in a default time of now in sqlite syntax. The following does NOT work:
Column('dtm', DateTime), PassiveDefault("datetime('now')")) On Wed April 26 2006 15:37, Michael Bayer wrote: > why not use the DateTime type on your Column ? > > On Apr 26, 2006, at 2:42 PM, Jon Rosebaugh wrote: > > I mentioned this on the IRC channel, but thought I'd mention it here > > as well. The sqlite layer will happily accept various formats for > > timestamps that it is unable to read back out from the database. It > > expects a string in a certain format, but I didn't know that, so I > > tried storing seconds-since-the-epoch. It was quite happy to accept > > that and store it in the database, but attempting to load that record > > caused an exception. I'm not sure what is the best way to fix this, > > but at the very least it should probably be documented. > > > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, > > security? > > Get stuff done quickly with pre-integrated technology to make your > > job easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > > Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 > > _______________________________________________ > > Sqlalchemy-users mailing list > > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd________________________________________ >_______ Sqlalchemy-users mailing list > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users -- -------------------------------------------------------------- Robert E. Anderson email: [EMAIL PROTECTED] Systems Programmer phone: (603) 862-3489 UNH Research Computing Center fax: (603) 862-1761 -------------------------------------------------------------- |
- [Sqlalchemy-users] sqlite and DateTime types Jon Rosebaugh
- Re: [Sqlalchemy-users] sqlite and DateTime types Michael Bayer
- Re: [Sqlalchemy-users] sqlite and DateTime typ... Robert E. Anderson
- Re: [Sqlalchemy-users] sqlite and DateTime... Jonathan Ellis
- Re: [Sqlalchemy-users] sqlite and DateTime... Michael Bayer
- Re: [Sqlalchemy-users] sqlite and DateTime typ... Jon Rosebaugh
- Re: [Sqlalchemy-users] sqlite and DateTime... William K. Volkman
- Re: [Sqlalchemy-users] sqlite and Date... Jon Rosebaugh
- Re: [Sqlalchemy-users] sqlite and... Jonathan Ellis
- Re: [Sqlalchemy-users] sqlite... Jon Rosebaugh
- Re: [Sqlalchemy-users] sqlite... Jonathan Ellis
- Re: [Sqlalchemy-users] sqlite and... Michael Bayer
- Re: [Sqlalchemy-users] sqlite... Jon Rosebaugh

