MCPcopy Create free account
hub / github.com/Comfy-Org/registry-backend / scanValues

Method scanValues

ent/gitcommit.go:66–81  ·  view source on GitHub ↗

scanValues returns the types for scanning values from sql.Rows.

(columns []string)

Source from the content-addressed store, hash-verified

64
65// scanValues returns the types for scanning values from sql.Rows.
66func (*GitCommit) scanValues(columns []string) ([]any, error) {
67 values := make([]any, len(columns))
68 for i := range columns {
69 switch columns[i] {
70 case gitcommit.FieldCommitHash, gitcommit.FieldBranchName, gitcommit.FieldRepoName, gitcommit.FieldCommitMessage, gitcommit.FieldAuthor, gitcommit.FieldPrNumber:
71 values[i] = new(sql.NullString)
72 case gitcommit.FieldCreateTime, gitcommit.FieldUpdateTime, gitcommit.FieldCommitTimestamp, gitcommit.FieldTimestamp:
73 values[i] = new(sql.NullTime)
74 case gitcommit.FieldID:
75 values[i] = new(uuid.UUID)
76 default:
77 values[i] = new(sql.UnknownType)
78 }
79 }
80 return values, nil
81}
82
83// assignValues assigns the values that were returned from sql.Rows (after scanning)
84// to the GitCommit fields.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected