[sqlalchemy] Re: Queries in "historical" db's, where the join depends on having an overlapping timestamp (or other filter condition)

2009-07-16 Thread sagblmi
Hy, For a long time ago I manage versioned data's into relational database. You must be careful with the way you deal with timeable information. Membership table represent information with a validity period specified by start and stop attribute. The first change that I propose is to replace your

[sqlalchemy] Re: Queries in "historical" db's, where the join depends on having an overlapping timestamp (or other filter condition)

2009-07-16 Thread Gregg Lind
Jess, Thanks for posting the actual class :) Just reading the description "use contains_eager" didn't tell me enough about how to make it happen. Cheers, Gregg On Thu, Jul 16, 2009 at 12:54 PM, jess wrote: > > I believe that I asked Michael a similar question, in a different way, > a few days

[sqlalchemy] Re: Queries in "historical" db's, where the join depends on having an overlapping timestamp (or other filter condition)

2009-07-16 Thread jess
I believe that I asked Michael a similar question, in a different way, a few days ago. The answer was to use "contains_eager". I used something like the following and it worked great to query what the membership of a group was at a specific time. The two tables remain simple, related by a group

[sqlalchemy] Re: Queries in "historical" db's, where the join depends on having an overlapping timestamp (or other filter condition)

2009-07-16 Thread Gregg Lind
That's a totally fair answer! Mostly, I wish some sense of relational change over time was built into SQL, the way it is in BigTable style systems. Maybe you could shed a little light on how to use the overlap operator? I'm having trouble getting the multiple fields into the clause statement. I

[sqlalchemy] Re: Queries in "historical" db's, where the join depends on having an overlapping timestamp (or other filter condition)

2009-07-16 Thread Michael Bayer
Gregg Lind wrote: > > Questions: > > > 1. Is there a "SQLAlchemical" way to write group_snapshot_ts into > a declarative class, such that the joins and loader respect the > time > constraints? (Read-only is fine as well on the loaded attributes) > a. eager_loader? > b. subclass