Related questions
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 environment, it would be useful to be able to log to the console the mysql queries that have been called.
…
Go-gorm mysql "unsupported type []string, a slice of string"
I use gorm, and try to create transaction to mysql. I have a struct
type Game struct {
Images []string
}
game := Game{Images: []string{"1.png", "2.png"}}
db := Database()
tx := db.Begin()
if err := tx.Create(&game).Error; err != nil {
tx.…
Fetching NULL datetime value in MySQL using GORM
I want to fetch the last visit_details row having out_time as NULL using Gorm.
NIL is itself a type where VisitDetail OutTime is mysql.NullTime.
Code:-
var visitDetail models.VisitDetail
db.Where("out_time=? ", nil).Last(&…