package models import ( "gorm.io/gorm" ) type Link struct { gorm.Model Link string Count uint64 } type ILink interface { // UPDATE @@table SET count = count + 1 WHERE link = @link // If (NOT EXISTS(SELECT * FROM @@table WHERE link = @link)) // BEGIN // INSERT INTO @@table(@link) // IncrementLinkCount(link string) ([]gen.T, error) }