Live data from Hacker News

Python: Just Write SQL

joaodlf.com

71–80 of 288 posts

Re: Python: Just Write SQL

#71
I'm happy to see someone mention peewee, having used it for numerous startup prototypes since its inception.

Coleifer does not get enough credit IMHO:

https://github.com/coleifer/

Peewee has been solid since I began using it a decade ago. Coleifer's stewardship is hard to see at once, but I've interacted with him numerous times back then and the software reflects the mindset of its creator.

Re: Python: Just Write SQL

#72
post #7

If you're going to end up querying all the fields and putting them into a model like this dataclass anyways... Django can do that for you. If you're going to later pick and choose what fields you query on the first load, and defer other data til later.... Django can do that for you. If you're going to have some foreign relations you want to easily query.... Django can do that for you. If you're doing a bunch of joins…

The only problem I have with using the django ORM is that it relies on the django project structure. While there are ways to use the ORM independently, they are full of hacks and trade-offs.

Granted, this problem goes away if you are building a web app or a REST API, but if I just want an ORM for a command line application, I am using django's management command functionality which is OK, but it doesn't really scale easily.

Re: Python: Just Write SQL

#73
post #66

Earlier quoted context omitted.

From my experience, ORMs allow folk who know nothing about databases to continue knowing nothing about databases

So let's ban ORMs because newbies don't know the entire toolchain. Yes, that will definitely solve it. Why stop there? Let's ban RDBMS. If you can't contemplate a binary file structure and index strategy perfectly tailored to your application's needs ahead of using an RDBMS, why should we deign to let you use an abstraction layer with clever query planning and algorithms? It's all too easy to morally 'ban' people fro…

[deleted]

Re: Python: Just Write SQL

#74
post #66

Earlier quoted context omitted.

From my experience, ORMs allow folk who know nothing about databases to continue knowing nothing about databases

So let's ban ORMs because newbies don't know the entire toolchain. Yes, that will definitely solve it. Why stop there? Let's ban RDBMS. If you can't contemplate a binary file structure and index strategy perfectly tailored to your application's needs ahead of using an RDBMS, why should we deign to let you use an abstraction layer with clever query planning and algorithms? It's all too easy to morally 'ban' people fro…

[deleted]

Re: Python: Just Write SQL

#75
post #66

Earlier quoted context omitted.

From my experience, ORMs allow folk who know nothing about databases to continue knowing nothing about databases

So let's ban ORMs because newbies don't know the entire toolchain. Yes, that will definitely solve it. Why stop there? Let's ban RDBMS. If you can't contemplate a binary file structure and index strategy perfectly tailored to your application's needs ahead of using an RDBMS, why should we deign to let you use an abstraction layer with clever query planning and algorithms? It's all too easy to morally 'ban' people fro…

[deleted]

Re: Python: Just Write SQL

#76
post #34

Earlier quoted context omitted.

I have decades of experience with databases and I happily use ORMs. You're conflating ORM with people who know nothing about databases. Why?

From my experience, ORMs allow folk who know nothing about databases to continue knowing nothing about databases

[deleted]

Re: Python: Just Write SQL

#77
post #34

Earlier quoted context omitted.

I have decades of experience with databases and I happily use ORMs. You're conflating ORM with people who know nothing about databases. Why?

From my experience, ORMs allow folk who know nothing about databases to continue knowing nothing about databases

[deleted]

Re: Python: Just Write SQL

#78
post #66

Earlier quoted context omitted.

From my experience, ORMs allow folk who know nothing about databases to continue knowing nothing about databases

So let's ban ORMs because newbies don't know the entire toolchain. Yes, that will definitely solve it. Why stop there? Let's ban RDBMS. If you can't contemplate a binary file structure and index strategy perfectly tailored to your application's needs ahead of using an RDBMS, why should we deign to let you use an abstraction layer with clever query planning and algorithms? It's all too easy to morally 'ban' people fro…

[deleted]

Re: Python: Just Write SQL

#79
post #34

Earlier quoted context omitted.

I have decades of experience with databases and I happily use ORMs. You're conflating ORM with people who know nothing about databases. Why?

From my experience, ORMs allow folk who know nothing about databases to continue knowing nothing about databases

(this was a flippant remark, if I could edit it I would reword it)

Re: Python: Just Write SQL

#80

Earlier quoted context omitted.

From my experience, ORMs allow folk who know nothing about databases to continue knowing nothing about databases

And from my experience, forcing people who know nothing about databases to write SQL will not make them learn about databases, all you end up with is worse SQL and more injections. Although the worse offenders by far are those which decide ORM = bad and bypass it at every opportunity.

That's fair, ORMs can be slow but they rule out a whole category of basic mistakes
Post reply on HN