more useful options | |
PerlMonks |
Re: perl create database with folder system (Tree in SQL)by LanX (Saint) |
on Dec 02, 2017 at 12:50 UTC ( [id://1204729]=note: print w/replies, xml ) | Need Help?? |
Please edit your post with <code> tags to make your intention clearer. My first idea was that you want to implement a database just using the file system. But now I think you are asking about how to implement tree structures in an SQL table. This is speculation and we are primarily a Perl board, but table like this should do:
editFor instance the path structure /animal/cat/tiger/Roy is represented in the former table. There are different ways how to query this, like recursively or using self joins. You can also use a view based on self join if the tree's depth is fixed in order to visualize the path structure.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|