ziutek/mymysql — pull request #5 by coopernurse (2012-01-12 17:40:01+00:00)
Title: Add statement pooling to godrv.  Support bool types in binding.go

Hi,

Two changes here based on my gorp tests. The binding.go change will marshall bool as tinyint, which appears to work. The driver.go change pools prepared statements, which is useful because exp/sql transparently pools connections, causing them to be very long lived. Without pooling the statements, it is pretty easy to run out of prepared statement handles. exp/sql should probably provide some way to control the connection lifecycle, but I don't see a downside to caching the statements in godrv. stmt.Close() has been updated to remove the prepared statement from the cache, and conn.Close() clears the statement cache as well (perhaps we should loop through and close all the statements? not sure).

please let me know what you think

-- James