GoMySQL seems to let me do anything 7 different ways, but the docs don't make it clear which subset of the total three dozen functions are used with each of the 7 or so ways.
I've used MySQL's C and Perl libraries for 10+ years so I can kinda make sense of what this Go API is trying to tell me, but the docs (despite being length) don't really tell me how to use it.
For instance, when do I need to FreeResult or Close a statement? Can I use client.Prepare + Statement.BindParams and use {Store,Use}Result or do I need to use Execute? and FetchRow?
I want to love this library but the docs could really use some work.
As it is the MySQL state is getting wedged and I occasionally have to restart my server because each request is getting one of 3 random errors:
#2053 Attempt to read a row while there is no result set associated with the statement
#2000 Unknown MySQL error
#2027 Malformed Packet
Every time I reload I get a different one of those errors.
How can I safely recycle connections into a pool? When is it safe to reuse a connection? What do I have to do to discard all results / cursors / misc state?