// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.13.0 // source: stats.sql package mysqlcore import ( "context" "git.aiterp.net/stufflog3/stufflog3-api/internal/sqltypes" ) const listStats = `-- name: ListStats :many SELECT id, name, description, weight, allowed_amounts FROM stat WHERE scope_id = ? ` type ListStatsRow struct { ID int Name string Description string Weight float64 AllowedAmounts sqltypes.NullRawMessage } func (q *Queries) ListStats(ctx context.Context, scopeID int) ([]ListStatsRow, error) { rows, err := q.db.QueryContext(ctx, listStats, scopeID) if err != nil { return nil, err } defer rows.Close() items := []ListStatsRow{} for rows.Next() { var i ListStatsRow if err := rows.Scan( &i.ID, &i.Name, &i.Description, &i.Weight, &i.AllowedAmounts, ); err != nil { return nil, err } items = append(items, i) } if err := rows.Close(); err != nil { return nil, err } if err := rows.Err(); err != nil { return nil, err } return items, nil }