View definition


Defined in


Select runs an arbitrary SQL query, binding the columns in the result to fields on the struct specified by i. args represent the bind parameters for the SQL statement.

Column names on the SELECT statement should be aliased to the field names on the struct i. Returns an error if one or more columns in the result do not match. It is OK if fields on i are not part of the SQL statement.

The hook function PostGet() will be executed after the SELECT statement if the interface defines them.

Values are returned in one of two ways: 1. If i is a struct or a pointer to a struct, returns a slice of pointers to matching rows of type i. 2. If i is a pointer to a slice, the results will be appended to that slice and nil returned.

i does NOT need to be registered with AddTable()

Select is referenced in 12 repositories