Skip to content
whichdevtool?
Categories ▾

Frameworks and UI

Frontend and full-stack frameworks Backend frameworks UI component libraries

Hosting

VPS and cloud servers App hosting and PaaS

Data

Managed databases File and object storage ORMs and database toolkits

AI

AI model APIs

Email

Transactional email APIs Email marketing and newsletters

Payments

Payments and billing

Domains and edge

Domain registrars CDN, DNS and edge security

Operations and identity

Monitoring, uptime and error tracking Auth and identity Background jobs, queues and workflows
Stacks Directory
Ctrl K

Search directory
Menu
StacksDirectory Pricing changes Glossary
VPS and cloud servers App hosting and PaaS Managed databases Transactional email APIs Email marketing and newsletters Domain registrars CDN, DNS and edge security Monitoring, uptime and error tracking Auth and identity Frontend and full-stack frameworks Backend frameworks UI component libraries AI model APIs File and object storage Payments and billing Background jobs, queues and workflows ORMs and database toolkits
  1. Home
  2. ORMs and database toolkits
  3. GORM
GO

Full-featured Go ORM · by GORM (Jinzhu and contributors)

GORM

The most widely used Go ORM: struct-based models, associations, hooks, preloading, transactions and AutoMigrate, with official drivers for MySQL, PostgreSQL, SQLite, SQL Server, TiDB and Oracle.

Visit gorm.io ↗ Alternatives Open source Open source Self-hostable
gorm.io
GORM homepage
§1

Overview

GORM was created by Jinzhu in 2013 and remains the default ORM for many Go projects. You declare structs with tags, open a connection with a driver (MySQL, PostgreSQL through pgx, SQLite, SQL Server, TiDB, Oracle or GaussDB) and query with chainable methods such as db.Where(...).Preload("Orders").Find(&users). It supports has-one, has-many, belongs-to, many-to-many, polymorphic associations and single-table inheritance, plus hooks, nested transactions and save points.

AutoMigrate creates tables, missing columns, indexes and constraints and can widen column types, but its docs say it will not delete unused columns. That makes it convenient in development; for reviewed, versioned migrations teams usually pair GORM with a tool such as Atlas, goose or golang-migrate. GORM Gen, a companion project with its own guide, adds code generation on top.

Because queries are built from strings and interface{} values, many mistakes show up at run time rather than compile time, which is the usual reason Go developers choose sqlc or Ent instead.

§2

Pricing and plans

Plan Price What you get
GORM $0 MIT licence

Free and open source under the MIT licence; there is no paid product.

Source: github.com/go-gorm/gorm · prices as published, excluding tax.

§3

What it does

Associations
Has one, has many, belongs to, many to many, polymorphism and single-table inheritance.
Preload and Joins
Eager-load associations with Preload or Joins to avoid N+1 queries.
Hooks and transactions
Before/after create, save, update, delete and find hooks; nested transactions and save points.
AutoMigrate and Migrator
Create and alter tables from structs, plus a database-independent Migrator interface.
Plugins
DB Resolver for multiple databases and read/write splitting, Prometheus metrics and more.
GORM Gen
Optional companion code generator documented alongside GORM.
§4

Strengths and limitations

Strengths

  • Large community and many examples for Go
  • Covers most ORM needs out of the box, including associations and hooks
  • Official drivers for Oracle, SQL Server and TiDB as well as open-source databases
  • Quick to start with AutoMigrate

Limitations

  • Most query mistakes surface at run time, not compile time
  • AutoMigrate never drops unused columns and is not a versioned migration system
  • Reflection-heavy design adds overhead compared with database/sql or sqlc
  • Development is concentrated around its original author
§5

Who it suits

Good for

  • Go CRUD APIs and admin backends
  • Teams coming from ORMs in other languages
  • Prototypes that benefit from AutoMigrate

Look elsewhere if

  • Teams that want compile-time checked SQL (sqlc) or a generated typed API (Ent)
  • Performance-critical hot paths where reflection overhead matters
§6

Alternatives to GORM

Tool From Free option Stages
EO
Eloquent ORM Active Record ORM for Laravel
— Open source
SQLAlchemy Python SQL toolkit and ORM
— Open source
Drizzle ORM SQL-like TypeScript ORM
— Open source
EF
Entity Framework Core .NET ORM
— Open source
Ec
Ecto Elixir data mapping and query toolkit
— Open source
Bu
Bun (Go ORM) SQL-first Go ORM
— Open source

All ORMs and database toolkits →

§7

Questions

Does GORM support migrations?

It has AutoMigrate and a Migrator interface, but AutoMigrate does not drop columns or keep versioned files; use Atlas, goose or golang-migrate for that.

Which databases does GORM support?

MySQL, PostgreSQL, SQLite, SQL Server, TiDB, Oracle Database and GaussDB are officially supported.

GORM vs sqlc: which should I use?

GORM is a runtime ORM with associations and hooks; sqlc generates type-safe Go from SQL you write, catching errors at build time.

Sources read for this page

  • https://gorm.io/
  • https://github.com/go-gorm/gorm
  • https://gorm.io/docs/connecting_to_the_database.html
  • https://gorm.io/docs/migration.html
Spec sheet
From
Open source
Free tier
Free to self-host
Stages
HobbyIndieStartupScale-upEnterprise Suits hobby, indie, startup, scale-up
Language
Go
Approach
Full ORM (optional code generation with GORM Gen)
Databases
MySQL, PostgreSQL, SQLite, SQL Server, TiDB, Oracle, GaussDB
Migrations
AutoMigrate (additive only); no versioned files
Open source
Yes
Self-host
Yes
EU data
Not stated
Category
ORMs
Visit gorm.io ↗

To report an out-of-date price or limit, use the correction form.

whichdevtool?

Developer and cloud tools compared on price, free tier and limits, each with its source. For side projects, solo developers and small teams.

Categories

  • VPS and cloud servers
  • App hosting and PaaS
  • Managed databases
  • Transactional email APIs
  • Email marketing and newsletters
  • Domain registrars
  • CDN, DNS and edge security
  • Monitoring, uptime and error tracking
  • Auth and identity
  • Frontend and full-stack frameworks
  • Backend frameworks
  • UI component libraries
  • AI model APIs
  • File and object storage
  • Payments and billing
  • Background jobs, queues and workflows
  • ORMs and database toolkits

Research

  • Directory
  • Stacks by project
  • Developer news
  • Pricing changes
  • Glossary

Site

  • About and methods
  • How we make money
  • Suggest a tool or fix
  • Privacy
© 2026 whichdevtool.com Prices change. Each tool page links to its source. We may earn a commission when you sign up through links on this site. How we make money