4 ms·
It's relatively straightforward to map a materialized view to an ORM entity in SQLAlchemy, if that's what you want to do: http://www.jeffwidman.com/blog/847/us
by jperras 7y ago
It's relatively straightforward to map a materialized view to an ORM entity in SQLAlchemy, if that's what you want to do:
http://www.jeffwidman.com/blog/847/using-sqlalchemy-to-create-and-manage-postgresql-materialized-views/ http://www.jeffwidman.com/blog/847/using-sqlalchemy-to-creat...
SQLAlchemy's ability to separate out the query API, metadata, data objects, and combine them all via mappers is very powerful. I've been using SQLA for many years, and I still regularly find some functionality that I was never aware of.
- munk-a 7y agoI more actually meant something closer to a non-materialized view, just a query segment definition that gets frequently reused - supporting it in a materialized form is all good and well but I'm more interested in how repetitive SQLA tends to come out, if a common set of tables is joined through in a wide variety of queries is there a way to reduce the number of times you can spell it out in an easy manner?