On Aug 7, 11:45 am, "Michael Bayer" <mike...@zzzcomputing.com> wrote:
> AF wrote:
>
> > Hello,
>
> > I have a table of records in the database that I want to run read
> > queries against, but I do want to include all of them in the search.
> > (There are a couple of filtering parameters to exclude records from
> > the searched pool, including an aptly named "is_active" flag.)
>
> > Traditionally, I would think to put this in to a VIEW, and let the DB
> > optimise out all the non-active records.
>
> > Since SQLAlchemy does appear to support views, what is the correct way
> > to handle this?  (Or did i miss it?)
>
> > I am using declarative base.
>
> a view looks just like a table to SQLAlchemy.   the only thing that might
> not work is reflecting it.   otherwise you can just pretend its a Table
> (just can't flush to it).

After reading the other helpful messages in this thread, and upon
further reflection, it occurs to me that these various work arounds
all forgo one critical aspect that makes SQLAlchemy so useful.

Namely, the ability to use use SQLAlchey to fully create and populate
my database in a database agnostic manner.   For simple applications
like mine, this is a big part of keeping "Easy Things Easy & Hard
Things Possible".

So, just to clarify:

At this point in time, can SQLAlchemy be used to define and query
simple VIEWs in a database agnostic manner?

And if not, is this a feature that is slated for addition any time
soon?

Thank you,
AF


--~--~---------~--~----~------------~-------~--~----~
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