What SQL library are you using?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/golang

Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • SaaSHub - Software Alternatives and Reviews
  • bun

    SQL-first Golang ORM (by uptrace)

    I usually work with PostgreSQL and have used https://github.com/go-pg/pg. https://github.com/uptrace/bun is its successor.

  • jet

    Type safe SQL builder with code generation and automatic query result data mapping (by go-jet)


  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • ent

    An entity framework for Go

  • pgx

    PostgreSQL driver and toolkit for Go

    I use postgres & now settled on jackc/pgx. Prisma was my favourite before they terminated development so ended up just learning to use raw SQL statements.

  • sqlc

    Generate type-safe code from SQL

    I tried SQLC but generating fields with pointers instead of sql.Null* is a pain + custom types is also difficult to get working with the Value/Scanner interface.

  • GORM

    The fantastic ORM library for Golang, aims to be developer friendly

    GORM is the best, it features an ORM database with syntax similar to ruby on rails.

  • goqu

    SQL builder and query library for golang

    Pgx + Goqu

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • igor

    igor is an abstraction layer for PostgreSQL with a gorm like syntax.

    The one I created since I only use PostgreSQL: https://github.com/galeone/igor

  • sqlf

    sqlf generates parameterized SQL statements in Go, sprintf style

  • go-pg

    Golang ORM with focus on PostgreSQL features and performance

    I usually work with PostgreSQL and have used https://github.com/go-pg/pg. https://github.com/uptrace/bun is its successor.

  • ozzo-dbx

    A Go (golang) package that enhances the standard database/sql package by providing powerful data retrieval methods as well as DB-agnostic query building capabilities.

    If you are looking for a query builder only, I also could recommend https://github.com/go-ozzo/ozzo-dbx (it doesn't seem to be maintained but its stable and so far I haven't stumbled on a bug using it for an internal tool)

  • go-sqlite-lite

    SQLite driver for the Go programming language

  • kala-go

    An authorization framework written in Go based on Google's Zanzibar.

    Can highly recommend Ent, I've used to build a Google Zanzibar clone and it was awesome to work with. https://github.com/DeluxeOwl/kala-go

  • Squirrel

    Fluent SQL generation for golang

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts