ubgo is in early alpha: libraries and APIs may still change.

Skip to content
ubgo Alpha

gormuuid

Postgres uuid[] field type for GORM.

go get github.com/ubgo/gormuuid
Language
Go
Go version
1.17
Core deps
2 direct
Latest tag
v0.0.4
License
Apache-2.0
Go modules
1

Code from the README

type User struct {
  TagIDs gormuuid.UUIDArray  `gorm:"type:uuid[]"` // Column will take {} as default
}

var tagIds gormuuid.UUIDArray = []uuid.UUID{uuid.New(), uuid.New()}
db.Create(&User{
  TagIDs: tagIds,
})

From the gormuuid README.