On May 7, 2012, at 2:03 PM, Stefan Urbanek wrote:

> Thanks, this is partially helpful. However, in the example there is:
> 
> stuff_view = view("stuff_view"...
> 
> and not:
> 
> stuff_view = Table("stuff_view"...
> 
> My problem is, that I get just a name and expect TABLE or VIEW and I am 
> replacing TABLE or VIEW with TABLE or VIEW. To be able to replace something, 
> I need to drop the something. To be able to drop the something, I need to 
> know how to drop it, therefore I need to know whether it is a table (DROP 
> TABLE) or a view (DROP VIEW). All I have is just a name.

normally, whenever you got the name "stuff_view", it would be defined at that 
moment if that name represents a table or view.

is this reflection you're talking about ?    yeah I was never a huge fan of how 
view reflection got implemented.   you'd need run inspector.get_view_names() 
for now to get those names that represent views:

from sqlalchemy.engine.reflection import Inspector

view_names = Inspector.from_engine(someengine).get_view_names()


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to