'Monetdb Conversion of string to blob failed
I have a Golang User struct with PasswordHash of type *[]byte
type User struct {
ID UserID `json:"id,omitempty" db:"u_user_id"`
PasswordHash *[]byte `json:"-" db:"u_password_hash"`
CreatedAt *time.Time `json:"-" db:"u_created_at"`
}
When i try to insert data as shown below
user := &User{
ID: id,
PasswordHash: &hashedPassword,
}
var result *model.User
rows, err := db.NamedQuery(createUserQuery, user)
if err != nil {
panic(err)
}
i get an Operational error:
panic: Operational error: 42000!Conversion of string '$2a$10$sODoBKGZtXzQziSDzFGJKuxZ0cSiNN38ZqD4YtmoLsWOa7K0bVXWW' to blob failed
is it that i have a wrong database type because my MonetDb type for the password column is blob
Solution 1:[1]
Can you open a bug report at https://github.com/MonetDB/MonetDB-Go with a specific reproducible example? I was not able to reproduce the problem.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | MitchellWeg |
