Can't Preload table when the new record is created

// TODO: preload doesnt work.

db.Where(“id = ?”, user.ID).Table(“users”).Preload(“Language”).First(&user)

getting Error: { can’t preload field Language for User }

This doesn’t look like the stdlibs database API, can you perhaps tell us what you use to build your queries?

And probably it might help if you tell us how the involved schema looks like.

1 Like

Are you using GORM?

It seems it is gorm, but he needs to share gorm models and table definations. the error is so general, IMHO wrong association defination might cause the error.