Anyone using DBIC to represent hierarchal directory (folder) structures?

Essentially just like a file system, except users each have their own root.
 To add to the complexity, I need to be able to "share" folders and all
child elements to other users.

My assumption is this would involve a single table where each row can
represent either a directory entry (e.g. a "file") or a sub-directory that
references its parent.

Postgresql has "WITH RECURSIVE" which DBIC has no support for (other than
virtual views):

http://www.postgresql.org/docs/9.2/static/queries-with.html


But, Adjacency Lists and Nested Sets are (were?) often discussed as
solutions for hierarchal data in the database.  I asked on the Pg list back
in 2007:

http://postgresql.1045698.n5.nabble.com/Adjacency-List-or-Nested-Sets-to-model-file-system-hierarchy-td1876116.html


but, so far, I've happily avoided using these approaches of representing
hierarchal data in the database.


BTW -- I have recently written a "tag"-based system (like the familiar
gmail) which is easy to represent in a highly normalized schema but is a
fundamentally different approach.


-- 
Bill Moseley
mose...@hank.org
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to