For un ORM y constructor de consultas para Go, the strongest matches are go-gorm/gorm (GORM is the flagship Go ORM library with a), uptrace/bun (Bun is a type-safe, SQL-first Go ORM with a) and ent/ent (Ent is a statically typed ORM for Go that). go-xorm/xorm and go-pg/pg round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
Capas de abstracción de bases de datos y librerías de construcción de consultas SQL para crear aplicaciones basadas en datos en Go.
GORM is a developer-focused object-relational mapping library for Go that provides a comprehensive data persistence framework. It serves as a database access layer, allowing developers to map application structures to database tables and perform CRUD operations using a fluent, type-safe query builder instead of writing raw SQL. The library distinguishes itself through its association-aware persistence, which automatically tracks and synchronizes complex entity relationships during database operations. It utilizes a driver-agnostic interface to maintain consistent behavior across various stora
GORM is the flagship Go ORM library with a fluent query builder, struct mapping, migrations, association handling, hooks, and raw SQL support across multiple database drivers, making it a perfect fit for your search.
Bun is a type-safe object relational mapper for Go that prioritizes SQL-first query construction and result mapping. It functions as a programmable SQL query builder, a database connection manager, and a tool for mapping database tables to Go structs. The project distinguishes itself through a multi-dialect SQL support system, allowing a single codebase to interact with different database engines via a consistent interface. It includes a built-in database observability tool for query interception, distributed tracing, and logging, as well as a schema migration tool for versioning structural c
Bun is a type-safe, SQL-first Go ORM with a fluent query builder, built-in migrations, multi-dialect support for PostgreSQL, MySQL, SQLite, and more, plus hooks and raw SQL execution, squarely matching your need for a Go ORM and query builder library.
Ent is a statically typed entity framework for Go that models database structures as a graph of nodes and edges. It functions as a code generation engine that transforms schema definitions into type-safe database clients, query builders, and migration scripts. By representing data as interconnected entities, the framework enables intuitive traversal of complex relationships and ensures that database interactions remain consistent with the application model at compile time. The framework distinguishes itself through its graph-based approach to data modeling and its reliance on compile-time cod
Ent is a statically typed ORM for Go that uses code generation to provide type-safe query builders, migrations, and support for multiple database drivers, making it a comprehensive solution for the requested ORM and query builder needs.
xorm is a relational mapper and object-relational mapping tool for Go. It translates Go structures into SQL queries and maps database rows back into native objects, providing a multi-dialect database driver that supports MySQL, PostgreSQL, SQLite, Oracle, SQL Server, and TiDB. The project features a read-write splitting manager that routes modification requests to a primary database and read requests to replicas. It includes a database schema synchronizer to automatically align table structures and indexes with application data models, as well as a fluent SQL query builder for constructing co
Xorm is a full-featured Go ORM with a fluent query builder that supports multiple databases, schema migrations, and association handling—exactly the kind of library this search targets.
pg is a PostgreSQL object-relational mapper (ORM) for Go that maps Go structs to database tables and provides a fluent query builder for constructing SQL statements programmatically. At its core, it automatically generates CREATE TABLE statements from Go struct definitions using struct tags and naming conventions, and builds queries through method chaining with placeholder-based parameter binding to prevent SQL injection. The library distinguishes itself through relation-aware join generation that automatically constructs JOIN clauses for has-one, has-many, many-to-many, and polymorphic assoc
go-pg/pg is a dedicated Go ORM for PostgreSQL with a fluent query builder and struct-to-table mapping, squarely matching the request for a Go ORM library, though its PostgreSQL-only focus and lack of explicit migrations or hooks prevent it from being a fully comprehensive answer.
GF is a comprehensive Go application toolkit and web framework. It provides a set of libraries and tools for building scalable web applications, APIs, and enterprise-level software. The project features a driver-agnostic SQL database toolkit with a query builder and object mapper, alongside a dedicated framework for creating structured command line interfaces. It includes a project scaffolding tool to bootstrap application structures and automate development workflows. The toolkit covers several broader capability areas, including concurrent data management with thread-safe collections, cryp
GF is a Go web framework that includes a full-featured ORM and fluent query builder with driver abstraction, making it a valid choice for relational database interaction, though it’s part of a larger toolkit rather than a standalone ORM library.
GORM V2 moved to https://github.com/go-gorm/gorm
GORM is the most widely adopted Go ORM, offering struct-to-table mapping, a fluent query builder, automatic migrations, support for multiple database drivers, hooks/callbacks, association handling, and raw SQL execution — everything needed for relational database interaction in Go.
sqlboiler is a Go ORM that generates typed Go structs from your database schema and provides a fluent query builder with support for associations, hooks, raw SQL, and multiple database drivers, fitting the search for an ORM library—only missing built-in migrations, but otherwise comprehensive.
sqlboiler is a database-first ORM generator for Go that analyzes an existing database schema to produce strongly typed structures and query helpers. It functions as a schema-driven code generator, transforming database tables and relationships into executable Go source code. The project distinguishes itself through a type-safe query builder that uses chainable modifiers to construct SQL statements, eliminating the need for raw string concatenation. It utilizes customizable text templates to generate source code, allowing for the aliasing of schema entities and the creation of custom templates
sqlboiler is a database-first ORM for Go that generates strongly-typed Go code with a chainable query builder, association handling, hooks, and raw SQL support across multiple databases; it fits the search for an ORM library but lacks built-in migration support, making it a good but not comprehensive match.
Data Access Layer (DAL) for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.
upper/db is a Go data-access layer that provides ORM-like features and supports multiple relational databases plus MongoDB, which fits the search for a Go ORM and query builder library, though it may not include built-in migrations or hooks.
A flexible and powerful SQL string builder library plus a zero-config ORM.
huandu/go-sqlbuilder is a Go library that combines a SQL string builder with a zero‑config ORM, so it directly provides the ORM and fluent query builder you need, though it may not include built‑in migrations or hooks.
A better ORM for Go, based on non-empty interfaces and code generation.
go-reform/reform is a Go ORM that maps structs to database tables via code generation, making it a true ORM library for this search, though it may not include a traditional fluent query builder.
go-rel/rel is a Go library tagged for Object-Relational Mapping, making it the right kind of tool for this search, though available details do not confirm the full set of requested features like migrations or hooks.
This project is a database toolkit for Go that provides schema-to-object mapping, fluent query construction, and automated code generation. It functions as a framework for type-safe database access, enabling developers to interact with relational databases by generating models and interfaces directly from existing database schemas. The toolkit distinguishes itself through a workflow that parses hand-written SQL files to generate type-safe functions, allowing for the integration of custom SQL while maintaining consistent result mapping. It supports modular customization through a plugin-based
Bob is a Go library that combines an SQL query builder with ORM/Factory generation for PostgreSQL, MySQL, and SQLite, fitting your request for a Go ORM with a fluent query builder and multi-database support, though it does not explicitly mention migrations, hooks, or association handling in the available evidence.
| Repositorio | Estrellas | Lenguaje | Licencia | Último push |
|---|---|---|---|---|
| go-gorm/gorm | 39.8K | Go | MIT | |
| uptrace/bun | 4.9K | Go | BSD-2-Clause | |
| ent/ent | 17.1K | Go | Apache-2.0 | |
| go-xorm/xorm | 6.6K | Go | BSD-3-Clause | |
| go-pg/pg | 5.8K | Go | BSD-2-Clause | |
| gogf/gf | 13.2K | Go | MIT | |
| jinzhu/gorm | 660 | Go | MIT | |
| volatiletech/sqlboiler | 0 | — | — | — |
| aarondl/sqlboiler | 7K | Go | NOASSERTION | |
| upper/db | 3.7K | Go | MIT |