awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com

Lightweight Go ORMs With Migrations

Ranking updated Jun 30, 2026

For an ORM for Go that handles migrations, the first results are go-xorm/xorm (xorm is a Go ORM that includes a built-in schema synchronizer for automatic database migrations, a fluent query builder, and supports multiple SQL dialects, directly matching the need for a lightweight ORM with integrated migration capabilities), uptrace/bun (uptrace/bun is a type-safe Go ORM with a built-in schema migration tool and a SQL-first query builder, making it a comprehensive fit for this search without needing external migration tools) and go-gorm/gorm (GORM is the most popular Go ORM and natively includes AutoMigrate for schema changes, giving you a built-in migration system alongside its type-safe query builder, CRUD operations, and relational associations—exactly the all-in-one, lightweight ORM you’re looking for). go-pg/pg and ent/ent round out the shortlist. Compare the match explanations and check the project documentation against your requirements.

Discover efficient Go object-relational mapping libraries that include integrated database schema migration and versioning tools.

Lightweight Go ORMs With Migrations

Find the best repos with AI.We'll search the best matching repositories with AI.
  • go-xorm/xormgo-xorm avatar

    go-xorm/xorm

    6,628View on GitHub↗

    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 Go ORM that includes a built-in schema synchronizer for automatic database migrations, a fluent query builder, and supports multiple SQL dialects, directly matching the need for a lightweight ORM with integrated migration capabilities.

    GoCRUD OperationsFluent Query BuildersQuery Condition Builders
    View on GitHub↗6,628
  • uptrace/bunuptrace avatar

    uptrace/bun

    4,867View on GitHub↗

    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

    uptrace/bun is a type-safe Go ORM with a built-in schema migration tool and a SQL-first query builder, making it a comprehensive fit for this search without needing external migration tools.

    GoFluent Query BuildersDatabase Relationship MappingsSQL Query Builders
    View on GitHub↗4,867
  • go-gorm/gormgo-gorm avatar

    go-gorm/gorm

    39,798View on GitHub↗

    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 most popular Go ORM and natively includes AutoMigrate for schema changes, giving you a built-in migration system alongside its type-safe query builder, CRUD operations, and relational associations—exactly the all-in-one, lightweight ORM you’re looking for.

    GoObject-Relational Mapping AssociationsQuery Condition Builders
    View on GitHub↗39,798
  • go-pg/pggo-pg avatar

    go-pg/pg

    5,785View on GitHub↗

    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 Go ORM for PostgreSQL that auto-generates tables from struct definitions and provides a fluent query builder, fitting the core request for an ORM with built-in migration support, though its migration capabilities are limited to schema generation rather than providing versioned up/down migrations.

    GoFluent Query BuildersFluent Query BuildersMany-to-Many Associations
    View on GitHub↗5,785
  • ent/entent avatar

    ent/ent

    17,110View on GitHub↗

    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 entity framework and ORM for Go that includes a built-in migration system via code-generated migration scripts, making it a solid fit for your need for a Go ORM with integrated migrations, though its code-generation approach adds complexity beyond what "lightweight" typically implies.

    GoFluent Query BuildersMigration Generation
    View on GitHub↗17,110
  • upper/dbupper avatar

    upper/db

    3,658View on GitHub↗

    Data Access Layer (DAL) for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.

    upper/db is a Go database abstraction layer with ORM-like features and support for multiple databases, fitting the lightweight ORM requirement, but it does not include a built-in migration system, so it falls short of the migration capability specified.

    GoObject Relational MappersObject Relational MappingORM and Data Mapping
    View on GitHub↗3,658
  • aarondl/sqlboileraarondl avatar

    aarondl/sqlboiler

    6,989View on GitHub↗

    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 code generator that produces Go ORM code from an existing schema, rather than a lightweight runtime ORM with its own built-in migration system, so it does not directly match your need for migration capabilities.

    GoCRUD InterfacesCRUD OperationsSQL Query Builders
    View on GitHub↗6,989
  • golang-migrate/migrategolang-migrate avatar

    golang-migrate/migrate

    18,118View on GitHub↗

    This project is a command-line utility designed to manage database schema versioning and automate incremental schema updates. It functions as a version control system for database structures, ensuring consistency across environments by tracking applied migrations in a dedicated metadata table and executing scripts in a sequential, reliable manner. The tool distinguishes itself through a driver-based abstraction layer that supports a wide range of database engines, including various SQL and distributed cloud databases. It provides robust concurrency control through advisory locking, which prev

    golang-migrate/migrate is a database schema migration tool, not an ORM—it handles versioning and incremental schema updates but does not provide the object-relational mapping, model definitions, query builder, or CRUD operations you need for a lightweight ORM.

    GoAutomated MigrationsMigration ExecutionSchema Migrations
    View on GitHub↗18,118
  • pressly/goosepressly avatar

    pressly/goose

    10,197View on GitHub↗

    Goose is a database schema versioning system and SQL migration tool designed for Go applications. It functions as a framework for tracking and applying incremental database changes through versioned SQL scripts, ensuring consistency across different environments. The project distinguishes itself by providing a build-time capability to exclude unused database drivers to optimize binary size and a filesystem abstraction that allows migration scripts to be bundled directly into a compiled executable. It also supports out-of-order execution logic to apply missing scripts that were created after a

    Goose is a dedicated database migration tool for Go, not an ORM—it handles schema versioning and SQL migrations but lacks the object-relational mapping, CRUD operations, and query builder that this search requires.

    GoMigration ExecutionSchema Migrations
    View on GitHub↗10,197
  • jeremyevans/sequeljeremyevans avatar

    jeremyevans/sequel

    5,076View on GitHub↗

    Sequel is a relational database toolkit for Ruby that provides object-relational mapping, a fluent SQL query builder, and schema migration capabilities. It maps database tables to Ruby classes with support for associations, validations, lifecycle hooks, and eager loading, offering a comprehensive ORM layer for building data-centric applications. Sequel distinguishes itself through a plugin-based extension architecture that allows composable customization of models, databases, and datasets without relying on deep inheritance hierarchies. It includes a thread-safe connection pool with support f

    Sequel is a Ruby ORM with built-in migration support, but this search is for a Go ORM — the language mismatch puts it in a neighboring category rather than directly matching the intent.

    RubyAutomated MigrationsCRUD OperationsFluent Query Builders
    View on GitHub↗5,076
  • mattn/go-sqlite3mattn avatar

    mattn/go-sqlite3

    8,993View on GitHub↗

    This project is a Go language driver for the SQLite database. It provides a relational database interface and a Cgo wrapper that connects Go applications to SQLite for persistent local data storage and query execution. The implementation serves as a provider for JSON document storage and local full-text search. It enables the creation, querying, and modification of JSON data and the implementation of searchable indexes for large text datasets directly within the database. The driver supports standard SQL query execution for both file-based and in-memory storage. It includes capabilities for

    This is a Go SQLite database driver, not an ORM — it provides low-level SQL execution and Cgo bindings but lacks the object-relational mapping, built-in migration system, query builder, and model definitions that you are looking for in an ORM.

    CForeign Key Constraints
    View on GitHub↗8,993
Compare the top 10 at a glance
RepositoryStarsLanguageLicenseLast push
go-xorm/xorm6.6KGoBSD-3-ClauseApr 3, 2020
uptrace/bun4.9KGoBSD-2-ClauseJun 17, 2026
go-gorm/gorm
39.8K
Go
MIT
May 11, 2026
go-pg/pg5.8KGoBSD-2-ClauseMay 29, 2026
ent/ent17.1KGoApache-2.0May 31, 2026
upper/db3.7KGoMITDec 6, 2025
aarondl/sqlboiler7KGoNOASSERTIONJun 18, 2026
golang-migrate/migrate18.1KGootherDec 14, 2025
pressly/goose10.2KGootherFeb 20, 2026
jeremyevans/sequel5.1KRubyotherFeb 18, 2026

Related searches

  • a database migration tool for Go
  • an ORM and query builder for Go
  • an object relational mapper for Rust
  • an object relational mapping library for Dart
  • an object relational mapper for PHP
  • a tool for managing database schema migrations
  • an object relational mapping library for Kotlin
  • an object relational mapping library for Swift