prom icon indicating copy to clipboard operation
prom copied to clipboard

SQLite and Postgres treat string datetimes differently

Open Jaymon opened this issue 4 years ago • 0 comments

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.

Jaymon avatar Oct 08 '19 21:10 Jaymon