Skip to content

Question on binding a SUM in MySQL - giving []uint8 but expected uint64 #921

Answered by aarondl
mrz1836 asked this question in Q&A
Discussion options

You must be logged in to vote

This seems like there may be some witchcraft inside the MySQL driver that's doing this.

Because in Go there is no real support for uint64 inside the drivers: https://golang.org/pkg/database/sql/driver/#Value I think that it might be automatically converting the value to a string and when it gets to sqlboiler it sees a string (note it's a slice of []uint8 aka []byte) and then it errors. Your best bet is to use a string to ensure that the full range of values is supported by your driver I think.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mrz1836
Comment options

Answer selected by stephenafamo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants