DEV.co
Open-Source Databases · go-rel

rel

REL is a Go ORM library that provides a clean, testable database access layer with support for multiple adapters (MySQL, PostgreSQL). It includes built-in testing utilities, query builder, migrations, and features like eager loading and soft deletion.

Source: GitHub — github.com/go-rel/rel
785
GitHub stars
59
Forks
Go
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorygo-rel/rel
Ownergo-rel
Primary languageGo
LicenseMIT — OSI-approved
Stars785
Forks59
Open issues38
Latest releasev0.42.0 (2024-03-04)
Last updated2026-07-01
Sourcehttps://github.com/go-rel/rel

What rel is

REL implements a repository pattern ORM for Go with support for nested transactions, composite primary keys, schema migration, and an extendable query builder that allows both fluent syntax and raw SQL. It provides a dedicated test library (reltest) for mocking database operations.

Quickstart

Get the rel source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/go-rel/rel.gitcd rel# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Layered Architecture Applications

REL is explicitly designed for layered architecture patterns. Its repository-pattern implementation and testable design make it ideal for applications requiring clean separation of data access concerns.

Go Web Backends with Heavy Testing Requirements

The built-in reltest package allows comprehensive unit and integration testing of data layers without real database dependencies, reducing test complexity and improving CI/CD reliability.

Multi-Database Support Applications

REL's multi-adapter architecture allows applications to work with MySQL and PostgreSQL (and other adapters) through a unified interface, useful for products supporting multiple database backends.

Implementation considerations

  • Verify multi-adapter support includes your target databases (MySQL, PostgreSQL listed; confirm others are available or require custom implementation).
  • Plan for reltest integration into test suite early—it requires explicit setup but provides significant testing benefits.
  • Review composite primary key and soft deletion features against your domain model; these are built-in but require explicit configuration.
  • Assess schema migration tooling against existing DevOps workflows; REL includes migration features but integration with deployment pipelines requires validation.
  • Evaluate query builder API against team Go proficiency; fluent syntax reduces SQL errors but adds learning curve vs. raw SQL.

When to avoid it — and what to weigh

  • NoSQL or Document-Oriented Databases Required — REL is SQL-focused. If your project requires MongoDB, DynamoDB, or document stores, REL is not suitable.
  • Need for Industrial-Scale Production Ecosystems — REL has 785 stars and 38 open issues. Compared to GORM or sqlc, adoption is limited. Critical production systems requiring extensive vendor support or large community ecosystem should evaluate alternatives.
  • Minimal Dependencies and Lightweight Footprint Critical — REL is a full ORM. Projects requiring minimal dependencies or microservices with strict resource constraints may benefit more from lighter query builders or database/sql alone.
  • Legacy System Integration at Scale — REL's migration tools and conventions assume greenfield or managed schema scenarios. Large legacy systems with non-standard schemas may require significant custom adapter work.

License & commercial use

REL is released under the MIT License, a permissive OSI-approved license allowing commercial use, modification, and distribution with minimal restrictions.

MIT License explicitly permits commercial use in proprietary products without royalty or attribution requirements. No additional licensing, paid tiers, or commercial restrictions identified in provided data. Verify license compliance documentation before deployment.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

REL uses parameterized queries in builder mode, reducing SQL injection risk. Raw SQL support available—misuse could introduce injection vulnerabilities. No security audit, vulnerability disclosure policy, or threat model provided in data. Review driver-level TLS/encryption configuration for database connections. Soft deletion does not prevent data recovery; handle sensitive data per regulatory requirements.

Alternatives to consider

GORM

Larger ecosystem (45k+ stars), more adapters, stronger community support, but more opinionated API and heavier resource usage.

sqlc

Type-safe SQL-first approach with compile-time checking. Lighter weight, no runtime ORM overhead, but requires explicit SQL writing and less abstraction.

ent

Graph-based ORM with code generation, excellent for complex relationships and schema design. Steeper learning curve but strong type safety and generated migrations.

Software development agency

Build on rel with DEV.co software developers

REL offers strong testability and clean architecture patterns. Validate integration with your framework, review migration tooling, and assess community support relative to GORM before committing to production.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

rel FAQ

Does REL support database migrations?
Yes. REL includes schema migration features. Integration with deployment workflows requires validation against your DevOps practices.
Can I use REL with both MySQL and PostgreSQL in the same application?
Yes. REL's multi-adapter architecture allows unified code against different databases. Adapter selection is made at connection time.
Is REL suitable for large-scale production systems?
REL is production-capable but has smaller adoption (785 stars) than GORM. Evaluate community support, issue resolution speed, and stability guarantees for your risk profile.
What testing capabilities does reltest provide?
reltest allows mocking of repository methods without real database access, enabling unit test isolation. Exact mock capabilities require documentation review.

Software developers & web developers for hire

Need help beyond evaluating rel? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.

Evaluating REL for Your Go Backend?

REL offers strong testability and clean architecture patterns. Validate integration with your framework, review migration tooling, and assess community support relative to GORM before committing to production.