Bun is a SQL-first Golang ORM that prioritizes writing queries in Go with type safety while maintaining the expressiveness of SQL across PostgreSQL, MySQL, MSSQL, SQLite, and Oracle databases.
The tool addresses the tension between ORMs that abstract away SQL and the need for readable, maintainable complex queries. Rather than hiding SQL behind a query builder abstraction, Bun embraces SQL syntax directly in Go code, leveraging Go's static typing to catch errors at compile time. It provides flexible result scanning that allows queries to populate structs, maps, scalars, or slices, and includes features like table relationships defined through struct tags, bulk operations for large datasets, migrations for schema versioning, and built-in support for soft deletes.
Bun suits teams building Go applications that need to work across multiple SQL databases without rewriting queries for each one. It works well for projects requiring complex queries that would become unwieldy in traditional ORM abstractions, and for applications where observability matters—the tool includes query logging for development and OpenTelemetry integration for production monitoring. The project is built on Go's standard library `database/sql` with minimal overhead, positioning it as a lightweight alternative to heavier ORMs.
The project maintains steady engagement with community discussions and welcomes contributions through a documented contributing guide. Development activity shows consistent attention to both core functionality and production-readiness features like migrations and observability support.