Table::Denormalized::Manager - base class for creating and maintaining dynamic tables
This package provides a convenience constructor for creating or altering a denormalized table. The arguments are discussed below.
package My::Index;
use base 'Table::Denormalized::Manager';
# ... time passes
package main;
my $idx = My::Index->new({
dsn => 'dbi:SQLite:dbname=:memory:',
table => 'my_table',
verbose => 1,
create_if_needed => 1,
});
tableGets and sets the Table::Denormalized instance.
verboseGets and sets the output of progress information. A true value will make the manager output information.
new ARGSCreates a new manager instance. The following arguments are recognized:
createCreates the table. Wipes all data from the table should it already exist.
create_if_neededCreates the table if needed.
tableThe name of the table where the index gets stored in. Default is fileindex.
dsnThe DBI DSN to use. Default is dbi:SQLite:dbname=$0.sqlite.
If you want an alternate database to be used, you can change that here, or with the dbh parameter, if you already have a database handle.
dbhIf you want to provide an alternate database other than SQLite, you can supply the $dbh you get from a DBI connect call.
row_classThe class into which returned rows are blessed into. This allows you to specify a Class::DBI or DBIx::Class subclass. The default is Table::Denormalized::Row.
verboseOutputs actions to the screen.
managed_classThe class to instantiate. The default is Table::Denormalized but this allows you to specify a different class. The package will be loaded using UNIVERSAL::require.
columnsetThe column set(s) that the table should contain. If this is a reference to an unblessed array it's interpreted as a list of column sets, otherwise it's interpreted as a single column set.
query PARAMSPass through to Table::Denormalized
allShorthand for $query->query({}). It returns all items in the table.
query_ex PARAMSPass through to Table::Denormalized
$mgr->table_exists [NAME]Returns true if the table NAME exists in the database.
If NAME is not given, the default table name is assumed.
columnsReturns the columns of the resultset.
sqlReturns the SQL::Abstract::Clauses object of the table.
dbhReturns the database handle of the table.
retrieve ITEMSRetrieves rows as given by their primary keys.
Max Maischein, <corion@cpan.org>