News for hackers. Stuff that matters.
Re:Python: Just Write SQL by aidos on Monday August 14, 2023 @10:23PM (#37129421)
To be fair, in sqlalchemy you could just do “print(query)” and you’d see your sql.
Re:Python: Just Write SQL by lelanthran on Tuesday August 15, 2023 @12:33AM (#37130235)
> To be fair, in sqlalchemy you could just do “print(query)” and you’d see your sql.

I wasn't saying that you couldn't see the raw SQL, I'm saying that the ORM syntax does not result in a consistent experience for everyone.

Re:Python: Just Write SQL by aidos on Tuesday August 15, 2023 @07:25AM (#37132569)
Sure, but if you’re working in a sqlalchemy codebase, you should really learn enough sqlalchemy to get by. I don’t jump between languages and frameworks and expect a consistent experience but ideally I’d have an experience streamlined for the context.

If you’re a db expert that’s doing drive-by optimisation of queries in sqla then you can print them to see what’s going on - is that not broadly what you’re concerned with in your original comment?