Top "Go-gorm" questions

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

to set singular name for a table in gorm

type user struct { ID int Username string `gorm:"size:255"` Name string `gorm:"size:255"` } I want to create a table 'user' …

go go-gorm
Golang gorm time data type conversion

Situation: I'm using a postgres database and have the following struct: type Building struct { ID int `json:"id,omitempty"` Name …

postgresql go time go-gorm
GORM Not ignoring field with `gorm:"-"`

Using Jinzhu's GORM Package which is fantastic btw, I currently have this struct: type User struct { gorm.Model // The Users …

go go-gorm
How can I retrieve instance of last added item

I'm using github.com/jinzhu/gorm with a mysql backend. I want to retrieve the Id (or the full entity) …

mysql go go-gorm last-insert-id
Golang gorm mocking

I am using gorm in my projects. Can I mock this database orm for testing without database connection? The problem …

database testing go mocking go-gorm
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 := …

mysql go go-gorm
How can I check for errors in CRUD operations using GORM?

The official documentation for GORM demonstrates a way in which one can test for the existence of a record, i.…

go go-gorm
Using a subquery in 'FROM' in gorm

I would like to know how I can use a subquery in FROM clause using gorm. It would look like …

go go-gorm
Why use sql tags in struct in some go libs like gorm?

Well I know the necessity of tags in struct in golang and how is it accessed by reflect in golang. …

sql go go-gorm
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 …

mysql go go-gorm