Data::Model::Driver::DBI - storage driver for DBI


Data-Model documentation  | view source Contained in the Data-Model distribution.

Index


NAME

Top

Data::Model::Driver::DBI - storage driver for DBI

SYNOPSIS

Top

  package MyDB;
  use base 'Data::Model';
  use Data::Model::Schema;
  use Data::Model::Driver::DBI;

  my $dbi_connect_options = {};
  my $driver = Data::Model::Driver::DBI->new(
      dsn             => 'dbi:mysql:host=localhost:database=test',
      username        => 'user',
      password        => 'password',
      connect_options => $dbi_connect_options,
      reuse_dbh       => 1, # sharing dbh (experimental option)
                            # When you use by MySQL, please set up
                            # connect_options => { mysql_auto_reconnect => 1 },
                            # simultaneously. but mysql_auto_reconnect is very unsettled.
  );

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

DESCRIPTION

Top

DBD that is working now is only mysql and SQLite.

SEE ALSO

Top

DBI, Data::Model

AUTHOR

Top

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

LICENSE

Top

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


Data-Model documentation  | view source Contained in the Data-Model distribution.