On this page
Overview
Bun is a SQL-first ORM for Go. On top of database/sql, it provides Select/Insert/Update/Delete query builders, struct model mapping, relationships, bulk operations, migrations, query hooks, and OpenTelemetry integration across PostgreSQL, MySQL/MariaDB, SQLite, MSSQL, and Oracle.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Build complex queries with an API that keeps SQL structure visible
CTEs, joins, subqueries, grouping, and bulk operations can be composed in Go while results are scanned into structs, maps, scalars, or slices.
Sources: [2]
Combine relationships, migrations, query hooks, and OpenTelemetry in one data layer
Struct tags define relationships, while migration packages, debug hooks, and OpenTelemetry hooks cover schema workflows and runtime observability.
Sources: [2]
Best fit
Fits backends that want ORM ergonomics while retaining SQL visibility and database/sql compatibility
It is useful for Go services on PostgreSQL, MySQL, SQLite, and related databases that want explicit SQL design with less model-mapping and query-composition boilerplate.
Sources: [2]
Before adoption
v1.3.0 declares Go 1.24/toolchain 1.24.1 and includes several breaking and security changes
Version 1.3.0 changes Count/Limit/Offset APIs to int64, enables PostgreSQL TLS certificate verification, rejects duplicate migration IDs and NUL-containing strings, and hardens SQL line-comment handling. Upgrades from 1.2 should test compilation, TLS trust, migration IDs, and query formatting.
Official sources
- [1]uptrace/bun — GitHub repository(2026-10-06)
- [2]Bun v1.3.0 — README(2026-10-06)
- [3]Bun v1.3.0 — go.mod(2026-10-06)
- [4]Bun v1.3.0 — CHANGELOG(2026-10-06)
- [5]Bun v1.3.0 release(2026-10-06)
- [6]Bun BSD-2-Clause license(2026-10-06)
Supplemental curator note
Bun preserves SQL structure rather than hiding it behind a heavy abstraction. Version 1.3.0 contains security and breaking changes around TLS verification, SQL formatting, migrations, and integer types, so upgrades from 1.2 should be tested carefully.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/uptrace/bun.git - 2
Enter the repository
cd bun - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
4,984 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 21
- Open PRs
- 9
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- golang
- go
- orm
- sql
- mysql
- postgresql
- sqlite
- sqlite3
- database
- mssql
- oracle
- Stars
- 4,984
- Forks
- 308
- Watchers
- 31
- Open issues
- 24
- Contributors
- 128
- Owner type
- Organization
- Primary language
- Go
- License
- BSD-2-Clause
- Repository last updated
- Oct 3, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- asyncpg8,098 Stars
3 shared tag(s) · 2 shared category(s)
access PostgreSQL directly from asyncio through a high-performance Python driver
Python - jOOQ6,794 Stars
3 shared tag(s) · 2 shared category(s)
Build SQL through a type-safe Java DSL and generate code from database schemas
Java - Sequel5,098 Stars
3 shared tag(s) · 2 shared category(s)
Keep SQL structure visible while combining datasets, models, transactions, and migrations in Ruby
Ruby - Alembic4,431 Stars
3 shared tag(s) · 2 shared category(s)
track SQLAlchemy model changes as versioned database schema migrations
Python - sqlc18,348 Stars
5 shared tag(s) · 2 shared category(s) · Same language
keep SQL as the source of truth and generate type-safe data-access code
Go - golang-migrate18,954 Stars
5 shared tag(s) · 1 shared category(s) · Same language
apply versioned migrations in order from a CLI or Go library across multiple databases
Go
Report incorrect information
Tell us if any listing information is incorrect or outdated.