ORM for using with Express for SQL and.or NoSQL

65 views
Skip to first unread message

Pito Salas

unread,
Sep 11, 2015, 3:28:46 PM9/11/15
to nodejs
I'm moving from Rails and Ruby to Node and JS. Trying to find an analog to Rails ActiveRecord and other non-rails ORMs. There must be many choices. Can someone point me to the "best" ones? Thanks!

Angel Java Lopez

unread,
Sep 11, 2015, 4:12:59 PM9/11/15
to nod...@googlegroups.com
Hi!

IMNSHO :-) simplicity pays

Save plain javascript objects to MongoDB. 

Only if you need an ORM, then switch to use Moongose.

But in many projects, I wrote all persistence directly to mongodb,

Other opinions?

Angel "Java" Lopez
@ajlopez


On Fri, Sep 11, 2015 at 3:56 PM, Pito Salas <pito...@gmail.com> wrote:
I'm moving from Rails and Ruby to Node and JS. Trying to find an analog to Rails ActiveRecord and other non-rails ORMs. There must be many choices. Can someone point me to the "best" ones? Thanks!

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/4c2f53e3-fd96-45fb-8d11-e02d6ba3a96b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jérémy Lal

unread,
Sep 11, 2015, 4:12:59 PM9/11/15
to nodejs
On Friday, September 11, 2015 at 9:28:46 PM UTC+2, Pito Salas wrote:
I'm moving from Rails and Ruby to Node and JS. Trying to find an analog to Rails ActiveRecord and other non-rails ORMs. There must be many choices. Can someone point me to the "best" ones? Thanks!

Note that all ORM fail at some point precisely because they map types - one
always find a type that isn't supported. For me a good ORM is one that let you define
additional types easily.
They also always fail at being able to define specific features of the underlying
database, like indexes.

because of the way it was possible to define my own types.
But i ended up writing spaghetti code with it, and the module itself
has code that is not easy to understand and debug.

* https://github.com/Vincit/objection.js (and objection-rest, objection-find)
because it's SQL with knex and JSON-schema with tv4 under the hood and this is so right.
It's also up to you to (easily with knex) build your tables, so it fixes the issue i mentioned.
Yet it isn't a full ORM - it's JSON-schema-limited all along. If you want to change the year
of a Date, it's up to your application to (new Date(person.birthday)).setFullYear(1980) and
convert it back toISOString().

* Today i saw http://node-modli.github.io/modli/ which has a shiny web site and that gives
a very good impression on the eyes.

* https://github.com/balderdashy/waterline looks very good. It seems that it will allow
to define custom types at some point, but not yet.


@ismatim

unread,
Sep 11, 2015, 10:08:25 PM9/11/15
to nodejs
Hi Pito,

I used a few times http://deployd.com/  which gives you a RESTful service layer. It allows you to create tables in the backend. It uses Mongo but, the trick is that it offers you this service layer as it were likes tables. And also, it generates a javascript files with the CRUD methods. Regards, isma.

Scott Elcomb

unread,
Sep 11, 2015, 10:58:16 PM9/11/15
to nod...@googlegroups.com
Haven't tried it yet but maybe OpenRecord would suit your needs?
<https://www.npmjs.com/package/openrecord>

Have used Bookshelf.js though; it may also be worth a look
<http://bookshelfjs.org/>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+un...@googlegroups.com.
> To post to this group, send email to nod...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/4c2f53e3-fd96-45fb-8d11-e02d6ba3a96b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Scott Elcomb @psema4
http://psema4.com/pubkey.txt
http://www.pirateparty.ca/

Pito Salas

unread,
Sep 12, 2015, 6:55:56 PM9/12/15
to nodejs
Thanks for all the excellent pointers!
Reply all
Reply to author
Forward
0 new messages