The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Hash::Storage::Driver::DBI - DBI driver for Hash::Storage

MODULE IS IN A DEVELOPMENT STAGE. DO NOT USE IT YET.

SYNOPSIS

    my $st = Hash::Storage->new( driver => [ DBI => {
        dbh           => $dbh,
        serializer    => 'JSON',
        table         => 'users',
        key_column    => 'user_id',
        data_column   => 'serialized',
        index_columns => ['age', 'fname', 'lname', 'gender']
    }]);

    # Store hash by id
    $st->set( 'user1' => { fname => 'Viktor', gender => 'M', age => '28' } );

    # Get hash by id
    my $user_data = $st->get('user1');

    # Delete hash by id
    $st->del('user1');

DESCRIPTION

Hash::Storage::Driver::DBI is a DBI Driver for Hash::Storage (multipurpose storage for hash). You can consider Hash::Storage object as a collection of hashes. You can use it for storing users, sessions and a lot more data.

OPTIONS

dbh

Database handler

serializer

Data::Serializer driver name

table

Table name to save data

key_column

column for saving object id

data_column

all data will be serialized in one field.

index_columns

List of colums to increase searches

AUTHOR

"koorchik", <"koorchik at cpan.org">

BUGS

Please report any bugs or feature requests to https://github.com/koorchik/Hash-Storage-Driver-DBI/issues

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2012 "koorchik".

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.