func (c *Category) assignValues(columns []string, values []interface{}) error {
	if m, n := len(values), len(columns); m < n {
		return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
	}
	for i := range columns {
		switch columns[i] {
		case category.FieldID:
			if value, ok := values[i].(*pulid.ID); !ok {
				return fmt.Errorf("unexpected type %T for field id", values[i])
			} else if value != nil {
				c.ID = *value
			}
		case category.FieldText:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field text", values[i])
			} else if value.Valid {
				c.Text = value.String
			}
		case category.FieldStatus:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field status", values[i])
			} else if value.Valid {
				c.Status = category.Status(value.String)
			}
		case category.FieldConfig:
			if value, ok := values[i].(*schematype.CategoryConfig); !ok {
				return fmt.Errorf("unexpected type %T for field config", values[i])
			} else if value != nil {
				c.Config = value
			}
		case category.FieldDuration:
			if value, ok := values[i].(*sql.NullInt64); !ok {
				return fmt.Errorf("unexpected type %T for field duration", values[i])
			} else if value.Valid {
				c.Duration = time.Duration(value.Int64)
			}
		case category.FieldCount:
			if value, ok := values[i].(*sql.NullInt64); !ok {
				return fmt.Errorf("unexpected type %T for field count", values[i])
			} else if value.Valid {
				c.Count = uint64(value.Int64)
			}
		}
	}
	return nil
}
assignValues assigns the values that were returned from sql.Rows (after scanning)
to the Category fields.
package ent
import (
	"fmt"
	"strings"
	"time"
	"entgo.io/contrib/entgql/internal/todo/ent/schema/schematype"
	"entgo.io/contrib/entgql/internal/todopulid/ent/category"
	"entgo.io/contrib/entgql/internal/todopulid/ent/schema/pulid"
	"entgo.io/ent/dialect/sql"
)
type Category struct {
	config `json:"-"`
	ID pulid.ID `json:"id,omitempty"`
	Text string `json:"text,omitempty"`
	Status category.Status `json:"status,omitempty"`
	Config *schematype.CategoryConfig `json:"config,omitempty"`
	Duration time.Duration `json:"duration,omitempty"`
	Count uint64 `json:"count,omitempty"`
	Edges CategoryEdges `json:"edges"`
}
type CategoryEdges struct {
	Todos []*Todo `json:"todos,omitempty"`
	loadedTypes [1]bool
}
func (e CategoryEdges) TodosOrErr() ([]*Todo, error) {
	if e.loadedTypes[0] {
		return e.Todos, nil
	}
	return nil, &NotLoadedError{edge: "todos"}
}
func (*Category) scanValues(columns []string) ([]interface{}, error) {
	values := make([]interface{}, len(columns))
	for i := range columns {
		switch columns[i] {
		case category.FieldID:
			values[i] = new(pulid.ID)
		case category.FieldConfig:
			values[i] = new(schematype.CategoryConfig)
		case category.FieldDuration, category.FieldCount:
			values[i] = new(sql.NullInt64)
		case category.FieldText, category.FieldStatus:
			values[i] = new(sql.NullString)
		default:
			return nil, fmt.Errorf("unexpected column %q for type Category", columns[i])
		}
	}
	return values, nil
}