diff -ur -I '^version' -I VERSION CHI-Driver-DBI-1.23/Changes CHI-Driver-DBI-1.24/Changes
--- CHI-Driver-DBI-1.23/Changes	2010-05-22 21:30:01.000000000 -0700
+++ CHI-Driver-DBI-1.24/Changes	2011-03-09 23:05:05.000000000 -0800
@@ -2,6 +2,13 @@
 
 ** denotes an incompatible change
 
+1.24  Mar 9, 2011
+
+- Reduce key length in auto-created table from 600 to 300, to prevent errors
+  when used with utf8 keys in mysql. Can always be overriden manually. RT #66479
+  (Doug Bell).
+- Migrate to Dist::Zilla
+
 1.23  May 22, 2010
 
 - Add DBI as requirement
Only in CHI-Driver-DBI-1.24: INSTALL
Only in CHI-Driver-DBI-1.24: LICENSE
diff -ur -I '^version' -I VERSION CHI-Driver-DBI-1.23/MANIFEST CHI-Driver-DBI-1.24/MANIFEST
--- CHI-Driver-DBI-1.23/MANIFEST	2010-05-22 21:30:06.000000000 -0700
+++ CHI-Driver-DBI-1.24/MANIFEST	2011-03-09 23:05:05.000000000 -0800
@@ -1,21 +1,91 @@
 Changes
-inc/Module/AutoInstall.pm
-inc/Module/Install.pm
-inc/Module/Install/AutoInstall.pm
-inc/Module/Install/Base.pm
-inc/Module/Install/Can.pm
-inc/Module/Install/Fetch.pm
-inc/Module/Install/Include.pm
-inc/Module/Install/Makefile.pm
-inc/Module/Install/Metadata.pm
-inc/Module/Install/Win32.pm
-inc/Module/Install/WriteAll.pm
+INSTALL
+LICENSE
+MANIFEST
+META.json
+META.yml
+Makefile.PL
 lib/CHI/Driver/DBI.pm
 lib/CHI/Driver/DBI/t/CHIDriverTests/Base.pm
 lib/CHI/Driver/DBI/t/CHIDriverTests/SQLite.pm
-Makefile.PL
-MANIFEST			This list of files
-META.yml
-README
+release/CHI-Driver-DBI-1.20/Build.PL
+release/CHI-Driver-DBI-1.20/COPYING
+release/CHI-Driver-DBI-1.20/DISCLAIMER
+release/CHI-Driver-DBI-1.20/MANIFEST
+release/CHI-Driver-DBI-1.20/META.yml
+release/CHI-Driver-DBI-1.20/Makefile.PL
+release/CHI-Driver-DBI-1.20/lib/CHI/Driver/DBI.pm
+release/CHI-Driver-DBI-1.20/lib/CHI/t/Driver/DBI.pm
+release/CHI-Driver-DBI-1.20/lib/CHI/t/Driver/DBI/SQLite.pm
+release/CHI-Driver-DBI-1.20/lib/CHI/t/Driver/DBI/mysql.pm
+release/CHI-Driver-DBI-1.20/t/Driver-DBI-SQLite.t
+release/CHI-Driver-DBI-1.20/t/Driver-DBI-mysql.t
+release/CHI-Driver-DBI-1.21/Changes
+release/CHI-Driver-DBI-1.21/MANIFEST
+release/CHI-Driver-DBI-1.21/META.yml
+release/CHI-Driver-DBI-1.21/Makefile.PL
+release/CHI-Driver-DBI-1.21/README
+release/CHI-Driver-DBI-1.21/inc/Module/AutoInstall.pm
+release/CHI-Driver-DBI-1.21/inc/Module/Install.pm
+release/CHI-Driver-DBI-1.21/inc/Module/Install/AutoInstall.pm
+release/CHI-Driver-DBI-1.21/inc/Module/Install/Base.pm
+release/CHI-Driver-DBI-1.21/inc/Module/Install/Can.pm
+release/CHI-Driver-DBI-1.21/inc/Module/Install/Fetch.pm
+release/CHI-Driver-DBI-1.21/inc/Module/Install/Include.pm
+release/CHI-Driver-DBI-1.21/inc/Module/Install/Makefile.pm
+release/CHI-Driver-DBI-1.21/inc/Module/Install/Metadata.pm
+release/CHI-Driver-DBI-1.21/inc/Module/Install/Win32.pm
+release/CHI-Driver-DBI-1.21/inc/Module/Install/WriteAll.pm
+release/CHI-Driver-DBI-1.21/lib/CHI/Driver/DBI.pm
+release/CHI-Driver-DBI-1.21/lib/CHI/Driver/DBI/t/Base.pm
+release/CHI-Driver-DBI-1.21/lib/CHI/Driver/DBI/t/SQLite.pm
+release/CHI-Driver-DBI-1.21/t/00-load.t
+release/CHI-Driver-DBI-1.21/t/Driver-DBI-SQLite.t
+release/CHI-Driver-DBI-1.22/Changes
+release/CHI-Driver-DBI-1.22/MANIFEST
+release/CHI-Driver-DBI-1.22/META.yml
+release/CHI-Driver-DBI-1.22/Makefile.PL
+release/CHI-Driver-DBI-1.22/README
+release/CHI-Driver-DBI-1.22/inc/Module/AutoInstall.pm
+release/CHI-Driver-DBI-1.22/inc/Module/Install.pm
+release/CHI-Driver-DBI-1.22/inc/Module/Install/AutoInstall.pm
+release/CHI-Driver-DBI-1.22/inc/Module/Install/Base.pm
+release/CHI-Driver-DBI-1.22/inc/Module/Install/Can.pm
+release/CHI-Driver-DBI-1.22/inc/Module/Install/Fetch.pm
+release/CHI-Driver-DBI-1.22/inc/Module/Install/Include.pm
+release/CHI-Driver-DBI-1.22/inc/Module/Install/Makefile.pm
+release/CHI-Driver-DBI-1.22/inc/Module/Install/Metadata.pm
+release/CHI-Driver-DBI-1.22/inc/Module/Install/Win32.pm
+release/CHI-Driver-DBI-1.22/inc/Module/Install/WriteAll.pm
+release/CHI-Driver-DBI-1.22/lib/CHI/Driver/DBI.pm
+release/CHI-Driver-DBI-1.22/lib/CHI/Driver/DBI/t/CHIDriverTests/Base.pm
+release/CHI-Driver-DBI-1.22/lib/CHI/Driver/DBI/t/CHIDriverTests/SQLite.pm
+release/CHI-Driver-DBI-1.22/t/00-load.t
+release/CHI-Driver-DBI-1.22/t/CHIDriverTests-SQLite.t
+release/CHI-Driver-DBI-1.23/Changes
+release/CHI-Driver-DBI-1.23/MANIFEST
+release/CHI-Driver-DBI-1.23/META.yml
+release/CHI-Driver-DBI-1.23/Makefile.PL
+release/CHI-Driver-DBI-1.23/README
+release/CHI-Driver-DBI-1.23/inc/Module/AutoInstall.pm
+release/CHI-Driver-DBI-1.23/inc/Module/Install.pm
+release/CHI-Driver-DBI-1.23/inc/Module/Install/AutoInstall.pm
+release/CHI-Driver-DBI-1.23/inc/Module/Install/Base.pm
+release/CHI-Driver-DBI-1.23/inc/Module/Install/Can.pm
+release/CHI-Driver-DBI-1.23/inc/Module/Install/Fetch.pm
+release/CHI-Driver-DBI-1.23/inc/Module/Install/Include.pm
+release/CHI-Driver-DBI-1.23/inc/Module/Install/Makefile.pm
+release/CHI-Driver-DBI-1.23/inc/Module/Install/Metadata.pm
+release/CHI-Driver-DBI-1.23/inc/Module/Install/Win32.pm
+release/CHI-Driver-DBI-1.23/inc/Module/Install/WriteAll.pm
+release/CHI-Driver-DBI-1.23/lib/CHI/Driver/DBI.pm
+release/CHI-Driver-DBI-1.23/lib/CHI/Driver/DBI/t/CHIDriverTests/Base.pm
+release/CHI-Driver-DBI-1.23/lib/CHI/Driver/DBI/t/CHIDriverTests/SQLite.pm
+release/CHI-Driver-DBI-1.23/t/00-load.t
+release/CHI-Driver-DBI-1.23/t/CHIDriverTests-SQLite.t
+release/diff-1.20-1.21.txt
+release/diff-1.21-1.22.txt
+release/diff-1.22-1.23.txt
 t/00-load.t
 t/CHIDriverTests-SQLite.t
+weaver.ini
Only in CHI-Driver-DBI-1.24: META.json
diff -ur -I '^version' -I VERSION CHI-Driver-DBI-1.23/META.yml CHI-Driver-DBI-1.24/META.yml
--- CHI-Driver-DBI-1.23/META.yml	2010-05-22 21:30:06.000000000 -0700
+++ CHI-Driver-DBI-1.24/META.yml	2011-03-09 23:05:05.000000000 -0800
@@ -1,15 +1,14 @@
 ---
-abstract: 'Use DBI for cache'
+abstract: 'Use DBI for cache storage'
 author:
   - 'Jonathan Swartz <swartz@pobox.com>'
 build_requires:
-  ExtUtils::MakeMaker: 6.42
   Test::Class: 0
-  Test::Most: 0
+  Test::More: 0
 configure_requires:
-  ExtUtils::MakeMaker: 6.42
-distribution_type: module
-generated_by: 'Module::Install version 0.91'
+  ExtUtils::MakeMaker: 6.31
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 4.200000, CPAN::Meta::Converter version 2.102400'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -17,12 +16,14 @@
 name: CHI-Driver-DBI
 no_index:
   directory:
-    - inc
-    - t
+    - lib/CHI/Driver/DBI/t
+    - lib/CHI/Driver/DBI/Test
+  file:
+    - lib/CHI/Driver/DBI/Util.pm
 requires:
   CHI: 0.241
   DBI: 1.26
-  perl: 5.6.0
 resources:
-  license: http://dev.perl.org/licenses/
-version: 1.23
+  bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=CHI-Driver-DBI
+  repository: git://github.com/jonswar/perl-chi-driver-dbi.git
+version: 1.24
diff -ur -I '^version' -I VERSION CHI-Driver-DBI-1.23/Makefile.PL CHI-Driver-DBI-1.24/Makefile.PL
--- CHI-Driver-DBI-1.23/Makefile.PL	2010-05-22 06:18:55.000000000 -0700
+++ CHI-Driver-DBI-1.24/Makefile.PL	2011-03-09 23:05:05.000000000 -0800
@@ -1,20 +1,55 @@
-use inc::Module::Install;
 
-name 'CHI-Driver-DBI';
-abstract 'Use DBI for cache';
-all_from 'lib/CHI/Driver/DBI.pm';
-author 'Jonathan Swartz <swartz@pobox.com>';
+use strict;
+use warnings;
 
-perl_version '5.006';
 
-build_requires 'Test::Class' => 0;
-build_requires 'Test::Most'  => 0;
 
-requires 'CHI' => '0.241';
-requires 'DBI' => '1.26';
+use ExtUtils::MakeMaker 6.31;
+
+
+
+my %WriteMakefileArgs = (
+  'ABSTRACT' => 'Use DBI for cache storage',
+  'AUTHOR' => 'Jonathan Swartz <swartz@pobox.com>',
+  'BUILD_REQUIRES' => {
+    'Test::Class' => '0',
+    'Test::More' => '0'
+  },
+  'CONFIGURE_REQUIRES' => {
+    'ExtUtils::MakeMaker' => '6.31'
+  },
+  'DISTNAME' => 'CHI-Driver-DBI',
+  'EXE_FILES' => [],
+  'LICENSE' => 'perl',
+  'NAME' => 'CHI::Driver::DBI',
+  'PREREQ_PM' => {
+    'CHI' => '0.241',
+    'DBI' => '1.26'
+  },
+  'VERSION' => '1.24',
+  'test' => {
+    'TESTS' => 't/*.t'
+  }
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
+  my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
+  my $pp = $WriteMakefileArgs{PREREQ_PM};
+  for my $mod ( keys %$br ) {
+    if ( exists $pp->{$mod} ) {
+      $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
+    }
+    else {
+      $pp->{$mod} = $br->{$mod};
+    }
+  }
+}
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
+
+WriteMakefile(%WriteMakefileArgs);
 
-license 'perl';
 
-auto_install;
 
-WriteAll;
diff -ur -I '^version' -I VERSION CHI-Driver-DBI-1.23/README CHI-Driver-DBI-1.24/README
--- CHI-Driver-DBI-1.23/README	2010-05-22 21:30:03.000000000 -0700
+++ CHI-Driver-DBI-1.24/README	2011-03-09 23:05:06.000000000 -0800
@@ -1,20 +1,23 @@
 NAME
     CHI::Driver::DBI - Use DBI for cache storage
 
-SYNOPSIS
-     use CHI;
+VERSION
+    version 1.24
 
-     # Supply a DBI handle
-     #
-     my $cache = CHI->new( driver => 'DBI', dbh => DBI->connect(...) );
-
-     # or a DBIx::Connector
-     #
-     my $cache = CHI->new( driver => 'DBI', dbh => DBIx::Connector->new(...) );
-
-     # or code that generates a DBI handle
-     #
-     my $cache = CHI->new( driver => 'DBI', dbh => sub { ...; return $dbh } );
+SYNOPSIS
+        use CHI;
+    
+        # Supply a DBI handle
+        #
+        my $cache = CHI->new( driver => 'DBI', dbh => DBI->connect(...) );
+    
+        # or a DBIx::Connector
+        #
+        my $cache = CHI->new( driver => 'DBI', dbh => DBIx::Connector->new(...) );
+    
+        # or code that generates a DBI handle
+        #
+        my $cache = CHI->new( driver => 'DBI', dbh => sub { ...; return $dbh } );
 
 DESCRIPTION
     This driver uses a database table to store the cache. The newest
@@ -28,10 +31,29 @@
     is not appropriate. Also, the speed of simple lookups on MySQL when
     accessed over a local socket is very hard to beat. DBI is fast.
 
-ATTRIBUTES
+SCHEMA
+    Each namespace requires a table like this:
+
+        CREATE TABLE chi_<namespace> (
+           `key` VARCHAR(...),
+           `value` TEXT,
+           PRIMARY KEY (`key`)
+        )
+
+    The size of the key column depends on how large you want keys to be and
+    may be limited by the maximum size of an indexed column in your
+    database.
+
+    The driver will attempt to create the table for you if you pass
+
+CONSTRUCTOR PARAMETERS
+    create_table
+        Boolean. If true, attempt to create the database table if it does
+        not already exist. Defaults to false.
+
     namespace
-        The namespace you pass in will be appended to the `table_prefix' and
-        used as a table name. That means that if you don't specify a
+        The namespace you pass in will be appended to the `table_prefix' to
+        form the table name. That means that if you don't specify a
         namespace or table_prefix the cache will be stored in a table called
         `chi_Default'.
 
@@ -62,26 +84,7 @@
         The optional DBI handle used for read-only operations. This is to
         support master/slave RDBMS setups.
 
-    sql_strings
-        Hashref of SQL strings to use in the different cache operations. The
-        strings are built depending on the RDBMS that dbh is attached to.
-
-METHODS
-    BUILD
-        Standard issue Moose BUILD method. Used to build the sql_strings. If
-        the parameter `create_table' to `new()' was set to true, it will
-        attempt to create the db table. For Mysql and SQLite the statement
-        is "create if not exists..." so it's generally harmless.
-
-    fetch
-    store
-    remove
-    clear
-    get_keys
-    get_namespaces
-        Not supported at this time.
-
-Authors
+AUTHORS
     Original version by Justin DeVuyst and Perrin Harkins. Currently
     maintained by Jonathan Swartz.
 
@@ -91,3 +94,12 @@
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
 
+AUTHOR
+    Jonathan Swartz <swartz@pobox.com>
+
+COPYRIGHT AND LICENSE
+    This software is copyright (c) 2011 by Jonathan Swartz.
+
+    This is free software; you can redistribute it and/or modify it under
+    the same terms as the Perl 5 programming language system itself.
+
Only in CHI-Driver-DBI-1.23: inc
diff -ur -I '^version' -I VERSION CHI-Driver-DBI-1.23/lib/CHI/Driver/DBI/t/CHIDriverTests/Base.pm CHI-Driver-DBI-1.24/lib/CHI/Driver/DBI/t/CHIDriverTests/Base.pm
--- CHI-Driver-DBI-1.23/lib/CHI/Driver/DBI/t/CHIDriverTests/Base.pm	2010-05-19 08:29:47.000000000 -0700
+++ CHI-Driver-DBI-1.24/lib/CHI/Driver/DBI/t/CHIDriverTests/Base.pm	2011-03-09 23:05:05.000000000 -0800
@@ -1,4 +1,7 @@
 package CHI::Driver::DBI::t::CHIDriverTests::Base;
+BEGIN {
+  $CHI::Driver::DBI::t::CHIDriverTests::Base::VERSION = '1.24';
+}
 use DBI;
 use Module::Load::Conditional qw(can_load);
 use Test::More;
diff -ur -I '^version' -I VERSION CHI-Driver-DBI-1.23/lib/CHI/Driver/DBI/t/CHIDriverTests/SQLite.pm CHI-Driver-DBI-1.24/lib/CHI/Driver/DBI/t/CHIDriverTests/SQLite.pm
--- CHI-Driver-DBI-1.23/lib/CHI/Driver/DBI/t/CHIDriverTests/SQLite.pm	2010-05-19 06:30:30.000000000 -0700
+++ CHI-Driver-DBI-1.24/lib/CHI/Driver/DBI/t/CHIDriverTests/SQLite.pm	2011-03-09 23:05:05.000000000 -0800
@@ -1,4 +1,7 @@
 package CHI::Driver::DBI::t::CHIDriverTests::SQLite;
+BEGIN {
+  $CHI::Driver::DBI::t::CHIDriverTests::SQLite::VERSION = '1.24';
+}
 use strict;
 use warnings;
 
diff -ur -I '^version' -I VERSION CHI-Driver-DBI-1.23/lib/CHI/Driver/DBI.pm CHI-Driver-DBI-1.24/lib/CHI/Driver/DBI.pm
--- CHI-Driver-DBI-1.23/lib/CHI/Driver/DBI.pm	2010-05-19 09:46:50.000000000 -0700
+++ CHI-Driver-DBI-1.24/lib/CHI/Driver/DBI.pm	2011-03-09 23:05:05.000000000 -0800
@@ -8,9 +8,7 @@
 use Moose::Util::TypeConstraints;
 use Carp qw(croak);
 
-our $VERSION = '1.23';
-
-# TODO:  For pg see "upsert" - http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE
+our $VERSION = '1.24';
 
 extends 'CHI::Driver';
 
@@ -29,131 +27,13 @@
     sub { $dbh }
 };
 
-=head1 NAME
-
-CHI::Driver::DBI - Use DBI for cache storage
-
-=head1 SYNOPSIS
-
- use CHI;
-
- # Supply a DBI handle
- #
- my $cache = CHI->new( driver => 'DBI', dbh => DBI->connect(...) );
-
- # or a DBIx::Connector
- #
- my $cache = CHI->new( driver => 'DBI', dbh => DBIx::Connector->new(...) );
-
- # or code that generates a DBI handle
- #
- my $cache = CHI->new( driver => 'DBI', dbh => sub { ...; return $dbh } );
-
-=head1 DESCRIPTION
-
-This driver uses a database table to store the cache.  The newest versions of
-MySQL and SQLite work are known to work.  Other RDBMSes should work.
-
-Why cache things in a database?  Isn't the database what people are trying to
-avoid with caches?  This is often true, but a simple primary key lookup is
-extremely fast in many databases and this provides a shared cache that can be
-used when less reliable storage like memcached is not appropriate.  Also, the
-speed of simple lookups on MySQL when accessed over a local socket is very hard
-to beat.  DBI is fast.
-
-=head1 ATTRIBUTES
-
-=over
-
-=item namespace
-
-The namespace you pass in will be appended to the C<table_prefix> and used as a
-table name.  That means that if you don't specify a namespace or table_prefix
-the cache will be stored in a table called C<chi_Default>.
-
-=item table_prefix
-
-This is the prefix that is used when building a table name.  If you want to
-just use the namespace as a literal table name, set this to undef.  Defaults to
-C<chi_>.
-
-=cut
-
-has 'table_prefix' => ( is => 'rw', isa => 'Str', default => 'chi_', );
-
-=item dbh
-
-The main, or rw, DBI handle used to communicate with the db. If a dbh_ro handle
-is defined then this handle will only be used for writing.
-
-You may pass this handle, and dbh_ro below, in one of three forms:
-
-=over
-
-=item *
-
-a regular DBI handle
-
-=item *
-
-a L<DBIx::Connector|DBIx::Connector> object
-
-=item *
-
-a code reference that will be called each time and is expected to return a DBI
-handle, e.g.
-
-    sub { My::Rose::DB->new->dbh }
-
-=back
-
-The last two options are valuable if your CHI object is going to live for
-enough time that a single DBI handle might time out, etc.
-
-=cut
-
-has 'dbh' => ( is => 'ro', isa => "$type.DBIHandleGenerator", coerce => 1 );
-
-=item dbh_ro
-
-The optional DBI handle used for read-only operations.  This is to support
-master/slave RDBMS setups.
-
-=cut
-
-has 'dbh_ro' => (
-    is        => 'ro',
-    isa       => "$type.DBIHandleGenerator",
-    predicate => 'has_dbh_ro',
-    coerce    => 1,
-);
-
-=item sql_strings
-
-Hashref of SQL strings to use in the different cache operations. The strings
-are built depending on the RDBMS that dbh is attached to.
-
-=back
-
-=cut
-
-has 'sql_strings' => ( is => 'rw', isa => 'HashRef', lazy_build => 1, );
+has 'dbh'          => ( is => 'ro', isa => "$type.DBIHandleGenerator", coerce => 1 );
+has 'dbh_ro'       => ( is => 'ro', isa => "$type.DBIHandleGenerator", predicate => 'has_dbh_ro', coerce => 1 );
+has 'sql_strings'  => ( is => 'rw', isa => 'HashRef', lazy_build => 1 );
+has 'table_prefix' => ( is => 'rw', isa => 'Str', default => 'chi_' );
 
 __PACKAGE__->meta->make_immutable;
 
-=head1 METHODS
-
-=over
-
-=item BUILD
-
-Standard issue Moose BUILD method.  Used to build the sql_strings.  If the
-parameter C<create_table> to C<new()> was set to true, it will attempt to
-create the db table.  For Mysql and SQLite the statement is "create if not
-exists..." so it's generally harmless.
-
-=cut
-
 sub BUILD {
     my ( $self, $args ) = @_;
 
@@ -192,7 +72,7 @@
         clear    => "DELETE FROM $table",
         get_keys => "SELECT DISTINCT $key FROM $table",
         create   => "CREATE TABLE IF NOT EXISTS $table ("
-          . " $key VARCHAR( 600 ), $value TEXT,"
+          . " $key VARCHAR( 300 ), $value TEXT,"
           . " PRIMARY KEY ( $key ) )",
     };
 
@@ -215,10 +95,6 @@
     return $strings;
 }
 
-=item fetch
-
-=cut
-
 sub fetch {
     my ( $self, $key, ) = @_;
 
@@ -231,10 +107,6 @@
     return $results->[0]->[0];
 }
 
-=item store
-
-=cut
-
 sub store {
     my ( $self, $key, $data, ) = @_;
 
@@ -256,10 +128,6 @@
     return;
 }
 
-=item remove
-
-=cut
-
 sub remove {
     my ( $self, $key, ) = @_;
 
@@ -272,10 +140,6 @@
     return;
 }
 
-=item clear
-
-=cut
-
 sub clear {
     my ( $self, $key, ) = @_;
 
@@ -288,10 +152,6 @@
     return;
 }
 
-=item get_keys
-
-=cut
-
 sub get_keys {
     my ( $self, ) = @_;
 
@@ -305,17 +165,125 @@
     return @{$results};
 }
 
-=item get_namespaces
+sub get_namespaces { croak 'not supported' }
+
+# TODO:  For pg see "upsert" - http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE
+
+1;
+
+
+
+=pod
+
+=head1 NAME
+
+CHI::Driver::DBI - Use DBI for cache storage
+
+=head1 VERSION
+
+version 1.24
+
+=head1 SYNOPSIS
+
+    use CHI;
+    
+    # Supply a DBI handle
+    #
+    my $cache = CHI->new( driver => 'DBI', dbh => DBI->connect(...) );
+    
+    # or a DBIx::Connector
+    #
+    my $cache = CHI->new( driver => 'DBI', dbh => DBIx::Connector->new(...) );
+    
+    # or code that generates a DBI handle
+    #
+    my $cache = CHI->new( driver => 'DBI', dbh => sub { ...; return $dbh } );
 
-Not supported at this time.
+=head1 DESCRIPTION
+
+This driver uses a database table to store the cache.  The newest versions of
+MySQL and SQLite work are known to work.  Other RDBMSes should work.
+
+Why cache things in a database?  Isn't the database what people are trying to
+avoid with caches?  This is often true, but a simple primary key lookup is
+extremely fast in many databases and this provides a shared cache that can be
+used when less reliable storage like memcached is not appropriate.  Also, the
+speed of simple lookups on MySQL when accessed over a local socket is very hard
+to beat.  DBI is fast.
+
+=head1 SCHEMA
+
+Each namespace requires a table like this:
+
+    CREATE TABLE chi_<namespace> (
+       `key` VARCHAR(...),
+       `value` TEXT,
+       PRIMARY KEY (`key`)
+    )
+
+The size of the key column depends on how large you want keys to be and may be
+limited by the maximum size of an indexed column in your database.
+
+The driver will attempt to create the table for you if you pass
+
+=head1 CONSTRUCTOR PARAMETERS
+
+=over
+
+=item create_table
+
+Boolean. If true, attempt to create the database table if it does not already
+exist. Defaults to false.
+
+=item namespace
+
+The namespace you pass in will be appended to the C<table_prefix> to form the
+table name.  That means that if you don't specify a namespace or table_prefix
+the cache will be stored in a table called C<chi_Default>.
+
+=item table_prefix
+
+This is the prefix that is used when building a table name.  If you want to
+just use the namespace as a literal table name, set this to undef.  Defaults to
+C<chi_>.
+
+=item dbh
+
+The main, or rw, DBI handle used to communicate with the db. If a dbh_ro handle
+is defined then this handle will only be used for writing.
+
+You may pass this handle, and dbh_ro below, in one of three forms:
+
+=over
+
+=item *
+
+a regular DBI handle
+
+=item *
+
+a L<DBIx::Connector|DBIx::Connector> object
+
+=item *
+
+a code reference that will be called each time and is expected to return a DBI
+handle, e.g.
+
+    sub { My::Rose::DB->new->dbh }
 
 =back
 
-=cut
+The last two options are valuable if your CHI object is going to live for
+enough time that a single DBI handle might time out, etc.
 
-sub get_namespaces { croak 'not supported' }
+=item dbh_ro
+
+The optional DBI handle used for read-only operations.  This is to support
+master/slave RDBMS setups.
+
+=back
 
-=head1 Authors
+=head1 AUTHORS
 
 Original version by Justin DeVuyst and Perrin Harkins. Currently maintained by
 Jonathan Swartz.
@@ -327,6 +295,19 @@
 This program is free software; you can redistribute it and/or modify it under
 the same terms as Perl itself.
 
+=head1 AUTHOR
+
+Jonathan Swartz <swartz@pobox.com>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2011 by Jonathan Swartz.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
 =cut
 
-1;
+
+__END__
+
Only in CHI-Driver-DBI-1.24: release
Only in CHI-Driver-DBI-1.24: weaver.ini
