DBIx-Counter version 0.01
=========================

NAME
    DBIx::Counter - Manipulate named counters stored in a database

WARNING
    This is the initial release! It has been tested to work with SQLite,
    Mysql and MS SQL Server, under perl 5.6 and 5.8.

    I would appreciate feedback, and some help on making it compatible with
    older versions of perl. I know 'use warnings' and 'our' don't work
    before 5.6, but that's where my historic knowledge ends.

SYNOPSIS
        use DBIx::Counter;
        $c = DBIx::Counter->new('my counter', 
                                dsn       => 'dbi:mysql:mydb',
                                login     => 'username',
                                password  => 'secret'
                               );
        $c->inc;
        print $c->value;
        $c->dec;

DESCRIPTION
    This module creates and maintains named counters in a database. It has a
    simple interface, with methods to increment and decrement the counter by
    one, and a method for retrieving the value. It supports operator
    overloading for increment (++), decrement (--) and stringification ("").
    It should perform well in persistent environments, since it uses the
    connect_cached and prepare_cached methods of DBI. The biggest advantage
    over its main inspiration - File::CounterFile - is that it allows
    distributed, concurrent access to the counters and isn't tied to a
    single file system.

INSTALLATION

To install this module manually, type the following:

   perl Makefile.PL
   make
   make test
   make install

Next, create a table in the database you're intending to use. You might use
this SQL as a starting point:

    CREATE TABLE counters (
        counter_id  varchar(64) primary key,
        value       int not null default 0
    );

DEPENDENCIES

This module requires these other modules and libraries:

DBI and a working database.

COPYRIGHT AND LICENCE

Copyright (C) 2005 by Rhesa Rozendaal

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.2 or,
at your option, any later version of Perl 5 you may have available.


