Hi,

I am trying to implement versioning of a structure of interconnected
objects so that I can see how the content looked at some point of
time.

Probably I would need to use a temporal database with effective_from/
effective_to timestamps telling the time period when the information
held in the record was true: http://martinfowler.com/ap2/timeNarrative.html

If I had a flat object structure, I would simply pass a filter on the
query:

session.query(Object).filter(Object.effective_from >= time & time <
Object.effective_to)

However, in my schema, the Object has related entities which is also
temporal data. The mapped relations ideally should have the 'time'
parameter embedded in the ON part of JOIN clause.

I know that I can declare all relations as lazy='dynamic' and always
pass 'time'. But I would then lost the possibility to eagerly load
data. It would be inefficient to retrieve a record set and for each
record issue another queries to get values of temporal properties
( http://martinfowler.com/eaaDev/TemporalProperty.html )

What I am looking for is a parameter, which value is specified once
during a query, that could be used in mapper declarations. Attribute
loaders would then use that parameter automatically. Is this possible
in SQLAlchemy?

Regards,
Adam





--

You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@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