Karas::Row - row class for Karas
# Here is a synopsis. But you don't need to write this class by your hand. # Karas::Dumper can generate this class by your RDBMS schema, automatically. package My::Row::Member; use parent qw/Karas::Row/; sub table_name { 'member' } sub primary_key { qw/id/ } sub column_names { qw/id name email/ } __PACKAGE__->mk_column_accessors(column_names()); 1;
This is Row class for Karas.
This method returns list of strings. It's primary keys.
Default method returns 'id'. You can override this method to use another primary key.
Returns table name. It's set at constructor.
Get a column value from row object. This method throws exception if column is not selected by SQL.
Set a column value for row object.
You can't set ScalarRef. If you want to use $row->set_column('cnt' => \'cnt+1') form, you should use $db->update($row, { cnt => \'cnt+1'}) instead.
$row->set_column('cnt' => \'cnt+1')
$db->update($row, { cnt => \'cnt+1'})
Create column accessor methods by @column_names.
To install Karas, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Karas
CPAN shell
perl -MCPAN -e shell install Karas
For more information on module installation, please visit the detailed CPAN module installation guide.