News for hackers. Stuff that matters.
Re:Python: Just Write SQL by TX81Z on Tuesday August 15, 2023 @12:25PM (#37135899)
Doesn’t that increase complexity? I just have a database wrapper class and keep all my db code segregated there. In my case also using an ORM would blow up that segregated approach.
Re:Python: Just Write SQL by ubercore on Wednesday August 16, 2023 @06:33AM (#37145081)
It's very very easy to keep the sql alongside models and other business logic. SqlAlchemy lets you drop down to fairly complex sql while remaining in Python, and will even take in a direct sql query as well.

The added complexity has always been a non-issue for me. Even a simple `sql.py` next to `models.py` works really well, for a pretty straightforward solution.