Design – Is there still a need for writing SQL

designsql

With so many ORM tools for most modern languages, is there still a use case for writing and executing SQL in a program, in a language/environment that supports them? If so why?

For clarity: I'm not asking about if programmers need to know SQL, or if I should have a SQL tool on my desktop. I'm asking specifically why I might have it in code (or config, or whatever) as opposed to an ORM.

Best Answer

  • You're more comfortable writing SQL to query data than you are writing procedural code.
  • Your ORM, while beautiful to look at, generates horrifically slow SQL in some critical area.
  • You need to take advantage of functionality exposed by your RDBMS that is not / cannot be made available through your ORM.
  • Every time you type SELECT * FROM..., God kills a kitten. And you hate kittens.
  • You aren't using an ORM, OOP, or a modern language.
Related Topic