3 ms·
All your arguments are correct, but are unrelated to the main motivations for ORMs. ORMs are about: - Convenience of using SQL from $LANGUAGE where mapping the
by yyyk 4y ago
All your arguments are correct, but are unrelated to the main motivations for ORMs. ORMs are about:
- Convenience of using SQL from $LANGUAGE where mapping the result, (re)naming, etc. is handled for you. Do this manually, and eventually you will either make silly mistakes or create your own mini-framework.
- Connection pooling / retrying if desired. Can be done without, but again mini-framework.
- Migrations. Generating a schema from code is neat.
- Making our lives miserable when the ORM inevitably generates horrible SQL somewhere and we need to override it manually. That is, ORMs are NOT a replacement for learning SQL.
- fastball 4y agoRealistically the only ORM part of your list is the first item. Everything else is frequently done without having an ORM.
- Tostino 4y agoI actively dislike merging ORMs with schema migrations. They really seem like they are two totally separate use cases and shouldn't be conflated like they were.