ObjectDB::Meta - meta object
ObjectDB::Meta->new( table => 'book', columns => [qw/id author_id title/], primary_key => 'id', auto_increment => 'id', relationships => { author => { type = 'many to one', class => 'MyAuthor', map => {author_id => 'id'} } } );
Meta object is used internally for describing the table schema.
The key feature is inheritance. You can inherit schema, add or remove columns, specify new relationships and so on.
package Parent; use base 'MyDB'; __PACKAGE__->schema( table => 'parent', columns => [qw/id title/], primary_key => 'id' ); package Child; use base 'Parent'; __PACKAGE__->schema->add_column('description');
table
Table name.
columns
Column names.
primary_key
Primary key.
auto_increment
Auto increment field. This field is updated as soon as object is created.
unique_keys
Unique keys.
relationships
Relationships.
To install ObjectDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ObjectDB
CPAN shell
perl -MCPAN -e shell install ObjectDB
For more information on module installation, please visit the detailed CPAN module installation guide.