// Code generated by "sqlbgen Job"; DO NOT EDIT.

package main

import (
	"database/sql"
	"fmt"
)

func _() {
	// Validate the struct fields haven't changed. If this doesn't compile you probably need to `go generate` again.
	var j Job
	_ = Job{j.ID, j.Status, j.Error, j.Operation, j.Time, j.UseMBID, j.SourcePath, j.DestPath, j.SearchResult, j.ResearchLinks, j.Confirm}
}

func (Job) PrimaryKey() string {
	return "id"
}

func (j Job) Values() []sql.NamedArg {
	return []sql.NamedArg{sql.Named("id", j.ID), sql.Named("status", j.Status), sql.Named("error", j.Error), sql.Named("operation", j.Operation), sql.Named("time", j.Time), sql.Named("use_mbid", j.UseMBID), sql.Named("source_path", j.SourcePath), sql.Named("dest_path", j.DestPath), sql.Named("search_result", j.SearchResult), sql.Named("research_links", j.ResearchLinks), sql.Named("confirm", j.Confirm)}
}

func (j *Job) ScanFrom(rows *sql.Rows) error {
	columns, err := rows.Columns()
	if err != nil {
		return err
	}
	dests := make([]any, 0, len(columns))
	for _, c := range columns {
		switch c {
		case "id":
			dests = append(dests, &j.ID)
		case "status":
			dests = append(dests, &j.Status)
		case "error":
			dests = append(dests, &j.Error)
		case "operation":
			dests = append(dests, &j.Operation)
		case "time":
			dests = append(dests, &j.Time)
		case "use_mbid":
			dests = append(dests, &j.UseMBID)
		case "source_path":
			dests = append(dests, &j.SourcePath)
		case "dest_path":
			dests = append(dests, &j.DestPath)
		case "search_result":
			dests = append(dests, &j.SearchResult)
		case "research_links":
			dests = append(dests, &j.ResearchLinks)
		case "confirm":
			dests = append(dests, &j.Confirm)
		default:
			return fmt.Errorf("unknown column name %q", c)
		}
	}
	return rows.Scan(dests...)
}
