3 ms·
This sounds like a "golden hammer" argument[1], basically saying that SQL can do everything Django can do, and if you know SQL really, really well you can do po
by l0b0 6y ago
This sounds like a "golden hammer" argument[1], basically saying that SQL can do everything Django can do, and if you know SQL really, really well you can do powerful stuff which would be clunky in Django. Of course that's true, because it's true of any two tools which have overlapping functionality. But for the vast majority of things you need to do on a daily basis, and for developers with >10x more experience with Python than SQL it just doesn't make sense to use raw SQL any more than absolutely necessary. As soon as you use raw SQL in Django most of the maintainability advantages of an ORM disappear.
All that said, I totally agree about throwing out DB portability for anything but the simplest apps (or libraries, of course). Portability is extremely costly in terms of which features we have available to and how maintainable the resulting code is, so it should only be a goal when absolutely necessary.
[1] https://en.wikipedia.org/wiki/Law_of_the_instrument https://en.wikipedia.org/wiki/Law_of_the_instrument