Which ORM that supports JSONB is better with Sails
<p>I'm trying to figure out what ORM (or other solution) to use in my Sails.js + PostgreSQL application. The basic rule is that it supports <code>jsonb</code> data type. Unfortunately <code>Waterline</code> does not (<a href="https://github.com/balderdashy/waterline/blob/master/ROADMAP.md" rel="nofollow">bottom of the page</a>), so I had to go around to find a workaround. The application is a MicroService with very specific purpose and functionality, and is not going to be something huge or super-complex.</p>

<p>I stumbled upon some API's that can be integrated: <a href="http://bedquiltdb.github.io/" rel="nofollow">BedquiltDB</a> and <a href="https://github.com/begriffs/postgrest" rel="nofollow">PostgREST</a>, but these seem like an overkill for my needs. So, I am sceptical about using any of this type of solutions.</p>

<p>Then I stumbled upon <a href="http://docs.sequelizejs.com/en/latest/docs/getting-started/" rel="nofollow">Sequelize</a> and <a href="http://bookshelfjs.org/#Model-subsection-construction" rel="nofollow">Bookshelf</a> (<a href="http://knexjs.org/" rel="nofollow">with Knex</a>). There were some other options, but these 2 seemed like the most popular and used ones. Here are my general points towards both options:</p>

<p><strong>Sequelize</strong></p>

<ul>
<li>Said to have weak community and hard to find answers, but in SO it
has x2 the Q&amp;A of Waterline </li>
<li>Said to be a pain in the ass when your project gets to have <em>complex entity relations</em> (if this means "more than usual foreign keys", then I can say I'm not gonna have that in my DB setup)</li>
<li>Said to have good documentation, but for the basics only.. But I could find methods for basically all the basic and relationship queries that one would normally use, so I don't see a negative side of the docs in here.</li>
<li>Supports <code>jsonb</code> out of the box, and basically any other type that I will need</li>
<li>I like the documentation - it's quite detailed. And I found tuts about how to easily integrate it with Sails</li>
</ul>

<p><strong>Bookshelf</strong></p>

<ul>
<li>Build on KnexJS, which seems to be a powerful query builder. Basically, you need to install Knex, in order to install Bookshelf, so you always have both. This is a drawback in my opinion, because I will have to use an ORM + a query builder, instead of a single ORM, in order to fulfil every need I've got.</li>
<li>Supports <code>jsonb</code> (because of Knex)</li>
<li>I don't really fancy the docs of Bookshelf. Not good enough examples of model declarations (various cases).</li>
<li>Has far less Q&amp;A here in SO, compared to Sequelize. So, seems like the community is weaker?</li>
</ul>

<p>I did dig in quite some forums and got the impression that most people fancy Bookshelf in front of Sequelize, although I can't see it that way.</p>

<p>Some of the points that I wrote might not be correct, in reality, so I'm asking for some more opinions about which solution would you use? Other than the mentioned ones are welcome, provided there are facts about why use them.</p>