NAME

SQL::Bibliosoph::Sims - A SQL::Bibliosoph Tester library

SYNOPSIS

my $bs = SQL::Bibliosoph::Sims();

my $array_of_hashes = $bs->h_ANYQUERY();
my $hash            = $bs->rowh_ANYQUERY();
my $array_of_arrays = $bs->ANYQUERY();

This is a simple class to replace SQL::Bibliosoph in unit test. This generate random data and does not need a catalog file. (Methods are handled on request with AUTOLOAD). The returned value is in concordance with the requested resulset( e.g.: If you ask for that hash (with the prefix rowh_) you will get a hashref).
    

DESCRIPTION

Will generate random date when you call any subrotine on it. This module is inspired on Test::Sims.

Constructor parameters

rows

This controls how many rows will be returned in the resultset. Defaults to 10.

presets

You can costumize the return of some particular query by using preset, like this:

my $bs = SQL::Bibliosoph::Sims(
                presets => {
                    rowh_USER       => { name => 'Juan', age => '42' },
                    rowh_COSTUMER   => { 
                                name => 'rand_words( size=>10 )', 
                                age =>  'rand_chars( size=>2 )',
                    },
                }
);

If the value starts with 'rand_' the argument will be evalutated. See Data::Random documentation for details about rand_ functions.

TODO

 Maybe SQL::Bibliosoph::Sims should support catalogs files (.bb). This should be simple to implement using