Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
you need to spend to experiment and break things and put them back together to really understand it
or watch some tutorials on use cases, read documentation etc. -
https://doctrine-project.org/projec...
As most ORMs use a similar naming... Doesn't matter if it's Doctrine.
IMHO the doc of Doctrine makes this way easier to grok than other documentation I've read so far. -
it sucks a lot, completely obscures what sequelize does in the background but doesn't save you from having to think about it.
Also I still don't get why they made M2M a directed relationship, both the most obvious manually defined relational model and the SQL generated by Sequelize are completely free from any hierarchy. -
ars140751yIf possible, switch to another one. I’ve used a few ORMs and sequelize is easily the worst.
-
I've not used Sequelize myself, but the way you describe it sounds a *lot* like Eloquent in Laravel, and there's a definite learning curve in that, but honestly the benefits of an ORM really are worth it.
Key to getting the best out of it is not to treat it as a black box and remember it's just a layer of abstraction on top of your database. It makes some queries more complicated to write, but it also simplifies others, and makes it far easier to resolve N+1 queries.
Imma be honest with you, chief
Sequelize's associations confuse the heck out of me
Like I understand what one-to-one, one-to-many, many-to-many relationships in a database are, and I know how I can implement them with just SQL, but the whole thing with belongsTo, hasOne, hasMany, belongsToMany just fly over my head completely
rant