OSS TanbouSign in with GitHub

add SQL-first query building and model mapping to Go's database/sql layer

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
4,984
Primary language
Go
License
BSD-2-Clause
Repository last updated
Oct 3, 2026
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.

Sources: [3][4][2]

Official sources

  1. [1]uptrace/bun — GitHub repository(2026-10-06)
  2. [2]Bun v1.3.0 — README(2026-10-06)
  3. [3]Bun v1.3.0 — go.mod(2026-10-06)
  4. [4]Bun v1.3.0 — CHANGELOG(2026-10-06)
  5. [5]Bun v1.3.0 release(2026-10-06)
  6. [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. 1

    Get the source

    git clone --depth 1 https://github.com/uptrace/bun.git
  2. 2

    Enter the repository

    cd bun
  3. 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
Check the official README

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

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
Repository last updated
Oct 3, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?