Top "Go-gorm" questions

GORM is an ORM library for the programming language Go, developed by jinzhu.

Gorm Golang orm associations

I'm using Go with the GORM ORM. I have the following structs. The relation is simple. One Town has multiple …

orm go go-gorm
How to Create or Update a record with GORM?

Gorm has a FirstOrCreate method and a FirstOrInit but how to check afterwards if the record was actually created? I …

go orm go-gorm
reflect.Value.Set using unaddressable value

g.GET("/", func(c echo.Context) error { var users []models.User err := db.Find(users).Error if err != nil { fmt.…

go go-gorm
golang gorm Access the underlying mysql query

Is there a way to get the sql query log from https://github.com/jinzhu/gorm? e.g. in dev …

mysql logging go go-gorm
Using GORM, is there a way for me to set a default value as a PostgreSQL function?

I want something like: type User struct { ID int `sql:"default:<myfunction>"` } Is this possible with GORM?

go go-gorm
how preload a full hierarchy in GO using GORM

I have a hierachy composed by several structures type Entry struct { Id int CreatedAt time.Time UpdatedAt time.Time Fields []…

go go-gorm
How to save time in the database in Go when using GORM and Postgresql?

I'm currently parsing a time string and saving it to the db (Postgresql): event.Time, _ := time.Parse("3:04 PM", "9:00 PM") // value …

postgresql go go-gorm
Read multipart-form data as []byte in GO

I'm using GIN as GO framework, im having an issue when uploading file and directly convert image as byte so …

go file-upload blob go-gorm
How do you do UUID in Golangs Gorm?

I have the following model... type User struct { ID string `sql:"type:uuid;primary_key;default:uuid_generate_v4()"` FirstName …

postgresql go go-gorm
Golang Gorm one-to-many with has-one

I'm trying to learn Go and Gorm by building a little prototype order management app. The database is MySQL. With …

go one-to-many one-to-one go-gorm