trailsjs / trails

:evergreen_tree: Modern Web Application Framework for Node.js.
http://trailsjs.io
Other
1.66k stars 70 forks source link

Support non-Waterline ORM #69

Closed nrempel closed 7 years ago

nrempel commented 8 years ago

http://sequelizejs.com

tjwebb commented 8 years ago

We might have to take a vote. I'm not sure whether to support Sequelize or Bookshelf.js next. Maybe @tgriesser has some thoughts on this? :)

Both will be supported eventually, but we might have to lean on the community. We're focusing on the Trails core and some of the core Trailpacks for the next several weeks.

randallmeeker commented 8 years ago

I would + 1 Sequalize or Bookshelf. Anything to get me off of Waterline !!!!!!!!!!! @tjwebb Are there any examples yet of trails not using waterline?

stanislavromanov commented 8 years ago

Why even bother with waterline, it's not even proper orm. Is it for backwards-compatability with sails or there is another reason? /cc @tjwebb

randallmeeker commented 8 years ago

+1 the main reason I'm looking for alternatives to Sails is waterline. Waterline is the best / worst feature of sails.

tjwebb commented 8 years ago

Why even bother with waterline, it's not even proper orm. Is it for backwards-compatability with sails or there is another reason? +1 the main reason I'm looking for alternatives to Sails is waterline. Waterline is the best / worst feature of sails.

Honestly, it was the easiest way to get a 1.0-alpha set up quickly and out the door. Now that we know there's such demand for non-Waterline ORM in Trails, that's what we can all work on!

Does anyone have a strong preference between Sequelize and Bookshelf?

randallmeeker commented 8 years ago

I prefer Sequelize due to support for soft deletes, which bookshelf lacks.

Migrations, Transactions and Soft Deletes

nrempel commented 8 years ago

I made a little poll to gather votes :D

http://strawpoll.me/6473827

animedbz16 commented 8 years ago

Not to hijack this issue, but would there still be plans to support nosql outside of waterline as well?

On 3:07pm, Thu, Jan 7, 2016 Travis Webb notifications@github.com wrote:

Why even bother with waterline, it's not even proper orm. Is it for backwards-compatability with sails or there is another reason?

+1 the main reason I'm looking for alternatives to Sails is waterline. Waterline is the best / worst feature of sails.

Honestly, it was the easiest way to get a 1.0-alpha set up quickly and out the door. Now that we know there's such demand for non-Waterline ORM in Trails, that's what we can all work on!

Does anyone have a strong preference between Sequelize and Bookshelf?

— Reply to this email directly or view it on GitHub https://github.com/trailsjs/trails/issues/69#issuecomment-169791480.

stanislavromanov commented 8 years ago

@animedbz16 What is a problem in using any noSQL orm you desire?

Does this framework will make it hard to choose whatever orm I want just like sails did?

jaumard commented 8 years ago

Someone on gitter mention https://github.com/biggora/caminte the things I like with waterline is it's working with SQL and NO-SQL databases. So if anyone have test this one and give a feedback it can be cool. @stanislavromanov it's not hard but a trailpack have to be created for the ORM you want to be compatible with Trails. Example for Waterline there trailpack-waterline.

nrempel commented 8 years ago

@animedbz16 that's a good point, I didn't think about that.

I would argue, though, that using SQL and noSQL databases through the same interface is probably a bad thing. The two types of DBs excel at different things. Treating a noSQL database like a relational database is probably going to cause you grief in the long run.

Why not have trailpack-bookshelf and trailpack-mongoose for example? Two separate database trailpacks for two separate purposes.

I might be wrong though, happy to be schooled on this topic.

randallmeeker commented 8 years ago

+1 on seperating NoSQL and SQL, the waterline approach sounds good, but ends up being really bad once you get a little further in.

Having said that, @nrempel should the Poll be updated to include a NoSQL adapter?

nrempel commented 8 years ago

Yeah, that poll was a little short sighted. I can't update it now :crying_cat_face:

It looks like bookshelf and sequelize are neck-and-neck.

Perhaps the best approach is to choose whichever one is fastest to implement (for now) and then start working on a mongoose trailpack assuming mongoose/mongo is the first candidate for a noSQL database.

tjwebb commented 8 years ago

+1 on separating NoSQL and SQL, the waterline approach sounds good, but ends up being really bad once you get a little further in.

Yea; waterline originally was built to mimic the mongoose API and to also work with relational databases. They kind of got the relational part working, but somehow forgot about transactions.

Trails can work with any ORM and it doesn't discriminate. So we certainly want to support all kinds of databases via integrations with many ORM libraries.

jaumard commented 8 years ago

Anyone know sequelize ? I start a Trailpack for it but need some people to test if my integration with Trails is good relative to your sequelize usage.

vellotis commented 8 years ago

What about Objection.js? It is build on top of Knex that is also used by Bookshelf.

jaumard commented 7 years ago

Closing this as now we support multiple ORM, new ORM are welcome @vellotis if you want to create a trailpack for Objection feel free to do it, now there some good examples with existing repo