Select executes a query using the provided Queryer, and StructScans each row into dest, which must be a slice. If the slice elements are scannable, then the result set must have only one column. Otherwise, StructScan is used. The *sql.Rows are closed automatically. Any placeholder parameters are r
(q Queryer, dest interface{}, query string, args ...interface{})
| 674 | // The *sql.Rows are closed automatically. |
| 675 | // Any placeholder parameters are replaced with supplied args. |
| 676 | func Select(q Queryer, dest interface{}, query string, args ...interface{}) error { |
| 677 | rows, err := q.Queryx(query, args...) |
| 678 | if err != nil { |
| 679 | return err |
| 680 | } |
| 681 | // if something happens here, we want to make sure the rows are Closed |
| 682 | defer rows.Close() |
| 683 | return scanAll(rows, dest, false) |
| 684 | } |
| 685 | |
| 686 | // Get does a QueryRow using the provided Queryer, and scans the resulting row |
| 687 | // to dest. If dest is scannable, the result must only have one column. Otherwise, |