> I've finally done first POC implementation of this feature.
>
> Basic usage looks like:
>
> import aggregator as a
> mapper(Line, lines,
> extension=a.Quick(a.Count(blocks.c.lines),
> a.Max(blocks.c.lastline, lines.c.id)))
>
> (You also need foreign keys)
>
hi, i have similar idea/need within dbcook, although on a somewhat
higher level:
<pre>
cache_results/: (dbcook/SA) add-on for automaticaly-updated database
denormalisation caches of intermediate results, each one depending on
particular pattern of usage. Wishful syntax:
class SomeCacheKlas( Base):
fieldname = cache_aggregator( klas.field, AggrFilterCriteria)
#e.g.
#class Cache4averagePerson( Base):
#age = cache_agregators.Average( Person.age, Filter1 )
#salary = cache_agregators.Sum( Person.salary, Filter2 )
</pre>
i was thinking on using triggers and/or sql-functions but then this is
just one way to do it - and the idea is to hide the implementation.
Can your implementation be extended to use:
a) more complex aggregator expressions (e.g. average(), that is
sum() / count(), and similar dependencies)
b) more complex filters - e.g. not max() on all rows, but on some
subset/select
think of generic report calculations/aggregations, and putting those
into some cacheing table.
Eventualy getting the report being built on-the-run - distributing the
big wait over the atomary updates.
> http://www.mr-pc.kiev.ua/projects/SQLAlchemyAggregation
this gives me 404
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---