Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Crystal
  3. granite

granite

MITCrystalv0.23.4

An ORM for Crystal with adapters for PostgreSQL, MySQL, and SQLite.

GitHubGitHub
307 stars89 forks0 contributors

What is granite?

Granite is an Object-Relational Mapping (ORM) library for the Crystal programming language. It provides adapters for PostgreSQL, MySQL, and SQLite, allowing developers to interact with databases using Crystal's type-safe syntax. It solves the problem of database integration in Crystal applications by offering a consistent, database-agnostic interface.

Target Audience

Crystal developers building web applications or any software requiring database interactions, particularly those using the Amber web framework.

Value Proposition

Developers choose Granite for its native Crystal integration, support for multiple databases, and straightforward approach to ORM that leverages Crystal's performance and type safety without unnecessary complexity.

Overview

ORM Model with Adapters for mysql, pg, sqlite in the Crystal Language.

Use Cases

Best For

  • Building web applications in Crystal that need database persistence
  • Developing database-agnostic Crystal libraries or tools
  • Migrating between PostgreSQL, MySQL, or SQLite in Crystal projects
  • Integrating ORM functionality into Amber framework applications
  • Writing type-safe database queries and models in Crystal
  • Testing Crystal applications against multiple database backends

Not Ideal For

  • Projects not using the Crystal programming language, as Granite is tightly coupled to Crystal's ecosystem
  • Teams needing built-in database migration tools or advanced query optimization features
  • Applications where maximum database performance is critical and ORM abstraction overhead is unacceptable
  • Environments requiring frequent updates or long-term support, given the project's maintenance uncertainty

Pros & Cons

Pros

Native Type Safety

Integrates with Crystal's static type system to provide compile-time checks on database queries and models, reducing runtime errors and improving code reliability.

Multi-Database Support

Offers dedicated adapters for PostgreSQL, MySQL, and SQLite, enabling developers to write database-agnostic code and switch backends with minimal changes.

Comprehensive Testing

Includes a test suite that runs against all supported databases via dockerized environments, ensuring adapter reliability and cross-platform consistency as detailed in the README.

Crystal-Centric Design

Built specifically for Crystal, utilizing its syntax and conventions to provide an intuitive ORM experience that aligns with the language's performance and readability goals.

Cons

Maintenance Risks

The project is actively seeking new maintainers, indicating potential instability, slower bug fixes, and delayed updates for future Crystal versions, as noted in the README.

Complex Test Setup

Requires docker configurations or manual database setup for testing, adding overhead compared to simpler ORMs with embedded test databases or mock setups.

Limited Advanced Features

Lacks built-in tools for migrations, complex query building, or caching, which are common in more mature ORMs like those in Ruby or Python ecosystems.

Frequently Asked Questions

Quick Stats

Stars307
Forks89
Contributors0
Open Issues33
Last commit16 days ago
CreatedSince 2015

Tags

#orm#database#kemal#crystal-lang#crystal#postgresql#amber-framework#mysql#sqlite#web-development#amber#sql

Built With

C
Crystal

Included in

Crystal3.5k
Auto-fetched 12 hours ago

Related Projects

jennifer.crjennifer.cr

Crystal ORM using ActiveRecord pattern with flexible query DSL

Stars424
Forks57
Last commit1 year ago
crectocrecto

Database wrapper and ORM for Crystal, inspired by Ecto

Stars352
Forks44
Last commit3 months ago
clearclear

Advanced ORM between postgreSQL and Crystal

Stars283
Forks32
Last commit9 months ago
avramavram

A Crystal database wrapper for reading, writing, and migrating Postgres databases.

Stars181
Forks67
Last commit2 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub