MToken

 view release on metacpan or  search on metacpan

conf/mtoken.conf  view on Meta::CPAN

#    File       /tmp/test.db
#    Attributes RaiseError=0; PrintError=0; sqlite_unicode=1
#</Store>

# MySQL example:
#<Store>
#    DSN        DBI:mysql:database=mtoken;host=mysql.example.com
#    User       username
#    Password   password
#    Timeout    10
#    Attributes RaiseError=0; PrintError=0; mysql_enable_utf8=1; mysql_auto_reconnect=1
#</Store>

# PostgreSQL Example
#<Store>
#    DSN        DBI:Pg:dbname=mtoken;host=mysql.example.com
#    User       username
#    Password   password
#    Timeout    10
#    Attributes RaiseError=0; PrintError=0; pg_enable_utf8=1
#</Store>

lib/MToken/Store.pm  view on Meta::CPAN

        do_init => 1, # Need to try initialize the db
    );

    my $store = MToken::Store->new(
        dsn => "DBI:mysql:database=MToken;host=mysql.example.com",
        user => "username",
        password => "password",
        set => [
            "RaiseError        0",
            "PrintError        0",
            "mysql_enable_utf8 1",
        ],
    );

    die($store->error) unless $store->status;

=head1 DESCRIPTION

This module provides store methods.

=head2 SQLITE DDL

lib/MToken/Store.pm  view on Meta::CPAN


    # ... or MySQL:

    my $store = MToken::Store->new(
        dsn => "DBI:mysql:database=mtoken;host=mysql.example.com",
        user => "username",
        password => "password",
        set => [
            "RaiseError        0",
            "PrintError        0",
            "mysql_enable_utf8 1",
        ],
    );

Creates DBI object

=head2 add

    $store->add(
        file        => "test.txt",
        size        => 1024,



( run in 0.253 second using v1.01-cache-2.11-cpan-00829025b61 )