Example
Scan Many Rows
Use scan.All when you want every row in the result set as a slice of
structs. Unknown columns are ignored, and the query still looks like SQL.
The shape
type UserRow struct {
ID int `db:"id"`
Email string `db:"email"`
Status string `db:"status"`
}
This example is useful when you want a list endpoint or admin table without adding a heavier abstraction.
Run it
users, err := scan.All[UserRow](ctx, db,
qq.Select("id", "email", "status").
From("users").
OrderBy("id ASC"),
)
Why this stays boring
The scan layer does one thing here: it turns rows into a slice of structs. It does not
track state or infer relationships.
What the output looks like
[{1 a@example.com active} {2 b@example.com inactive}]