What's the reason behind making methods for database queries instead of allowing raw queries? for example get(...)->where(...).
- Guess1_ We're repeating ourselves otherwise(DRY) ---> I don't think this is a good reason because this way, it will still be repeated inevitably.
- Guess2_ By using methods we have the benefit of avoiding typos! ---> Typos could happen on methods too!
- Guess3_ By using methods IDEs can help us type queries faster! ---> Sounds like a good reason.
- Guess4_ They are more readable! ---> Another good reason, but I'm not still sure about the reason the designers came up with this decision.
- Guess5_ Some parts of the queries could be omitted and replaced by some more abstract bindings, and they also become more concise in some cases, for example: $books = Book::selectAll(); (in PHP) ---> Good reason.
I'm trying to figure out the main reason designers came up with this decision. I think raw queries are much more flexible to write! For example you don't have to think about how "this example query Q" could be written using these package of methods! q()->g()->y('D',a_callback_here)->z();
Thank you in advance.