So I'm trying to add support for Views, following a few recipes like this 
<https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/Views>, and this 
<http://www.jeffwidman.com/blog/847/using-sqlalchemy-to-create-and-manage-postgresql-materialized-views/>
.

Beyond the DDL element, I'd like greater integration with higher level 
SQLAlchemy abstractions.

For example, using the first recipe, the view isn't registered with the 
metadata. 
So while there is a table-like construct associated with the view, it isn't 
really integrated with SQLAlchemy table-management facilities.
Tables on which the view depends can't be dropped through the `Table.drop` 
or `Metadata.drop_all` methods, since they don't cascade.
So the `Metadata.drop_all` method is now broken.

Basically, I'd like to be able to implement the `Table ` "interface" for 
views(i.e. methods like `drop` and `create`). Is it possible? Any pointers 
for that?

Also, the first recipe uses the "_make_proxy" private method to create a 
TableClause from the selectable. That method is undocumented(and obviously 
private), 
so I don't really like having that in production code. Is there an 
alternative pattern suitable here?

Is there any chance of seeing views officially supported by SQLAlchemy at 
some point? 

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to