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.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | go-rel/rel |
| Owner | go-rel |
| Primary language | Go |
| License | MIT — OSI-approved |
| Stars | 785 |
| Forks | 59 |
| Open issues | 38 |
| Latest release | v0.42.0 (2024-03-04) |
| Last updated | 2026-07-01 |
| Source | https://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.
Get the rel source
Clone the repository and explore it locally.
git clone https://github.com/go-rel/rel.gitcd rel# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
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.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
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.
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.coRelated 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?
Can I use REL with both MySQL and PostgreSQL in the same application?
Is REL suitable for large-scale production systems?
What testing capabilities does reltest provide?
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.