qmetrics.net

Bun

SQL-first Go ORM with multi-database support

Bun screenshot

Bun is a Go ORM that keeps SQL visible while adding type-safe queries, scanning, and migrations across several SQL engines.

Overview

Bun is a Go package for working with relational databases using an SQL-first style. Instead of hiding SQL behind a heavy DSL, it lets you express selects, joins, and analytics-style queries in Go while staying close to the SQL you would write by hand.

The ORM targets PostgreSQL, MySQL and MariaDB, Microsoft SQL Server, SQLite, and Oracle, with dialect-specific drivers listed in the documentation. Query results can be scanned into structs, maps, scalars, or slices, and struct tags define table relationships including belongs-to style links.

Beyond basic CRUD, Bun supports schema migrations, fixtures, soft deletes, bulk operations, and query hooks such as debug logging. OpenTelemetry integration is documented for tracing database access in production setups.

Bun sits on top of Go’s database/sql with drivers for each supported backend, so you open a standard SQL connection and wrap it with Bun’s API. Complex queries can be composed step by step, including common table expressions chained with With, and the generated SQL is intended to match hand-written equivalents.

Key features

  • SQL-first query building in Go
  • PostgreSQL, MySQL, MSSQL, SQLite, Oracle
  • Type-safe scanning into structs and slices
  • Struct tags for table relationships
  • Schema migrations and fixtures
  • Soft delete support
  • Query debug hooks
  • OpenTelemetry tracing integration

Use cases

  • Type-safe SQL in Go services
  • Multi-database Go applications
  • Complex analytical queries with CTEs
  • ORM with visible generated SQL

Tags

Similar software

Supabase

Open-source Postgres platform with auth, APIs, and storage

Supabase bundles a dedicated Postgres database with authentication, auto-generated REST and GraphQL APIs, realtime, functions, file storage, and vector tooling.

★ 115.6k⟳ todayApache-2.0
Open Source Alternative to:FirebaseFirebase Realtime Database

GORM

Feature-rich ORM library for Go applications

GORM maps Go structs to SQL databases with migrations, associations, hooks, and a fluent query API. It targets developer-friendly access patterns for common CRUD and relationship modeling.

★ 40k⟳ 1 month agoMIT
Frameworks & PlatformsDesktop/CLI app

TypeORM

TypeScript and JavaScript ORM for many SQL and NoSQL databases

TypeORM maps objects to relational and document databases from Node.js, browsers, and mobile shells. It supports TypeScript and JavaScript with both Data Mapper and Active Record styles.

★ 36.7k⟳ 3 days agoMIT
Frameworks & PlatformsDesktop/CLI app

MyBatis 3

Java SQL mapper with XML or annotation config

MyBatis links Java objects to SQL and stored procedures via XML or annotations. It trims repetitive JDBC parameter and result handling.

★ 20.4k⟳ yesterdayApache-2.0

Node Redis

High-performance Redis client for Node.js

node-redis connects Node.js applications to Redis with typed commands, clustering, pub/sub, transactions, and optional client-side caching.

★ 17.6k⟳ yesterdayMIT
Frameworks & PlatformsDesktop/CLI app

MyBatis-Plus

Enhanced MyBatis toolkit for Java database access

MyBatis-Plus extends MyBatis with code generation, conditional query builders, and pagination helpers. It stays compatible with MyBatis while adding convenience APIs for common CRUD work.

★ 17.5k⟳ todayApache-2.0
Frameworks & PlatformsDesktop/CLI app