HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
aarondl
sqlboiler
Go2017–2024
aarondl / sqlboiler

sqlboiler

Generate a Go ORM tailored to your database schema.

14Distinct people
15Mentions
0Explicit recommenders
7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Generate a Go ORM tailored to your database schema.

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, 12:54:37 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 year15 dated mentions

Observed mentions: 2017-08-22 14:12:17 UTC to 2024-09-09 23:01:23 UTC.

012342017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024

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
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC211
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC312
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC404
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202

What Hacker News says

15 sources
I was expecting the article to contain a note about SQLBoiler (https://github.com/volatiletech/sqlboiler) and why they didn't use it, but it doesn't. So I was expecting SQLBoiler to be heavily mentioned in the comments, but it's not the case. If you want to see a (slightly heated) debate about `sqlc` versus SQLBoiler with their respective creators: https://www.reddit.com/r/golang/comments/e9bvrt/sqlc_compile... Note that SQLBoiler does not seem to be compatible with `pgx`. [edit: grammar]
In How We Went All In on sqlc/pgx for Postgres and Go
GORM is nice for beginners because it's pretty easy to get started with, but in my experience starts to fall apart when you need to do anything more complex or start to scale up. I've had good experiences with SQLBoiler [0] on the other hand. I haven't used it in for anything in production, but it's been a breeze to use in a couple of personal projects, and it handles complex SQL queries much better compared to GORM. 0: https://github.com/volatiletech/sqlboiler
In An Unlikely Database Migration
This is really interesting. I spent a while a few weeks ago looking around for a serious, open-source BaaS effort backed by... anyone. I've been influenced by code generators like xo/xo [0] and sqlboiler [1] recently (so you can have type-safe APIs and you still manage/own the resulting code). My bet is that you can generate an entire API _and_ basic CRUD browser UI from a db schema. I've been working on a code generator that does this. It can currently generate an entire Go REST API with CRUD operations from a PostgreSQL database. Next is to generate a React/TypeScript UI and add auth support. The advantage a project like mine has over this is that it defines a standard API specification and you can build an APIs and UIs against that standard. Right now the only API is Go, but I'd like to build a Java one too and would be open to communi
Read the rest
ty submissions. Same thing goes for database dialect. Right now it's PostgreSQL only, but this kind of code generation can be done on any database once a driver is added. Won't link to it here because the whole thing is WIP but it's on Github. I see this kind of project as a long-term base for rapidly building any sort of db-based applications in the future. [0] https://github.com/xo/xo [1] https://github.com/volatiletech/sqlboiler
In Supabase (YC S20) – An open source Firebase alternative
This is similar to sqlc for Golang: https://github.com/kyleconroy/sqlc If you're looking for the ability to generate type-safe SQL – given you write SQL correctly – this project is pretty good. Aalso a fan of SQLBoiler (https://github.com/volatiletech/sqlboiler) for Golang, for simple type safety: `models.Accounts(models.AccountWhere.ID.EQ(id)).One(ctx, db)`. Though SQLBoiler breaks with left joins, as it auto-generates your structs and maps results 1-1 with table definitions. In this case you have to custom type something, either using sqlc or squirrel.
In Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
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'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?

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.