What SQL library are you using?

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

Our great sponsors
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • SonarLint - Clean code begins in your IDE with SonarLint
  • Revelo Payroll - Free Global Payroll designed for tech teams
  • Onboard AI - Learn any GitHub repo in 59 seconds
  • 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

    jet

  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • 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

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

  • 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

  • Revelo Payroll

    Free Global Payroll designed for tech teams. Building a great tech team takes more than a paycheck. Zero payroll costs, get AI-driven insights to retain best talent, and delight them with amazing local benefits. 100% free and compliant.

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