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. Bun (Go ORM)
Bu

SQL-first Go ORM · by Uptrace

Bun (Go ORM)

SQL-first Go ORM from Uptrace, built on database/sql, whose query builder reads like SQL and supports PostgreSQL, MySQL/MariaDB, SQL Server, SQLite and Oracle, with migrations and fixtures.

Visit bun.uptrace.dev ↗ Alternatives Open source Open source Self-hostable
bun.uptrace.dev
Bun (Go ORM) homepage
§1

Overview

Bun is a Go ORM developed since 2021 by Uptrace, with most commits from one lead developer. It sits on top of database/sql, so any compatible driver works, and ships dialects for PostgreSQL, MySQL/MariaDB, SQL Server, SQLite and Oracle.

Queries are built with db.NewSelect(), NewInsert() and similar methods that expose SQL concepts directly: ColumnExpr, TableExpr, With for CTEs, and raw expressions where needed. Models use struct tags for tables, columns and relations (has-one, belongs-to, has-many, many-to-many), and results can be scanned into structs, maps, scalars or slices.

Bun includes a migration system that runs Go or SQL migration files, fixtures for test data, soft deletes, query hooks and OpenTelemetry instrumentation. It does not generate migrations from model changes.

Bun suits developers who find GORM too magical but do not want to write every scan by hand. Because it builds on database/sql, you can mix Bun queries with plain SQL and existing drivers, and the query hooks make it easy to log or trace every statement during development.

§2

Pricing and plans

Plan Price What you get
Bun $0 BSD 2-Clause licence

Bun is free and open source (BSD 2-Clause). Its maintainer, Uptrace, sells an observability product that is separate from the ORM.

Source: github.com/uptrace/bun · prices as published, excluding tax.

§3

What it does

SQL-shaped query builder
Select, insert, update, delete, CTEs, subqueries and raw expressions that map closely to the generated SQL.
Relations
Has-one, belongs-to, has-many and many-to-many relations declared with struct tags.
Flexible scanning
Scan results into structs, maps, scalars or slices.
Migrations and fixtures
Run Go or SQL migrations and load fixtures for tests.
Observability
Query hooks and OpenTelemetry support for tracing database calls.
§4

Strengths and limitations

Strengths

  • Close to SQL, so the generated queries are predictable
  • Low overhead over database/sql
  • Broad dialect support including SQL Server and Oracle
  • Small open issue count for its size

Limitations

  • Column and table names in expressions are strings, so many errors are caught at run time
  • Migrations are written by hand; no diffing from models
  • Smaller community than GORM
  • Maintained mainly by one company and one lead developer
§5

Who it suits

Good for

  • Go developers who like SQL but want scanning and relations handled
  • Services that need OpenTelemetry tracing of queries

Look elsewhere if

  • Teams that want compile-time query checking (sqlc or Ent)
  • Projects that need generated migrations
§6

Alternatives to Bun (Go ORM)

Tool From Free option Stages
SO
SeaORM Async dynamic ORM for Rust
— Open source
Da
Dapper .NET micro-ORM
— Open source
SQ
SQLx Async Rust SQL toolkit
— Open source
Prisma ORM Schema-first TypeScript ORM
$10/mo Free tier
Sq
sqlc SQL-to-code compiler
— Open source
Ky
Kysely Type-safe TypeScript SQL query builder
— Open source

All ORMs and database toolkits →

§7

Questions

Is Bun related to the Bun JavaScript runtime?

No. This Bun is a Go ORM from Uptrace; the name is shared by coincidence.

Which databases does Bun support?

PostgreSQL, MySQL and MariaDB, Microsoft SQL Server, SQLite and Oracle.

Does Bun have migrations?

Yes, it runs Go and SQL migration files, but you write them yourself.

Sources read for this page

  • https://bun.uptrace.dev/
  • https://github.com/uptrace/bun
Spec sheet
From
Open source
Free tier
Free to self-host
Stages
HobbyIndieStartupScale-upEnterprise Suits hobby, indie, startup, scale-up
Language
Go
Approach
SQL-first ORM / query builder
Databases
PostgreSQL, MySQL/MariaDB, SQL Server, SQLite, Oracle
Migrations
Yes, Go and SQL migration files (written by hand)
Open source
Yes
Self-host
Yes
EU data
Not stated
Category
ORMs
Visit bun.uptrace.dev ↗

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