3 ms·
You can achieve this without an ORM, but having composable query bits and abstractable querying to the programming language and not directly SQL is really nice.
by bitexploder 4y ago
You can achieve this without an ORM, but having composable query bits and abstractable querying to the programming language and not directly SQL is really nice. Objects map fine to relational hierarchies so I am not so worried about design constraint.
Rust Diesel can go between pure ORM and a more composable query layer. SQLAlchemy also exposes such functionality when you don’t want to fully embrace ORM, but also don’t want to throw out some reuse and composability.
- megaman821 4y agoIf you have composable query bits, have you just not rolled your own query builder? As you pointed out most ORMs have a query builder layer anyway and usually a raw sql layer too. Why not use an ORM for the easy bits?
- bitexploder 4y agoI would not roll it myself. That was my point about some ORM frameworks offering a middle ground, which is often appealing when adapting to an existing database schema.