Skip to content

v2.36.0

Compare
Choose a tag to compare
@SpencerTorres SpencerTorres released this 03 Jun 20:42
· 145 commits to main since this release

What's Changed

Enhancements πŸŽ‰

The batch.Close() function was added to prevent connections from being leaked by the batch interface. In the previous API, it is possible that an early return (due to return err or some other cause) would cause the connection to be held until the connection timed out.

Here's an example of using this new function:

batch, err := conn.PrepareBatch(ctx, "INSERT INTO function null('x UInt64') VALUES (1)")
if err != nil { . . . }
// This defer call will make sure the batch is absolutely cleaned up before it falls out of scope.
defer batch.Close()

Users should update their code to call this new function. Depending on your insert logic you may be leaking connections if Send never gets called.

Full Changelog: v2.35.0...v2.36.0