MCPcopy
hub / github.com/jmoiron/sqlx / Select

Function Select

sqlx.go:676–684  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

674// The *sql.Rows are closed automatically.
675// Any placeholder parameters are replaced with supplied args.
676func 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,

Callers 3

SelectMethod · 0.85
SelectMethod · 0.85
SelectMethod · 0.85

Calls 3

scanAllFunction · 0.85
QueryxMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected