DustyDB::Meta::Class - meta-class role for DustyDB::Record objects
version 0.06
This provides a number of meta-class methods to the meta-class of DustyDB model objects, i.e., a class that uses DustyDB::Object and does DustyDB::Record. These methods provide lower level access to the database and should be used with caution. This part of the API is more likely to change as well.
This is currently implemented as an attribute. This might change in the future. This assumes that the primary key will not change at runtime (which is probably a pretty good assumption).
my $record = $meta->load_object( db => $db, key => [ %$key ] );
Load a record object from the given DustyDB with the given key parameters.
my $key = $meta->save_object( db => $db, record => $record );
This saves the given record (an object that does DustyDB::Record) to the given DustyDB database. This method returns a hash referece representing a key that can be used to retrieve the object later via:
$meta->delete_object( db => $db, record => $record );
Delete the record instance from the database.
my @records = $meta->list_all_objects( db => $db );
Fetches all the records for this object from the given DustyDB.
To install DustyDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DustyDB
CPAN shell
perl -MCPAN -e shell install DustyDB
For more information on module installation, please visit the detailed CPAN module installation guide.