Kazuhiro Osawa > Data-Model-0.00007 > Data::Model::Driver::Cache::HASH

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::Cache::HASH - Penetration cache is offered to the basic driver

SYNOPSIS ^

  package MyDB;
  use base 'Data::Model';
  use Data::Model::Schema;
  use Data::Model::Driver::DBI;
  use Data::Model::Driver::Cache::HASH;
  
  my $dbi_connect_options = {};
  my $fallback_driver = Data::Model::Driver::DBI->new(
      dsn             => 'dbi:mysql:host=localhost:database=test',
      username        => 'user',
      password        => 'password',
      connect_options => $dbi_connect_options,
  );

  my $driver = Data::Model::Driver::Cache::HASH->new(
      fallback => $fallback_driver,
  );
  
  base_driver $driver;
  install_model model_name => schema {
    ....
  };

DESCRIPTION ^

Penetration cache is offered to the basic driver. Cash is stored in the standard hash for Perl.

When cash does not hit, it asks fallback driver.

SEE ALSO ^

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: