-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unknown value type for bind (insert) #1
Comments
Hi there, are you using mymysql as your exp/sql driver? If so, there's a patch I submitted to that project that is required to map bool values. This patch also pools prepared statements, which is important to avoid running out of prepared statement handles in mysql. also, there are probably some other issues you'll run into with gorp if you're using the weekly. I have a pending patch into the exp/sql project that is needed to define all the Nullable types: |
Oh, by the way, in my local environment, your test above passes. So I think the problem is probably due to one of the two issues above (probably the bool marshalling). Here's my test code:
|
Thank you for the two links, will use them for now. Yes I was using https://github.com/ziutek/mymysql . |
Fix of ziutek/mymysql#5 fixed this. |
First thank you very much for nice ORM, now it's one of the most documented DB libraries for Go and one of a few up-to-date.
Go's native type "bool" is not supported. Consider this:
type PersistentUser struct {
Key int32
Id string
PassedTraining bool
}
this code will panic (panic: unknown value type for bind)
pu := &PersistentUser{43,"33r",false}
// Insert your rows
err := dbmap.Insert(pu)
if err!=nil {
panic(err)
}
Windows 7/x86, MySql 5.1, Go weekly.2011-12-22 11071
The text was updated successfully, but these errors were encountered: