HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jinzhu
gorm
Go2013–2019
jinzhu / gorm

gorm

GORM V1, V2 moved to https://github.com/go-gorm/gorm

19Distinct people
23Mentions
0Explicit recommenders
657GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

GORM V1, V2 moved to https://github.com/go-gorm/gorm

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 8:59:02 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year23 dated mentions

Observed mentions: 2013-10-28 02:25:18 UTC to 2019-02-08 09:36:47 UTC.

02468102013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 9 mentions; 0 submissions, 9 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC110
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC303
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC211
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC909
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC303
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC404
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
GORM GORM V2 moved to https://github.com/go-gorm/gorm GORM V1 Doc https://v1.gorm.io/
Read the full README on GitHub

What Hacker News says

4 sources
There is no real good framework and anybody can write a trie based router in 2 hours: https://vluxe.io/golang-router.html However, Go ecosystem is starting to look interesting library-wise, as long as your project doesn't involve enterprise integration with legacy XML services or SOAP, because Go sucks at mostly anything XML. For templating I use Jet because the standard templating library is too basic for professional use https://github.com/CloudyKit/jet . I don't use ORM, I use https://github.com/Masterminds/squirrel for query building and https://github.com/jmoiron/sqlx which helps deals with row<=>struct conversion. For database migrations, I use https://github.com/rubenv/sql-migrate , but if you need an ORM gorm https://github.com/jinzhu/gorm is OK if you do code first and sqlboiler https://github.com/volatiletech/sqlboiler is OK if
Read the rest
you do database first. For session handling I use scs github.com/alexedwards/scs , for converting form encoded data to go structs I use github.com/gorilla/schema, for logging I use zap https://github.com/uber-go/zap. For managing roles in an app I use either the voter pattern https://symfony.com/doc/current/security/voters.html in simple cases or casbin github.com/casbin/casbin . For background jobs I used https://github.com/gocraft/work and https://github.com/gocelery/gocelery , for caching i just use redis https://github.com/go-redis/redis , for data validation I used https://github.com/asaskevich/govalidator or https://github.com/go-ozzo/ozzo-validation . For sending mails to customers I used https://github.com/go-gomail/gomail If i need html forms, I first describe form elements as a struct then write form helpers in jet templating to display them like that: type LoginForm struct { Login, Password string Form } func (form *LoginForm) validate(r *http.Request) error { r.ParseForm() form.Decoder().Decode(form, r.Form) form.Errors = map[string][]string{} if err := (requiredValidator{}).validate(form.Login); err != nil { form.Errors["Login"] = append(form.Errors["Login"], err.Error()) } if err := (requiredValidator{}).validate(form.Password); err != nil { form.Errors["Password"] = append(form.Errors["Password"], err.Error()) } return form.getErrors() } func (form LoginForm) LoginFormView() LoginFormView { return LoginFormView{Fields: []Field{ {Name: "Login", Label: "Email", Type: "text", Value: form.Login, Required: true, Errors: form.Errors["Login"]}, {Name: "Password", Label: "Password", Type: "password", Value: form.Password, Required: true, Errors: form.Errors["Password"]}, {Type: "submit", Value: "Submit", Required: true}, {Type: "reset", Value: "Reset", Required: true}, }, Method: "POST", Name: "LoginForm"} } Then I can just write an helper in jet to display the the form view: {* tag attributes *} {{ block attributes() }} {{range .}} {{.Key}}="{{.Value}}" {{end}} {{ end }} {* form field *} {{block field()}} <label> {{.Label}} <br/> {{if .Type == "textarea" }} {* textarea *} <textarea name="{{.Name}}" {{ yield attributes() .Attributes }} >{{.Value}}</textarea> {{ else if .Type == "select" }} {* select *} <select name="{{.Name}}" {{yield attributes() .Attributes }}> {{ range .Options }} <option value="{{.Value}}" {{ if .Selected }} selected {{ end }}>{{.Label}}</option> {{ end }} </select> {{ else }} {* basic input *} <input type="{{.Type}}" name="{{.Name}}" {{ if isset(.Value) }} value="{{.Value}}" {{ end }} {{ yield attributes() .Attributes }} {{ if .Checked == true }} checked {{end}} /> {{ end }} </label> {{end}} {* form template *} {{block form()}} <form action="{{.Action}}" name="{{.Name}}" method="{{.Method}}"> <fieldset> {{ range .Fields }} {{yield field() .}} {{end}} </fieldset> </form> {{end}} This is the exact app structure I use to deal with dependencies and filters : https://medium.com/statuscode/how-i-write-go-http-services-a...
In Ask HN: What is the current state of web frameworks in Golang?
I only tested it very quickly as part of a lightning talk. however after a quick search I was able to find someone who did do some benchmark testing: https://github.com/jinzhu/gorm/issues/298#issuecomment-65747... gorm didn't fare to well against the non-ORM options. The method in which ORM's use to well be ORM's in Go is called reflection. It's generally considered to be a performance hit and most devs I spoken to will try to avoid using it if possible.Exactly how big of a performance hit it is depends on the situation.IT performs more allocations than non-reflection code. So in the case of an ORM where you may be performing these actions in loop (a query that returns hundreds or thousands of results) that may be deeply nested (many relations, user that has posts that have images that have tags and so on) it could end up being a bottle n
Read the rest
eck. Additionally there was another detail that really turned me off from gorm. Consider the following code: user := User{} db := getGormDB() db.Delete(user) If you were to run that Go code, given an actual gorm DB connection, the gorm ORM would delete every row in the user table. EDIT: I just noticed those benchmarks are pretty old. It's very possible and probably quite likely things have improved since then.
In Ask HN: Considering using Golang for my main language for web development
ORM's are not as popular in Go as they are in Python. The closest I can think of is [gorm](https://github.com/jinzhu/gorm). If you absolutely think you must have an ORM that's probably your best bet. Be aware that it will come with some pretty significant performance penalties. Even small applications will take noticeably longer to compile and run a bit slower.I don't have exact numbers for this unfortunately. I also have a feeling that K/V stores like Dynamo, etcd and Mongo are more popular in the Go world than SQL DB's but that's just a feeling I get. That being said, if you are building a web application with Go you shouldn't think about it the way you think of building one in Python.I am primarily a Python dev myself and it takes some readjustment to get in to the Go way of doing things.Go really shines when building smaller, more foc
Read the rest
used API driven applications. I'm sure it can be done and I'm sure folks are doing it but if you are trying to build a sprawling Django/Pyramid webapp in Go you will probably not enjoy it as much. Here are some packages (along with the aforementioned gorm) I would recommend taking a look at: Echo: A nice little HTTP framework with a focus on JSON API's. https://echo.labstack.com gRPC: Not really for webapps (and not only for Go) but a framework for building RPC microservices: https://grpc.io/ net/http: A part of the standard library. The Go stdlib HTTP server is prod ready out of the box. You can get quite far with only the stdlib in Go: https://golang.org/pkg/net/http/ encoding/json: If you have used Marshmallow or the DRF in Python you can do most of the serialization you can do with those right out of the box in Go using struct tags and the stdlib json package: https://golang.org/pkg/encoding/json/ struct tags: https://golang.org/ref/spec#Tag
In Ask HN: Considering using Golang for my main language for web development
Gin [0] is a good place to start for Go web frameworks Gorilla [1] is more of a toolkit, but very common and very useful There's also Buffalo [2] for an opinionated kitchen sink included web framework. As for SQL ORMs, sqlx [3] and gorm [4] seem to be the most popular ones. But really the `database/sql package` is probably all you need. As for drivers, here's a list [5] [0] https://github.com/gin-gonic/gin [1] http://www.gorillatoolkit.org/ [2] https://github.com/gobuffalo/buffalo [3] https://github.com/jmoiron/sqlx [4] https://github.com/jinzhu/gorm [5] https://github.com/golang/go/wiki/SQLDrivers
In Ask HN: Considering using Golang for my main language for web development

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.