imdrasil / jennifer_sqlite3_adapter

SQLite3 adapter for Jennifer ORM
MIT License
13 stars 7 forks source link

Timestamp fails casting using preload #26

Closed ikaru5 closed 3 years ago

ikaru5 commented 3 years ago

I'm getting this one with sqlite when calling "includes": Column User.created_at can't be casted from String to it's type - (Time | Nil) (Jennifer::DataTypeCasting)

Thats the call: Skin.all.includes(:creator)

Its a belongs_to relation: belongs_to :creator, User, foreign: "creator_id"

Seems like the belongs_to relation doesnt know how to cast text-timestamps of sqlite to timestamps.

ikaru5 commented 3 years ago

Similar problem with IDs when using Int32 or Primary32:

Column User.id can't be casted from Int64 to it's type - (Int32 | Nil) (Jennifer::DataTypeCasting)

imdrasil commented 3 years ago

Hi, could you please share database table schema for Skin and User models?