NAME
Metadata::DB::Base
CONSTRUCTOR
new()
argument is hash ref you must pass DBH, database handle, to the object. This is a database handle you opened before instancing the object If you wanted to change the name of the table..
my $m = Metadata::DB::Base({ DBH => $dbh });
$m->table_metadata_name('other_metadata_table'); # default is 'metadata'
$m->table_metadata_check; # make sure the table is there, if you wanted to setup
SETUP AND DB METHODS
dbh()
Returns database handle The DBI handle is passed to the CONSTRUCTOR
table_metadata_exists()
Does the metadata table exist or not? Returns boolean.
table_metadata_create()
Creates metadata table, does not check for existance.
table_metadata_dump()
Optional argument is limit. Returns debug string with a pseudo metadata table dump, suitable for printing to STDERR for debug purposes.
table_metadata_layout()
Returns what the metadata table is expected to look according to current params. Could be useful if you're having a hard time with all of this. If you turn DEBUG to on, this is printed to STDERR .
table_metadata_check()
Create table if not exists.
table_metadata_drop()
Drops metadata table. Erases all records.
table_metadata_reset()
Drops and rebuilds metadata table. Erases all records.
create_index_id()
Creates an index for id col.
create_index()
Args are table name and column name. Mostly meant to be used internal.
RECORD METHODS
_record_entries_delete()
arg is id deletes all metadata entries for this record from metadata table (does not commit, etc)
_record_entries_count()
arg is id, returns number of record entries in metadata table
_table_metadata_insert()
arg is id, key, val
_table_metadata_insert_multiple()
arg is id and hashref the hash ref is the metadata key value pairs this is mostly used for indexing
$self->_table_metadata_insert_mutiple(
5,
{
name_first => 'jim',
name_middle => 'raynor',
name_last => 'waltzman',
phone_number => '208-479-1515',
},
);
_record_entries_hashref() and record_entries_hashref()
arg is id returns hashref
CREATE INDEXES
This is to VASTLY improve the speeds of searches.
Call method create_index_id() after running an indexing run for example.
SEE ALSO
Metadata::DB Metadata::DB::Indexer Metadata::DB::Search Metadata::DB::WUI Metadata::Base
AUTHOR
Leo Charre leocharre at cpan dot org
CAVEATS
Still in development Make sure you have the latest versions of DBI and DBD::mysql
BUGS
Send to AUTHOR
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 500:
Unknown directive: =ct