MCPcopy Create free account
hub / github.com/an0nfunc/ALHP / sqlSave

Method sqlSave

ent/dbpackage_create.go:364–380  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

362 }
363 if v, ok := _c.mutation.Pkgbase(); ok {
364 if err := dbpackage.PkgbaseValidator(v); err != nil {
365 return &ValidationError{Name: "pkgbase", err: fmt.Errorf(`ent: validator failed for field "DBPackage.pkgbase": %w`, err)}
366 }
367 }
368 if v, ok := _c.mutation.Status(); ok {
369 if err := dbpackage.StatusValidator(v); err != nil {
370 return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "DBPackage.status": %w`, err)}
371 }
372 }
373 if _, ok := _c.mutation.Repository(); !ok {
374 return &ValidationError{Name: "repository", err: errors.New(`ent: missing required field "DBPackage.repository"`)}
375 }
376 if v, ok := _c.mutation.Repository(); ok {
377 if err := dbpackage.RepositoryValidator(v); err != nil {
378 return &ValidationError{Name: "repository", err: fmt.Errorf(`ent: validator failed for field "DBPackage.repository": %w`, err)}
379 }
380 }
381 if _, ok := _c.mutation.March(); !ok {
382 return &ValidationError{Name: "march", err: errors.New(`ent: missing required field "DBPackage.march"`)}
383 }

Callers

nothing calls this directly

Calls 3

checkMethod · 0.95
createSpecMethod · 0.95
ErrorMethod · 0.65

Tested by

no test coverage detected