# Crystal ORMs

**URL:** <https://forum.crystal-lang.org/t/crystal-orms/760>\
**Category:** Help & Support\
**Created:** [May 10, 2019, 10:00pm UTC](https://forum.crystal-lang.org/t/crystal-orms/760 "2019-05-10T22:00:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wontruefree](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/wontruefree/32/1467_2.png) [@wontruefree](https://forum.crystal-lang.org/u/wontruefree)\
**Post date:** [May 10, 2019, 10:00pm UTC](https://forum.crystal-lang.org/t/crystal-orms/760/1 "2019-05-10T22:00:43Z")

</div>

I am looking for an ORM to use for an app and keep going back and forth between Clear and Granite. It seems like Granite generates faster queries and Clear has more DB features exposed with great APIs. I was wondering if anyone had any more thoughts on these ORMs. I am having trouble picking them between projects. I want to use things like jsonb and enums so I keep falling back to clear. But, I am not sure if it is worth the effort to try and get them into granite.

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [May 11, 2019, 12:15am UTC](https://forum.crystal-lang.org/t/crystal-orms/760/2 "2019-05-11T00:15:44Z")

</div>

Granite also has nice support for serializing your models, as the serialization is built on the serializable modules, i.e. you can do `from_json/yaml` to create your models, which is quite handy when working with APIs. Another benefit of Granite is that it supports third party annotations, if you will be using any shards that use them.

Clear was nice when I used it, although I don’t remember the specifics. Granite doesn’t really support custom DB types atm, I’m not too familiar with PG enums so I can’t really give an estimate of the effort required to add them.

---

<div class="post-metadata">

**Author:** ![wontruefree](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/wontruefree/32/1467_2.png) [@wontruefree](https://forum.crystal-lang.org/u/wontruefree)\
**Post date:** [May 13, 2019, 2:36pm UTC](https://forum.crystal-lang.org/t/crystal-orms/760/3 "2019-05-13T14:36:20Z")

</div>

Do you have a link to Granite’s support third party annotations?

Clear says it is an ORM that only plans on supporting postgres and that means they can dive more into those features and after using it a little that seems right.

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [May 13, 2019, 2:43pm UTC](https://forum.crystal-lang.org/t/crystal-orms/760/4 "2019-05-13T14:43:34Z")

</div>

Yea for sure, if you’re going to be using PG then it would make more sense, probably wouldn’t be hard to install both and play with each and see which you like better.

> <https://github.com/amberframework/granite/blob/master/docs/getting_started.md#third-party-annotations>

Syntax isn’t the best but is required due to how Granite adds the properties. Is better than nothing tho.

---

<div class="post-metadata">

**Author:** ![wontruefree](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/wontruefree/32/1467_2.png) [@wontruefree](https://forum.crystal-lang.org/u/wontruefree)\
**Post date:** [May 17, 2019, 6:27pm UTC](https://forum.crystal-lang.org/t/crystal-orms/760/5 "2019-05-17T18:27:44Z")

</div>

I have small projects with both. I was just seeing if people had some more insights.
