You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// EntityWithTotal used to scan col1, col2, col3 to T, and scan total to Total when columns is [col1, col2, col3, total] if *T is interface{ ValuePtrs() []any }
type EntityWithTotal[T any] struct {
Inner T // data
Total int64 `db:"total"` // total
}
// ValuePtrs return T's fields and Total's pointer if *T is interface{ ValuePtrs() []any }, or return Inner and Total's pointer; use by rows.Scan(s.ValuePtrs()....)