I've been working on a plugin for Sequel that uses recursive common
table expressions to implement eager loading of tree like structures
in an SQL database.  It's available at http://pastie.org/877511.txt,
and based on earlier work shown in the Advanced Associations RDoc
page.  It's inspired by comparisons of the adjacency list model to the
nested set model at Explain Extended (see
http://explainextended.com/2009/09/24/adjacency-list-vs-nested-sets-postgresql/).
It allows the lazy and eager loading of all ancestors and descendants,
as well as the eager loading of all descendants to a given level,
along with caching the necessary parent-child relationships so
iterating over the tree structure after eager loading causes no
database access.

I'm posting this to the list for early comment as to whether people
think this plugin should be shipped with Sequel, or whether it should
be an external plugin (available as a separate gem, similar to
sequel_validation_helpers_block).  If you have feelings either way,
please post here.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" 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/sequel-talk?hl=en.

Reply via email to