ORM

26 projects

Go ORMs map structs to tables and handle relations, but they differ sharply in how. Reflection-based ORMs read struct tags at runtime and build queries dynamically. Code-generation ORMs produce typed query APIs from a schema, either one you define in Go or one read from an existing database. SQL-first libraries keep queries close to SQL while still scanning rows into structs.

GORM is by far the most used Go ORM; it is reflection-based and provides associations, hooks, preloading and automatic migrations. ent, created at Meta, generates a typed API from a schema written in Go and models data as a graph of entities and edges. SQLBoiler generates models from an existing database schema, and bob, from a different author, describes itself as SQLBoiler's successor with a query builder and factories. uptrace/bun is SQL-first and succeeds go-pg, supporting PostgreSQL, MySQL, SQLite and SQL Server. upper/db, gorp, pop and reform are older alternatives. Prisma Client Go is archived. sqlc, often considered the main alternative to an ORM, is listed under SQL Query Builders.

Choose GORM for quick CRUD and a large community, accepting runtime errors for some mistakes. Choose ent or bob when you want the compiler to check queries. Choose bun if you think in SQL but want struct mapping, and consider sqlc with plain database/sql when your queries are mostly fixed.

GORMby go-gorm

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

gorm.io/gormGo 1.18+ 3 dependenciesv1.31.2updated 9d ago

40k

entby facebook

An entity framework for Go. Simple, yet powerful ORM for modeling and querying data.

entgo.io/entGo 1.26+ 16 dependenciesv0.14.6updated 19d ago

17.2k

SQLBoilerby volatiletech

ORM generator. Generate a featureful and blazing-fast ORM tailored to your database schema.

github.com/aarondl/sqlboiler/v4Go 1.24+ 17 dependenciesv4.19.5updated 3mo ago

7k

bunby uptrace

SQL-first Golang ORM. Successor of go-pg.

github.com/uptrace/bunGo 1.24+ 6 dependenciesv1.3.0updated 4d ago

5k

gorpby go-gorp

Go Relational Persistence, ORM-ish library for Go.

github.com/go-gorp/gorp/v3Go 1.18+ 5 dependenciesv3.0.1updated 1y ago

3.7k

upper.io/dbby upper

Single interface for interacting with different data sources through the use of adapters that wrap mature database drivers.

github.com/upper/db/v4Go 1.23+ 13 dependenciesv4.10.0updated 27d ago

3.7k

gormtby xxjwxc

Mysql database to golang gorm struct.

github.com/xxjwxc/gormtGo 1.24+ 11 dependenciesv2.1.gormupdated 3mo ago

2.4k

Prisma

Prisma Client Go, Typesafe database access for Go.

v0.47.0archived

2.3k

bobby stephenafamo

SQL query builder and ORM/Factory generator for Go. Successor of SQLBoiler.

github.com/stephenafamo/bobGo 1.24+ 30 dependenciesv0.50.0updated 28d ago

1.8k

go-sqlbuilderby huandu

A flexible and powerful SQL string builder library plus a zero-config ORM.

github.com/huandu/go-sqlbuilderGo 1.18+ 3 dependenciesv1.44.1updated 10d ago

1.7k

pop/sodaby gobuffalo

Database migration, creation, ORM, etc... for MySQL, PostgreSQL, and SQLite.

github.com/gobuffalo/pop/v6Go 1.26+ 21 dependenciesv6.4.1updated 7d ago

1.5k

reformby go-reform

Better ORM for Go, based on non-empty interfaces and code generation.

gopkg.in/reform.v1Go 1.17+ 8 dependenciesv1.5.1updated 14d ago

1.5k

relby go-rel

Modern Database Access Layer for Golang - Testable, Extendable and Crafted Into a Clean and Elegant API.

github.com/go-rel/relGo 1.21+ 3 dependenciesv0.43.0updated 1d ago

788

Zoomby albrow

Blazing-fast datastore and querying engine built on Redis.

updated 3y ago

311

go-sqlby rushteam

A easy ORM for mysql.

github.com/rushteam/gosqlGo 1.13+ 2 dependenciesupdated 4y ago

178

GoooQoby doytowin

A database access framework based on declarative query model.

github.com/doytowin/goooqoGo 1.18+ 3 dependenciesv0.3.0updated 2mo ago

164

golobby/ormby golobby

Simple, fast, type-safe, generic orm for developer happiness.

github.com/golobby/ormGo 1.18+ 8 dependenciesv1.2.4updated 4mo ago

162

grimoireby Fs02

Grimoire is a database access layer and validation for golang. (Support: MySQL, PostgreSQL and SQLite3).

github.com/Fs02/grimoireGo 1.14+ 7 dependenciesv1.5.0updated 5y ago

161

go-storeby gosuri

Simple and fast Redis backed key-value store library for Go.

updated 9y ago

113

go-firestormby jschoedt

A simple ORM for Google/Firebase Cloud Firestore.

github.com/jschoedt/go-firestorm6 dependenciesupdated 4y ago

53

cachemeby Yiling-J

Schema based, typed Redis caching/memoize framework for Go.

github.com/Yiling-J/cacheme-goGo 1.16+ 7 dependenciesv0.1.7updated 4y ago

25

go-dbwby hashicorp

A simple package that encapsulates database operations.

github.com/hashicorp/go-dbwGo 1.25+ 16 dependenciesv0.1.5updated 3mo ago

18

CQLby FrancoLiberali

Built on top of GORM, adds compile-time verified queries based on auto-generated code.

github.com/FrancoLiberali/cqlGo 1.22+ 13 dependenciesupdated 1mo ago

17

loreby abrahambotros

Simple and lightweight pseudo-ORM/pseudo-struct-mapping environment for Go.

updated 9y ago

14

marlow

Generated ORM from project structs for compile time safety assurances.

github.com/marlow/marlowGo 1.14+ 2 dependenciesupdated 6y ago

12

XORM

Simple and powerful ORM for Go. (Support: MySQL, MyMysql, PostgreSQL, Tidb, SQLite3, MsSql and Oracle).

gitea.com

Esc

Type to search every entry. ↑↓ to move, Enter to open.