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

Method check

ent/gitcommit_create.go:207–230  ·  view source on GitHub ↗

check runs all checks and user-defined validators on the builder.

()

Source from the content-addressed store, hash-verified

205
206// check runs all checks and user-defined validators on the builder.
207func (gcc *GitCommitCreate) check() error {
208 if _, ok := gcc.mutation.CreateTime(); !ok {
209 return &ValidationError{Name: "create_time", err: errors.New(`ent: missing required field "GitCommit.create_time"`)}
210 }
211 if _, ok := gcc.mutation.UpdateTime(); !ok {
212 return &ValidationError{Name: "update_time", err: errors.New(`ent: missing required field "GitCommit.update_time"`)}
213 }
214 if _, ok := gcc.mutation.CommitHash(); !ok {
215 return &ValidationError{Name: "commit_hash", err: errors.New(`ent: missing required field "GitCommit.commit_hash"`)}
216 }
217 if _, ok := gcc.mutation.BranchName(); !ok {
218 return &ValidationError{Name: "branch_name", err: errors.New(`ent: missing required field "GitCommit.branch_name"`)}
219 }
220 if _, ok := gcc.mutation.RepoName(); !ok {
221 return &ValidationError{Name: "repo_name", err: errors.New(`ent: missing required field "GitCommit.repo_name"`)}
222 }
223 if _, ok := gcc.mutation.CommitMessage(); !ok {
224 return &ValidationError{Name: "commit_message", err: errors.New(`ent: missing required field "GitCommit.commit_message"`)}
225 }
226 if _, ok := gcc.mutation.CommitTimestamp(); !ok {
227 return &ValidationError{Name: "commit_timestamp", err: errors.New(`ent: missing required field "GitCommit.commit_timestamp"`)}
228 }
229 return nil
230}
231
232func (gcc *GitCommitCreate) sqlSave(ctx context.Context) (*GitCommit, error) {
233 if err := gcc.check(); err != nil {

Callers 2

sqlSaveMethod · 0.95
SaveMethod · 0.45

Calls 7

CommitHashMethod · 0.80
BranchNameMethod · 0.80
RepoNameMethod · 0.80
CommitMessageMethod · 0.80
CommitTimestampMethod · 0.80
CreateTimeMethod · 0.45
UpdateTimeMethod · 0.45

Tested by

no test coverage detected