Class::orMapper::Memcached - DBI base easy O/R Mapper with Memcached.
use Class::orMapper::Memcached; my $read_database = { dsn => 'dbi:xxxx:dbname=xxxx;host=localhost;port=xxxx', uid => 'xxxx', pwd => 'xxxx', opt => {AutoCommit => 0}, }; my $write_database = { dsn => 'dbi:xxxx:dbname=xxxx;host=localhost;port=xxxx', uid => 'xxxx', pwd => 'xxxx', opt => {AutoCommit => 0}, }; my $memcached = { servers => [qw/localhost:11211/], }; my $db = new Class::orMapper::Memcached($read_database, $write_database, $memcached);
This Module is easy database operation module with memcached.
my $data = $db->select_n_arrayref_c($sql,$value); my $data = $db->select_n_hashref_c($sql,$value); ex.) my $sql = "select * from test where hoge=?"; my $value = [qw/abc/]; my $data = $db->select_arrayref_c($param); my $data = $db->select_hashref_c($param); ex.) $param = { table => 'table_name', columns => [aaa,bbb,ccc], where => [ {xxx => {'=' => 'value1', '>' => 'value2'}}, {xxx => [qw/abc def cfg/], ], order => {'yyy' => 'desc', 'zzz' => 'asc'}, };
Kazunori Minoda (c)2012
To install Class::orMapper::Memcached, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::orMapper::Memcached
CPAN shell
perl -MCPAN -e shell install Class::orMapper::Memcached
For more information on module installation, please visit the detailed CPAN module installation guide.