A Crystal ORM for PostgreSQL, built for the Lucky Framework and inspired by Ecto and ActiveRecord.
Avram is a database ORM (Object-Relational Mapper) written in Crystal, designed for the Lucky Framework. It provides a type-safe interface for interacting with PostgreSQL databases, handling tasks like querying, inserting records, and managing schema migrations. It solves the problem of database management in Crystal applications by offering patterns inspired by Elixir's Ecto and Rails' ActiveRecord.
Crystal developers building web applications with the Lucky Framework who need a robust, type-safe ORM for PostgreSQL. It's also suitable for developers familiar with Ecto or ActiveRecord looking for similar patterns in Crystal.
Developers choose Avram for its tight integration with Lucky Framework, type safety enforced by Crystal, and its balance of explicit query building with helpful abstractions. Its design reduces common pitfalls like N+1 queries through configurable preloading.
A Crystal database wrapper for reading, writing, and migrating Postgres databases.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Avram leverages Crystal's static typing to enforce column types in models, reducing runtime errors and improving code reliability, as seen in the model definition syntax.
Configurable lazy loading settings allow control over association preloading, preventing performance issues by raising errors if associations are forgotten, as highlighted in the configuration options.
Inspired by Elixir's Ecto and Rails' ActiveRecord, Avram offers query building and save operations that ease the transition for developers from those ecosystems, as noted in the README.
Includes tools for managing database schema changes directly within the ORM, streamlining development without external dependencies.
Avram only supports PostgreSQL 12+, making it unsuitable for projects that require MySQL, SQLite, or other databases, as explicitly stated in the features.
Designed specifically for the Lucky Framework, which restricts its use in other Crystal applications and reduces flexibility for standalone database projects.
Setting up databases and models involves explicit type definitions and multiple configuration steps, which can be more cumbersome compared to dynamic ORMs with convention-over-configuration.