=head1 NAME
SQL::DBx::Deploy - Deployment support for SQL::DB
=head1 VERSION
0.971.0. Development release.
=head1 SYNOPSIS
use SQL::DB;
use SQL::DBx::Deploy;
my $db = SQL::DB->connect('dbi:SQLite:dbname=test');
$db->deploy($arrayref);
$db->deploy_file('statements.sql');
$db->deploy_dir('/location');
=head1 DESCRIPTION
B<SQL::DBx::Deploy> adds very simple forward-only (re-)deployment
support to L<SQL::DB>. The approach is extremely simple, based on the
number of statements already executed. SQL::DBx::Deploy keeps track of
what has been run through a table in your database called '_deploy'.
B<You should only ever add new statements to your sources!>
=head1 METHODS
=over 4
=item run_file($file, [$app])
Runs the contents of $file (which must end in F<.sql> or F<.pl>)
against the database.
=item run_dir($directory, [$app])
Runs the SQL F<*.sql> or Perl F<*.pl> files found in $directory against
the database.
=item last_deploy_id( [$app] )
Returns the count of all deployment statements for application $app (or
'default') that have already been deployed.
=item deploy($arrayref, [$app])
Deploys the statements in $arrayref which have not already been
deployed for application $app (if given, 'default' otherwise).
$arrayref is an array of hashrefs containing a single key/value pair.
The key must be either I<sql> or I<pl>. Returns a two item list: the
first value is the old deploy ID, the second value is the new deploy
id.
=item deploy_file($file, [$app])
Deploys the contents of $file (which must end in F<.sql> or F<.pl>)
using deploy().
=item deploy_dir($directory, [$app])
Loads the SQL F<*.sql> or Perl F<*.pl> files found in $directory and
deploys them using deploy().
=item deployed_table_info([ $schema ])
Returns a structure which you can save (any way you like) and use as
the C<table_info> parameter to the C<new> method of L<SQL::DB>.
=back
=head1 SEE ALSO
L<SQL::DB>, L<Moo::Role>
=head1 AUTHOR
Mark Lawrence E<lt>nomad@null.netE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2011 Mark Lawrence <nomad@null.net>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.