top | item 45611435

(no title)

emixam | 4 months ago

sqlorm is a new orm developed as part of hyperflask.

I use sqlalchemy daily, it's an amazing library, but I wanted something more lightweight and straightforward for this project. I find the unit of work pattern cumbersome

discuss

order

instig007|4 months ago

> but I wanted something more lightweight

it's called "sqlalchemy core"

https://docs.sqlalchemy.org/en/20/core/

Arch-TK|4 months ago

SQLAlchemy Core isn't an ORM, it's just a very good query generator.

Although nobody seems to use the term ORM correctly any more so it's entirely possible that neither is peewee or sqlorm.

The story behind why ORM is nowadays no longer used correctly is kind of funny:

1. Query generator sounds primitive, like cavemen banging rocks together. Software engineers are scared of primitive technologies because it makes their CVs look bad.

2. Actual ORMs attempt to present a relational database as if it was a graph or document database. This fundamentally requires a translation which cannot be made performant automatically and often requires very careful work to make performant (which is a massive source of abstraction leaks in real ORMs). People don't realise the performance hit until they've written a chunk of their application and start getting users.

3. Once enough people encountered this problem, they decided to "improve" ORMs by writing new "ORMs" which "avoid" this problem by just not actually doing any of the heavy mapping. i.e. They're the re-invention of a query generator.

globular-toast|4 months ago

I'm surprised an ORM is in scope for this project, but in any case I would have thought a framework would make unit of work not cumbersome. For example you could just tie the unit of work to the request cycle.

Induane|4 months ago

Considered peewee?