package ticket import ( "github.com/ClickHouse/clickhouse-go/v2/lib/driver" "google.golang.org/protobuf/types/known/timestamppb" "time" ) func (x *Ticket) Scan(row driver.Rows) error { var ( from map[string]string createdAt time.Time updatedAt time.Time err error ) if err = row.Scan( &x.TicketId, &x.ThreadId, &x.To, &from, &x.Flags, &x.Meta, &x.Tags, &createdAt, &updatedAt, &x.MessageIds, &x.Subjects, ); err != nil { return err } x.From = &EmailAddress{ Address: from["address"], Name: from["name"], } x.CreatedAt = timestamppb.New(createdAt) x.UpdatedAt = timestamppb.New(updatedAt) return nil }