WWW::Kontent::Store::NarrowDBI - Flexible Perl 5 DBI store for WWW::Kontent
# in kontent-config.yaml store: module: NarrowDBI rootname: mysite connection: dbi:driver:dbname username: jrandom password: secret
NarrowDBI is a flexible Kontent store which operates via the Perl 5 DBI module. It's designed to be simple and easy to configure, and requires no customization to suit your classes.
This store supports multiple "roots"--heirarchies of pages--in the same database. This allows a single database to store multiple sites, which may be useful in certain situations. Each root is a page with a parent ID of 0; the name of the root is passed as the first argument to get_root.
NarrowDBI guarantees that pages will always be readable, even if Kontent crashes in the middle of writing a revision; however, pages may not be writable in such a circumstance unless your database supports transactions.
NarrowDBI is configured through the Kontent configuration file, kontent-config.yaml; see that file for details. NarrowDBI recognizes the following settings:
Required; specifies which root NarrowDBI should use for this Kontent instance.
Required; specifies the DBI data source name (connection string) needed to connect to the database.
Optional; gives the database username, if any.
Optional; gives the database password, if any.
In addition, the
module field must be set to
NarrowDBI for this module to be used, and the
modules list must include
NarrowDBI represents each attribute as a new row in an attributes table. As such, it is perhaps one of the least efficient designs for a DBI store, as each page retrieval requires that several rows be selected from the attributes table.
A second table maps revision IDs to page IDs and revision numbers; a third maps page IDs to parent/name pairs, and keeps track of the page's current revision. A forth table represents the pool.