jmoiron/sqlx — pull request #104 by fln (2014-11-19 12:29:25+00:00)
Title: GetAlloc() function, and MustGetAlloc(), MustSelect() helper functions

I would like to add a new function GetAlloc() to sqlx package.

This function is useful when either 0 or 1 rows should be returned. The idea is to pass a pointer to the destination and this function will set it to nil or the data from DB. For pointer to be modified in the function user should pass a double pointer.

Usage example:
```go
var person *Person

db.GetAlloc(&person, "SELECT ... LIMIT 1")

if person == nil {
log.Print("Got nothing")
} else {
log.Print("Got person: ", person)
}
```

Without GetAlloc() user must check for sql.ErrNoRows if using Get() or use slices and Select().

These patches also contain MustGetAlloc() and MustSelect() helper functions to panic on error and tests for GetAlloc().