I think #SQLAlchemy is a magnificent software project, worthy of great respect. But oh my god is it sapping my energy on a hobby project.

The biggest point of friction is that for various reasons, I want my domain objects to be driven by attrs plus cattrs. It's a combination I know well, and it lends itself perfectly to some of the things I'm doing.

But of course, the SQLAlchemy ORM wants to be the source of truth for my object graph. There being multiple layers at which you can do any given thing is also pretty exhausting.

I'm considering my alternatives. Do I keep SA but not use the ORM? Fall back to executing SQL statements directly via a lower-level, simpler library? Use a completely different type of datastore?

#python #programming

@jscholes I have used https://sqlc.dev and the official Python plugin with great success. I use it to generate Go and Python models/queries with no ORM. Just generated types and functions.

https://github.com/sqlc-dev/sqlc-gen-python

Compile SQL to type-safe code

Compile SQL to type-safe code

sqlc.dev
@jscholes I find ORMs very combersome. I always just write my queries (parameterized of course) and call it a day. The added bonus is you have at least 1 less dependency to deal with.