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 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM 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

23 sources
No. And there alternatives. The best known is probably Revel: https://revel.github.io For a doctrine (ORM) alternative you have for example https://github.com/jinzhu/gorm The point about Go; using those types of tools is generally frowned upon in the community. It's overkill for most (micro)services. But few gophers build a full-stack website in a single application. I'm a gopher; I wouldn't want to use Revel or Gorm. I feel I'd be using the wrong tool for the job. I'd more likely use Django or Symfony when I'd need to build a full-stack SSR. If a backend API is used by different clients (mobile apps, SPA, servers, ...) using a full-stack SSR framework like Symfony or Django doesn't make much sense anymore. You wouldn't use 90% of the framework's features. It feels like bloat. But many websites don't need to serve different clients. The a
Read the rest
uthor's decision to go from Golang to PHP makes perfect sense if he's building SSR websites.
In Moving from Go to PHP Again
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
I've started using Echo[1] and it seems to provide most of what I'm looking for (routing, context, sessions, CSRF protection, form/json binding, etc). For templating, I'm using QuickTemplate[2] which creates statically generated templates, but Pongo2[3] and Jet[4] also look reasonable. sqlx[5], gorm[6], and sqlboiler[7] all seem reasonable for database access, depending on what your style is (sqlx being oriented toward manual statements, gorm being reflection-based orm-ish, and sqlboiler using go generate's code generation to make statically generated access for you). If you don't want to piece things together yourself (and want a more Rails-like experience), Buffalo[8] is probably your best bet. [1] https://echo.labstack.com/ [2] https://github.com/valyala/quicktemplate [3] https://github.com/flosch/pongo2 [4] https://github.com/Cloudy
Read the rest
In Ask HN: What is your Golang web-dev tech stack?
I want to see the Go community and it's libraries flourish. But having libraries like this around which provide extra confusing and probably poorly maintained choices for users is detrimental to it's overall health. There's already great examples of maintenance rot found even amongst the very popular libraries like go-yaml and httprouter. One thing you can say about Go is it has 1000 Micro-frameworks, ORMs, Routers, and Logging libraries. Most of them are within a percent of giving the exact same feature set with the exact same approach and and ever so slightly different API. Lots of them share the same mistakes as they are a user's first project or a learning arena (though routing has been a pretty benchmarked area so that's been better than the others). As someone who has open source libraries, and who uses Go in their day job and at ho
Read the rest
me my personal opinion is that Go needs fewer, stronger libraries. Well supported, well maintained pieces rather than this illusion of choice that's presented today. I'm sorry if I came off as crass in my reply to the OP but that's simply the state I see in the community today. Ideally there'd be 2-4 ORMs in Go that would be the goto. And half would use a code-generation approach, half would use the reflection based approach. https://github.com/astaxie/beego/tree/master/orm https://github.com/cosiner/gomodel https://github.com/jinzhu/gorm https://github.com/go-gorp/gorp https://github.com/coocood/qbs https://github.com/go-reform/reform https://github.com/vattle/sqlboiler https://github.com/upper/db https://github.com/astaxie/beedb https://github.com/naoina/genmai https://github.com/monochromegane/argen https://github.com/square/squalor https://github.com/theduke/go-dukedb https://github.com/dropbox/godropbox/tree/master/database/sq... (...and more) And now: https://github.com/samonzeweb/godb Do we truly need this? This one in particular feels a lot like upperdb. And if it's for learning only, don't publish it to things like hackers news which makes people seem like it's something you should use as opposed to the more mature libraries out there. This is what I meant by fragmentation, it's an illusion of choice. There are actually very few logging/routing/orm/micro-framework libraries you should really use if you're serious about a project.
In Show HN: Godb is a simple Go ORM for PostgreSQL, MySQL, SQLite and SQL Server
Like you describe in the book, I had written a web-app in Go in which I was doing all the SQL handling manually, I found that it became very difficult to maintain this over time as I added new columns and more tables. Just the other day I switched to using GORM (github.com/jinzhu/gorm) for my database drivers and so far it's been a life-saver. Since this is a book about not using frameworks, GORM might be overkill for what you want to do, but I thought it was worth mentioning.
In Show HN: Book about writing web apps in Go without a framework
Not including an ORM layer does not decrease "value" of this framework, because you can attach such lib on your own. In Go the you are very flexible to set up a "a place where data will be stored/queried" - there is fabulous database/sql (or additional layers like lib/pq [1]) which is great for many use cases; also orm-like solutions like gocraft/dbr [2]; oh, I also should mention Gorm [3] or Bolt [4]. Setting them up is really easy in any Go web frameworks because (almost) all database modules rely on abstraction from stdlib. [1] https://github.com/lib/pq [2] https://github.com/gocraft/dbr [3] https://github.com/jinzhu/gorm [4] https://github.com/boltdb/bolt
In Iris: Fast back-end web framework for Go
RoR is an awesome framework that has (almost) everything you need to build monolithic web apps. Go is a different story. You need to join the pieces together to make something functional. You will probably need: - A router like [Gin](https://github.com/gin-gonic/gin) - A [XSRF token generator and validator](https://github.com/golang/net/blob/master/xsrftoken/xsrf.go) - An ORM like [Gorm](https://github.com/jinzhu/gorm) or [XORM](https://github.com/go-xorm/xorm) - A template lib like the one that comes with the stdlib - Node for front-end (ugh, this is the harder part) - The testing library in stdlib plus maybe [testify](https://github.com/stretchr/testify) - etc... Many nice things are missing. Some were [shamelessy copied by other people](https://github.com/go-testfixtures/testfixtures). Some you may need to implement yourself. The big a
Read the rest
dvantages is that Go has much better performance, and run on Windows, etc.
In Go best practices, six years in

Showing the 15 most recent of 23 sources. Enable JavaScript to search and browse every indexed mention.

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.