postgresql - Which ORM that supports JSONB is better with Sails -
i'm trying figure out orm (or other solution) use in sails.js + postgresql application. basic rule supports jsonb
data type. unfortunately waterline
not (bottom of page), had go around find workaround. application microservice specific purpose , functionality, , not going huge or super-complex.
i stumbled upon api's can integrated: bedquiltdb , postgrest, these seem overkill needs. so, sceptical using of type of solutions.
then stumbled upon sequelize , bookshelf (with knex). there other options, these 2 seemed popular , used ones. here general points towards both options:
sequelize
- said have weak community , hard find answers, in has x2 q&a of waterline
- said pain in ass when project gets have complex entity relations (if means "more usual foreign keys", can i'm not gonna have in db setup)
- said have documentation, basics only.. find methods basic , relationship queries 1 use, don't see negative side of docs in here.
- supports
jsonb
out of box, , other type need - i documentation - it's quite detailed. , found tuts how integrate sails
bookshelf
- build on knexjs, seems powerful query builder. basically, need install knex, in order install bookshelf, have both. drawback in opinion, because have use orm + query builder, instead of single orm, in order fulfil every need i've got.
- supports
jsonb
(because of knex) - i don't fancy docs of bookshelf. not enough examples of model declarations (various cases).
- has far less q&a here in so, compared sequelize. so, seems community weaker?
i did dig in quite forums , got impression people fancy bookshelf in front of sequelize, although can't see way.
some of points wrote might not correct, in reality, i'm asking more opinions solution use? other mentioned ones welcome, provided there facts why use them.
both orm follow entirely different way solve problem. knex + bookshelf
more of query builder based orm. pretty nice support generate queries per requirement. being said knex
has more "freedom" generating complex queries. bookshelf support jsonb.
sequelize
on other hand try solve problem javascript
object based queries formation. support jsonb
. has documentation. sequelize
lacks in field of generating complex queries. issues example. has larger community , being actively developed in comparison bookshelf.
i have been using sequelize
many projects , never gave me issues. both orms good. both supports jsonb
. depends upon style want follow.
and remember can write raw queries if got stuck.
Comments
Post a Comment