MCPcopy Create free account
hub / github.com/davecheney/pub / GormDBDataType

Method GormDBDataType

models/actor.go:71–80  ·  view source on GitHub ↗
(db *gorm.DB, field *schema.Field)

Source from the content-addressed store, hash-verified

69 peer := &Peer{
70 Domain: a.Domain,
71 }
72 // save peer ignore if exists
73 return tx.Clauses(clause.OnConflict{
74 Columns: []clause.Column{{Name: "domain"}},
75 DoNothing: true,
76 }).Create(peer).Error
77}
78
79func (a *Actor) updateInstanceDomainsCount(tx *gorm.DB) error {
80 return tx.Model(&Instance{}).Where("1 = 1").UpdateColumns(map[string]interface{}{
81 "domains_count": tx.Select("COUNT(distinct domain)").Model(&Actor{}),
82 }).Error // update domain count on all instances.
83}

Callers

nothing calls this directly

Calls 1

NameMethod · 0.80

Tested by

no test coverage detected