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.

sorry for the late reply , i figure it out :slight_smile:

sorry for late reply , it was wrong association actually. you were right.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.