Kazuhiro Osawa > Data-Model-0.00007 > Data::Model::Driver::DBI::MasterSlave

Download:
Data-Model-0.00007.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  2
View/Report Bugs
Source   Latest Release: Data-Model-0.00008

NAME ^

Data::Model::Driver::DBI::MasterSlave - master-slave composition for mysql

SYNOPSIS ^

  package MyDB;
  use base 'Data::Model';
  use Data::Model::Schema;
  use Data::Model::Driver::DBI::MasterSlave;
  
  my $dbi_connect_options = {};
  my $driver = Data::Model::Driver::DBI::MasterSlave->new(
      master => {
          dsn => 'dbi:mysql:host=master.server:database=test',
          username => 'master',
          password => 'master',
          connect_options => $dbi_connect_options,
      },
      slave  => {
          dsn => 'dbi:mysql:host=slave.server:database=test',
          username => 'slave',
          password => 'slave',
          connect_options => $dbi_connect_options,
      },
  );

  base_driver $driver;
  install_model model_name => schema {
    ....
  };

DESCRIPTION ^

It can use with standard master-slave composition.

SEE ALSO ^

DBI, Data::Model::Driver::DBI, Data::Model

AUTHOR ^

Kazuhiro Osawa <yappo <at> shibuya <döt> pl>

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: