DBIx::Simple::Batch - An Alternative To ORM and SQL Stored Procedures.
Version 1.69
DBIx::Simple::Batch::Documentation
http://app.alnewkirk.com/pod/projects/dbix/simple/batch/
The new method initializes a new DBIx::Simple::Batch object.
new arguments
new usage and syntax
$db = DBIx::Simple::Batch->new($path); takes 2 arguments 1st argument - required $path - path to folder where sql files are stored 2nd argument - required @connection_string - display help for a specific command # Simple Example: my $db = DBIx::Simple::Batch->new($path, @connection_string); $db->call->folder->file(@parameters); --- # Got It? Now lets look at that again in slow-motion my $path = '/var/www/app/queries'; my @connection_string = ('dbi:SQLite:/var/www/app/foo.db'); my $db = DBIx::Simple::Batch->new($path, @connection_string); # $path can also take a file pattern which turns on object mapping my $path = '/var/www/app/queries/*.sql'; my @connection_string = ('dbi:SQLite:/var/www/app/foo.db'); my $db = DBIx::Simple::Batch->new($path, @connection_string); $db->call->folder->file(...);
The call method is used to access and process sql files in an object-oriented fashion.
call arguments
No arguments.
call usage and syntax
$db->call; takes 0 arguments example: $db->call->file(...); $db->call->folder->file; $db->call->folder->folder->file;
the `constants` method is used to define specific custom variables that should be including in the execution of all commands.
constants arguments
constants usage and syntax
$self->constants({ param1 => 1, param2 => 2}); takes 1 argument 1st argument - required \%hashref - display help for a specific command example: $self->constants({ id => 1 }); Now, in every command `$!id` will be replaced with `1` unless a custom param is passed to the process_queue method or call accessors.
The queue function parses the passed (sql) text file and build the list of sql statements to be executed and how.
queue arguments
queue usage and syntax
$db->queue($sql_file); takes 1 argument 1st argument - required $sql_file - path to the sql file to process example: $db->queue($sql_file);
The process_queue function sequentially processes the recorded commands found the (sql) text file.
process_queue arguments
process_queue usage and syntax
$self->process_queue(@parameters); takes 1 argument 1st argument - required @parameters - parameters to be used in parsing the sql file example: $db->process_queue(@parameters); $db->process_queue($hashref, @parameters);
process_queue synonyms
process
The cache method accesses an arrayref of resultsets that were captured using the (sql file) capture command and returns the resultset of the index or name passed to it or returns 0.
cache arguments
cache usage and syntax
my $results = $db->cache($index); takes 1 argument 1st argument - required $index - name or array index of the desired resultset example: my $resultset = $db->cache('new_group'); my $resultset = $db->cache(2);
cache synonyms
rs
The clear method simply clears the cache (the resultset space).
clear arguments
clear usage and syntax
$db->clear; takes 0 arguments example: $db->clear
Al Newkirk, <al.newkirk at awnstudio.com>
<al.newkirk at awnstudio.com>
Please report any bugs or feature requests to bug-DBIx-Simple-Batch at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Simple-Batch. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-DBIx-Simple-Batch at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc DBIx::Simple::Batch
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Simple-Batch
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/DBIx-Simple-Batch
CPAN Ratings
http://cpanratings.perl.org/d/DBIx-Simple-Batch
Search CPAN
http://search.cpan.org/dist/DBIx-Simple-Batch/
Copyright 2009 Al Newkirk.
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.
To install DBIx::Simple::Batch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Simple::Batch
CPAN shell
perl -MCPAN -e shell install DBIx::Simple::Batch
For more information on module installation, please visit the detailed CPAN module installation guide.