Tree::Persist::DB::SelfReferential - a handler for Tree persistence


Tree-Persist documentation  | view source Contained in the Tree-Persist distribution.

Index


NAME

Top

Tree::Persist::DB::SelfReferential - a handler for Tree persistence

SYNOPSIS

Top

Please see Tree::Persist for how to use this module.

DESCRIPTION

Top

This module is a plugin for Tree::Persist to store a Tree to a self-referential DB table. This is where a table contains an id column for the row and a parent_id column that refers back to another row's id (which is the parent row).

This is the simplest way to store a tree datastructure in a database, but it has performance penalties.

PARAMETERS

Top

In addition to any parameters required by its parent Tree::Persist::DB, the following parameters are required by connect():

* id (required)

This is the id for the root node of the tree. By specifying this, you can both store more that one tree in a table as well as only load a subtree.

* id_col (optional)

This is the column name for the id field. It defaults to "id".

* parent_id_col (optional)

This is the column name for the parent_id field. It defaults to "parent_id".

* value_col (optional)

This is the column name for the value field. It defaults to "value".

* class_col (optional)

This is the column name for the class field. If unset, the class parameter will be used.

TODO

Top

CODE COVERAGE

Top

Please see the relevant section of Tree::Persist.

SUPPORT

Top

Please see the relevant section of Tree::Persist.

AUTHORS

Top

Rob Kinyon <rob.kinyon@iinteractive.com>

Stevan Little <stevan.little@iinteractive.com>

Thanks to Infinity Interactive for generously donating our time.

COPYRIGHT AND LICENSE

Top


Tree-Persist documentation  | view source Contained in the Tree-Persist distribution.