|
P5EEx-Blue-0.01 | |||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||
![]() |
P5EEx::Blue::Repository::Sample |
P5EEx::Blue::Repository::Sample - a set of stubs for a repository implementation which can be copied and modified
use P5EEx::Blue::Repository::Sample;
(see man page for P5EEx::Blue::Repository for additional methods)
################################################################### # constructors ###################################################################
$rep = P5EEx::Blue::Repository::Sample->new();
################################################################### # methods not defined in the P5EEx::Blue::Repository interface ###################################################################
# ...
################################################################### # defined in the P5EEx::Blue::Repository interface, implemented here ###################################################################
$ok = $rep->connect(); # initialize repository (will happen automatically in constructor)
$ok = $rep->disconnect(); # cleanup repository (will happen automatically in destructor)
$rep->is_connected(); # returns 1 if connected (ready for use), 0 if not
$errmsg = $rep->error(); # returns the error string for prev op ("" if no error)
$numrows = $rep->numrows(); # returns the number of rows affected by prev op
print $rep->error(), "\n" if (!$rep->connect());
print $rep->error(), "\n" if ($rep->connect() != $rep->OK);
# META-DATA: (about the tables) $rep->load_rep_metadata_auto(); $rep->load_table_metadata_auto($tablename);
# MEDIUM-LEVEL: reads and writes rows, no caching $row = $rep->select_row ($table, \@cols, \@wherecols, \%wherevalues); $rows = $rep->select_rows($table, \@cols, \@wherecols, \%wherevalues, \@ordercols, $startrow, $endrow); $ok = $rep->insert_row ($table, \@cols, \@colvalues); $ok = $rep->insert_rows($table, \@cols, \@rows); $ok = $rep->update_row ($table, \@cols, \@colvalues, \@keycolidx); $ok = $rep->update_rows($table, \@cols, \@colvalues, \@wherecols, \%wherevalues); $ok = $rep->store_row ($table, \@cols, \@colvalues, \@keycolidx, $update_first); $ok = $rep->store_rows ($table, \@cols, \@rows, \@keycolidx, $update_first); $ok = $rep->delete_row ($table, \@cols, \@colvalues, \@keycolidx); $ok = $rep->delete_rows($table, \@wherecols, \%wherevalues);
The P5EEx::Blue::Repository::Sample class is a file to be copied and modified in order to create a new implementation of a repository class. The methods defined below are stubs that need to be filled out.