Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

SQLite and Postgres treat string datetimes differently #84

Closed Jaymon closed 1 year ago

Jaymon commented 5 years ago

if you passed in 2019-10-08 20:18:59.566Z to your field, Postgres will validate it on write, but SQLite won't validate it until read, so SQLite will gladly accept any invalid date string and then fail when it gets pulled out.

It would be nice if SQLite also validated on write, but I can't see any way to make it work short of creating prom specific validators that can be defined for certain types and get run on those values on write, so for SQLite you could set a validator on datetime.datetime fields but you wouldn't on Postgres.