DEV Community

Discussion on: Interact with Relational Databases using Sequelize

Collapse
 
franciscomendes10866 profile image
Francisco Mendes • Edited

Yes, it is possible to join multiple tables and select the fields you want. But in my opinion, when you want to do a really complex query (what I mean by complex queries is, for example, do a single query on twelve tables with multiple relationships and the response has lots of nested data), I wouldn't use it, just because it gets to the point where writing SQL becomes more intuitive. The only ORM that in my opinion makes complex queries simple to perform is Prisma.

Here's a little thread on StackOverflow about join tables using sequelize: bit.ly/3rBOTQr

Collapse
 
varunpappu profile image
Varun Subramanian

Both the modules look promising but as you mentioned when it comes to complex queries it will fail I think. But definitely this will give a good structure to the code base. I personally use pg npmjs.com/package/pg but will explore the prisma and sequalize. Thank you.

Thread Thread
 
franciscomendes10866 profile image
Francisco Mendes

I share the same opinion. One of the great advantages of Sequelize is the adoption of the community and the amount of resources you have available to learn.

But a behavior that's easy to notice is that it's very difficult to find something complex even in paid courses, so in the past I ended up using SQL, but Prisma offers a phenomenal and rich development experience.