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
When the value ProjectId is value is null in the database, I get these errors:
1:22AM ERR could not get by surfer email 2@2.2
1:22AM ERR can not unmarshal X uuid into *[16]uint8
Here is the code. SurfersStruct was generated using schemagen:
type SurfersStruct struct {
Email string
Name string
ProjectId [16]byte
SurferId [16]byte
}
func (surfer *SurfersStruct) GetByEmail(session *gocqlx.Session, email string) {
stmt, names := qb.Select("brain.surfers").Where(qb.Eq("email")).Limit(1).ToCql()
res := session.Query(stmt, names).Bind(email)
if err := res.GetRelease(surfer); err != nil {
uy.Error("could not get by surfer email " + email)
uy.Error(err.Error())
}
}
I'm using github.com/scylladb/gocqlx/v2 v2.8.0.
The two fixes I see are to change ProjectId to a pointer *[16]byte or to make sure project_id is never null in the database.
This seems like the most common use case, so I'm not sure if this is a bug, if I'm doing something wrong, or if this is expected behavior for a reason.
For now I think I'll fork schemagen to replace [16]byte with *gocql.UUID or gocql.UUID.
The text was updated successfully, but these errors were encountered:
When the value
ProjectId
is value isnull
in the database, I get these errors:Here is the code.
SurfersStruct
was generated usingschemagen
:I'm using
github.com/scylladb/gocqlx/v2 v2.8.0
.The two fixes I see are to change
ProjectId
to a pointer*[16]byte
or to make sureproject_id
is nevernull
in the database.This seems like the most common use case, so I'm not sure if this is a bug, if I'm doing something wrong, or if this is expected behavior for a reason.
For now I think I'll fork schemagen to replace
[16]byte
with*gocql.UUID
orgocql.UUID
.The text was updated successfully, but these errors were encountered: