You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that I have the model and I have a struct which uses it, how do I tell bun to ignore certain fields from the base model?
typeUserProjectstruct {
Base// inherit all fields from baseID scalars.UUID`bun:"-"`// <* I want to ignore this one...userID scalars.UUID`bun:",pk"`projectID scalars.UUID`bun:",pk"`// other fields
}
The above doesn't work. Bun still tries to use the ID field even though it is supposed to be ignored, which results in the error:
*pgconn.PgError: ERROR: column "id" of relation "user_projects" does not exist (SQLSTATE 42703)
I am using the latest version of bun (v1.1.12) and the database is postgres
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So my question is two-fold
The above doesn't work. Bun still tries to use the
ID
field even though it is supposed to be ignored, which results in the error:I am using the latest version of bun (
v1.1.12
) and the database is postgresBeta Was this translation helpful? Give feedback.
All reactions