Working with relational databases might be difficult for those not acquainted with them. However, I think the SQL language as an interface primarily for relation databases is a great language.
I think, invariably when you use ORM, you end up having query-specific object structures. For example [1].
You also might be passed objects with deferred fields [2]. This will be completely opaque to someone consuming the resulting object. You'll eventually run into this problem [3]. Solving the lazy load problem requires an understanding of how SQL works in the first place. And if you look at the solution in that example, it's an ORM-wrapped series of joins.
From 3:
> For good measure, we add a raiseload to throw an exception if we try to load anything that we didn’t load here.
> However, I think the SQL language as an interface primarily for relation databases is a great language.
Which language(s) are you using as a point of comparison and why is SQL better than those other languages? SQL is no doubt better than nothing, but that is not in the spirit of our discussion.
I think, invariably when you use ORM, you end up having query-specific object structures. For example [1].
You also might be passed objects with deferred fields [2]. This will be completely opaque to someone consuming the resulting object. You'll eventually run into this problem [3]. Solving the lazy load problem requires an understanding of how SQL works in the first place. And if you look at the solution in that example, it's an ORM-wrapped series of joins.
From 3: > For good measure, we add a raiseload to throw an exception if we try to load anything that we didn’t load here.
Who wants to live in this world?
1: https://stackoverflow.com/a/45905714/5573538 2: https://docs.sqlalchemy.org/en/13/orm/loading_columns.html#c... 3: https://engineering.shopspring.com/speed-up-with-eager-loadi...