github.com/travelaudience/go-sx (go): Package sx provides some simple extensions to the database/sql package to reduce the amount of boilerplate code.  Package sx provides a function called Do, which runs a callback function inside a transaction.  The callback function is provided with a Tx object, which is an sql.Tx object that has been extended with some Must*** methods. When a Must*** method encounters an error, it panics, and the panic is caught by Do and returned to the caller as an error value.  Do automatically commits or rolls back the transaction based on whether or not the callback function completed successfuly.  Package sx provides functions to generate frequently-used queries, based on a simple matching between struct fields and database columns.  By default, every field in a struct corresponds to the database column whose name is the snake-cased version of the field name, i.e. the field HelloWorld corresponds to the "hello_world" column.  Acronyms are treated as words, so HelloRPCWorld becomes "hello_rpc_world".  The column name can also be specified explicitly by tagging the field with the desired name, and fields can be excluded altogether by tagging with "-".  Fields that should be used for scanning but exluded for inserts and updates are additionally tagged "readonly".  Examples:
Keywords: owner-cxt