A Go database access layer with a flexible query API, built-in validation, and multi-adapter support.
Grimoire is a database access layer for Go, inspired by Elixir's Ecto. It provides a robust solution for database interactions by integrating a changeset system that handles casting, validation, and constraints, addressing common ORM pitfalls like differentiating between empty, nil, or undefined values.
Go developers building applications that require precise control over database operations, especially those needing to handle partial updates, data validation, and multi-adapter support for MySQL, PostgreSQL, or SQLite3.
Developers choose Grimoire for its changeset system, which eliminates ambiguity in data values and integrates validation directly into the data flow, offering a safer and clearer alternative to traditional Go ORMs that struggle with partial updates.
Database access layer for golang
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Grimoire's changeset system handles casting, validation, and distinguishes between empty, nil, and undefined values, preventing common ORM pitfalls in partial updates, as highlighted in the Motivation section.
The query builder API allows for constructing complex database queries efficiently, demonstrated in the Quick Start with operations like Find, Insert, and Update.
Supports MySQL, PostgreSQL, and SQLite3 out of the box, with an extensible adapter interface for custom implementations, as noted in the Features list.
Integrated validation through changesets ensures data integrity during create and update operations, reducing reliance on external libraries, as shown in the ChangeProduct function example.
The README warns that Grimoire V2 is available as separate packages (REL and Changeset), indicating the original might not be actively maintained, posing a risk for new adopters.
The changeset system adds an extra layer of abstraction that can be overkill for simple applications, requiring more boilerplate code compared to direct struct-based ORMs.
Compared to popular Go ORMs like GORM, Grimoire has fewer community contributions, examples, and third-party tools, which might slow down development and troubleshooting.