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
I have noticed some regression. But it might also be me holding it wrong, thus, feel free to close this issue as "won't fix"
I have tried to update our v1.2.1 in our project. However, there seems to be some regression in how bun deals with nested structs that have embeddings.
We have a core.UUID type that embeds uuid.UUID to extend it with some additional functionality:
package core
typeUUIDstruct {
uuid.UUID
}
When running the following query, we receive a bun error:
sql: Scan error on column index 0, name "uuid": bun: UUID does not have column "uuid"
It looks to me like bun now interprets core.UUID differently.
Previously as a "primitive type", and now as a "table".
I managed to resolve the issue by using:
var appliances []uuid.UUID
and construct the appropriate type afterwards in a for loop.
If it helps, I can set up a minimal reproducer.
Our bun models look like this:
typeRowIDstruct {
IDint64`bun:",pk,autoincrement"`
}
typeAppliancestruct {
RowIDApplianceFields//... Some other fields
}
typeApplianceFieldsstruct {
bun.BaseModel`bun:"table:appliances"`UUID core.UUID`bun:"type:uuid,unique"`//... Some other fields
}
typeDomainstruct {
RowIDDomainFields//... Some other fields
}
typeDomainFieldsstruct {
bun.BaseModel`bun:"table:domains"`UUID core.UUID`bun:"type:uuid,unique"`// ... Some other fields
}
// DomainToAppliance is a join table for the m-to-n relationship between domains and appliances.typeDomainToAppliancestruct {
DomainIDint64`bun:",pk"`ApplianceIDint64`bun:",pk"`Domain*Domain`bun:"rel:belongs-to,join:domain_id=id"`Appliance*Appliance`bun:"rel:belongs-to,join:appliance_id=id"`
}
The text was updated successfully, but these errors were encountered:
We see the same when just using uuid.UUID as the type. Unable to upgrade to 1.2.1. My guess is it's a regression introduced in fix: embedding of scanonly fieldsed6ed74
This issue has been automatically marked as stale because it has not had activity in the last 30 days. If there is no update within the next 7 days, this issue will be closed.
Hi there,
First of all, thanks for this awesome project 🎉
I have noticed some regression. But it might also be me holding it wrong, thus, feel free to close this issue as "won't fix"
I have tried to update our v1.2.1 in our project. However, there seems to be some regression in how bun deals with nested structs that have embeddings.
We have a
core.UUID
type that embedsuuid.UUID
to extend it with some additional functionality:When running the following query, we receive a bun error:
(see models below)
This results in:
It looks to me like bun now interprets
core.UUID
differently.Previously as a "primitive type", and now as a "table".
I managed to resolve the issue by using:
and construct the appropriate type afterwards in a for loop.
If it helps, I can set up a minimal reproducer.
Our bun models look like this:
The text was updated successfully, but these errors were encountered: