4 ms·
I only meant performance in context of the SQL execution, not the ORM. Agreed that is by far the most important. If one does use a query builder/ORM though it
by nightski 4y ago
I only meant performance in context of the SQL execution, not the ORM. Agreed that is by far the most important. If one does use a query builder/ORM though it is also important to understand how that query builder/orm dsl maps to actual sql (even if it is a straightforward transformation).
I love query builders! Especially type safe ones. But if you have a complex domain doing updates can get messy. You are going to write a lot of code mapping domain objects to SQL updates. It's not insurmountable, but you are basically re-inventing an ORM. Maybe find a lightweight ORM for this purpose (The command side of CQRS).
But yeah if you don't need one that's great! I wasn't trying to convince anyone to use one, just that they can be worthwhile to learn.
Personally I like using either direct SQL or query builder style interface for reads/queries. Then I like using an ORM with domain objects for commands/updates. But I deal with a lot of complex domains in finance, supply chain optimization, production planning, etc...