Help deciding on an ORM for Postgres

CUclimber

Ars Legatus Legionis
19,626
Subscriptor
I'm working on a fairly sizable project that's going to see us re-building our data model from scratch, along with a whole host of new APIs and access models. Without going into too many extraneous details, it's all going to be Postgres-based (at least for the Command/write side of our CQRS model), Python-based, and AWS-based.

The first thought of course is SQLAlchemy & Alembic. I've used them both in fairly lightweight situations but the more I look into SQLAlchemy the more issues I see with it. The big one today that I've been scratching my head over is the seemingly basic use-case of multiple schemas in a database. Why it is so difficult to deal with a schema > table > column hierarchy is beyond me, and it doesn't even really seem to be natively supported.

What else should I be looking at? Ideally the db classes will live primarily in an AWS Lambda Layer that can be imported by whichever functions are using it. Migrations will need to happen via AWS CodeBuild/CodePipeline, but since I can just spin up a Docker container there to run the scripts that shouldn't be much of a limitation to anything.