-
-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't roundtrip datetimes - at least in SQLite. #97
Comments
Having the same problem. At first I thought I could roll a simple fix, but it's a tough one to solve as SQLite doesn't have a dedicated date type. Still, I'm confused as to why writing a datetime object works, but the raw string doesn't, unless Dataset and/or SQLAlchemy is converting to an integer on the way in and a string on the way out. |
Should be fixed now, see #97 -- please can you guys test from master before I publish a release? |
Hmm, not quite there yet. The date is still fetched as a unicode string, which now causes an error because it isn't a datetime object. Here's the relevant section of the traceback:
|
@eads: can you give me an indication of what you're trying to push in there? or you you just round-tripping a record with the date coming out of the db? |
I'm round-tripping a record. Here's a truncated version of the code:
This version of
This fails with the stack trace above:
(Using 1s and 0s for bool since that's how Sqlite handles them anyway) |
My guess is that somewhere in your program, you are writing string values to a For now, I'd go with the targeted update that you posted in your last comment, the only alternative I can think of is actually trying to parse the date string in |
The program is writing datetimes that come from maybe this just means I should give up on sqlite. It definitely lacks moral On Sat, May 23, 2015 at 10:24 AM, Friedrich Lindenberg <
David Eads | http://recoveredfactory.net "Medical statistics will be our standard of measurement: we will weigh life |
Issue seems to be resolved in master. |
The actual problem underlying #96.
If you put a datetime into the database, you get a unicode string back.
If you put the unicode string into the database, #96 stings you and it crashes.
(Roundtripping is important for "fetch this row from the DB, mutate it and save it back" scenarios.)
The text was updated successfully, but these errors were encountered: