Is anyone working on auto-generated migrations in node.js ala. Django / South?
I believe Sequelize does this: https://sequelize.readthedocs.org/en/latest/docs/migrations/
Rdb – a Node.js ORM with transactions, persistence ignorance and promises
41–47 of 47 posts
Re: Rdb – a Node.js ORM with transactions, persistence ignorance and promises
#42Earlier quoted context omitted.
Sequelize has the build method, which persists automatically. Couldn't the rest be achieved by simply adding a few (update, delete) methods to the model classes?
The create method on model's persist automatically. Build just creates an instance without saving it to the database.
Re: Rdb – a Node.js ORM with transactions, persistence ignorance and promises
#43Any chance Rdb plans to support a traditional callback style interface for those of us that prefer to stay away from promises?
My plan was to stick to promises only. Unless there are lots of lots of developers that really wants callbacks.
The people who defend callbacks either don't understand the benefits that promises provide, don't know about async/await or are suffering from stockholm syndrome.
Callbacks do not pass the reversibility test. If everyone had started out with promises and / or async/await, and someone proposed callbacks as a way to deal with this instead, they'd be dismissed as a fool. They're an accident of history and we should forget about them as quickly as possible.
Re: Rdb – a Node.js ORM with transactions, persistence ignorance and promises
#44Earlier quoted context omitted.
My plan was to stick to promises only. Unless there are lots of lots of developers that really wants callbacks.
please stick with promises. Promises are the only sane way to deal with async in JS. With people starting to use async/await they become even more compelling. The people who defend callbacks either don't understand the benefits that promises provide, don't know about async/await or are suffering from stockholm syndrome. Callbacks do not pass the reversibility test. If everyone had started out with promises and / or a…
Promises don't really offer any benefit to program structure overall, generally devs just end up creating long chains of anonymous functions rather than long nests of anonymous functions. Promises actually discourage flat code (and functional programming) for that reason. I understand they seem attractive but become a hack in complex situations.
Re: Rdb – a Node.js ORM with transactions, persistence ignorance and promises
#45Seems interesting ! I would definitely like more ORM for node.js technologies. The concurrent are Sequelize ( http://sequelizejs.com/ ) and Bookshelf ( http://bookshelfjs.org/ ), both very mature libraries (look at the Sequelize test suite, it's quite impressing !). Iroal, any comment on the rdb choices against these two big guys ? How can we expect rdb to evolve ?
Re: Rdb – a Node.js ORM with transactions, persistence ignorance and promises
#46Earlier quoted context omitted.
please stick with promises. Promises are the only sane way to deal with async in JS. With people starting to use async/await they become even more compelling. The people who defend callbacks either don't understand the benefits that promises provide, don't know about async/await or are suffering from stockholm syndrome. Callbacks do not pass the reversibility test. If everyone had started out with promises and / or a…
Callbacks allow await/defer in Iced CoffeeScript, not to mention the other async libs as stated above. Promises don't really offer any benefit to program structure overall, generally devs just end up creating long chains of anonymous functions rather than long nests of anonymous functions. Promises actually discourage flat code (and functional programming) for that reason. I understand they seem attractive but become…
Not the same thing as in ES6, also that project is totally dead.
> generally devs just end up creating long chains of anonymous functions rather than long nests of anonymous functions
Not true in my experience, also not required at all when using async / await.
> Promises actually discourage flat code (and functional programming) for that reason.
This is really not true, Promises are functional and composable, callbacks are imperative.
> I understand they seem attractive but become a hack in complex situations.
Just no. Callbacks lead to terrible "solutions" like caolan/async, callbacks make refactoring extremely awkward.
Callbacks don't even get to claim better performance, because they require a load of internal hacks in node/io.js to maintain state.
With async/await in the picture, callbacks so totally inferior I can't believe someone would attempt to argue otherwise.
Re: Rdb – a Node.js ORM with transactions, persistence ignorance and promises
#47Seems interesting ! I would definitely like more ORM for node.js technologies. The concurrent are Sequelize ( http://sequelizejs.com/ ) and Bookshelf ( http://bookshelfjs.org/ ), both very mature libraries (look at the Sequelize test suite, it's quite impressing !). Iroal, any comment on the rdb choices against these two big guys ? How can we expect rdb to evolve ?
And if you just want a flexible ORM without models, knex ( http://knexjs.org/ ), which bookshelf uses. I found knex + Postgres to be a great combination.
A cohesive set of functions that help you build and execute SQL operations.