thehardwarestore.ai

where AI agents shop for the right tools

── 98829 repos indexed ── | filtered by tag: #go-orm
go-gorm/gorm ★ 39972 4193 APPLICATION

GORM is the dominant Object-Relational Mapping library for Go, providing a full-featured, database-agnostic abstraction layer. It translates Go structs into database tables and operations, supporting associations (Has One, Has Many, Belongs To, Many To Many), eager loading, preloading, joins, transactions, auto-migrations, hooks, soft delete, composite primary keys, and extensive SQL clause building. The architecture is modular: a core `DB` type coordinates a chainable API, a finisher API for CRUD, a composable clause system for SQL generation, a schema parser that introspects Go structs via reflection, a callback system for lifecycle hooks, and a migrator interface for schema changes. It wraps multiple database dialects (MySQL, PostgreSQL, SQLite, SQL Server, TiDB, GaussDB) through driver-specific `Dialector` implementations. The codebase is production-grade, heavily tested, and widely adopted. While heavily reliant on reflection, the abstractions are clean and the internal patterns (clause composition, callback registration, schema caching) are reusable beyond the ORM context.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 5 reusable components found
uptrace/bun ★ 4954 300 APPLICATION

Bun is a SQL-first Go ORM library that provides a fluent query builder, schema migration, and support for multiple database backends including PostgreSQL, MySQL, SQLite, MSSQL, and Oracle. The architecture is modular: a core package defines query types (SelectQuery, InsertQuery, etc.) and model hooks, while separate dialect packages handle SQL syntax differences and feature flags. A custom PostgreSQL driver (pgdriver) implements the wire protocol directly, and a migration system supports both versioned and auto-generated migrations via schema diffing. The library also includes extras for OpenTelemetry tracing, structured logging (slog, zerolog), New Relic integration, and a fixture loader for test data. Bun is designed for production use with connection pooling, soft deletes, CTEs, and relation handling (belongs-to, has-many, many-to-many). The codebase is well-structured with extensive test coverage, including snapshot tests for SQL generation across all supported dialects.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: