DBIx::ThinSQL::Deploy - Deployment support for DBIx::ThinSQL
0.0.46 (2016-10-16) development release.
use DBIx::ThinSQL; use DBIx::ThinSQL::Deploy; my $db = DBIx::ThinSQL->connect('dbi:SQLite:dbname=test'); $db->deploy_sql($sql); $db->deploy_arrayref($arrayref); $db->deploy_file('statements.sql'); $db->deploy_dir('/location');
DBIx::ThinSQL::Deploy adds very simple forward-only (re-)deployment support to DBIx::ThinSQL. The approach is extremely simple, based on the number of statements already executed. DBIx::ThinSQL::Deploy keeps track of what has been run through a table in your database called '_deploy'.
You should only ever add new statements to your sources!
Runs each of the statements contained in $arrayref against the database. $arrayref is an arrayref of hashrefs containing a single key/value pair. The key must be either sql or pl. Returns a two item list: the first value is the old deploy ID, the second value is the new deploy id.
Runs the statements in $sql against the database.
Runs the contents of $file (which must end in .sql or .pl) against the database.
Runs the SQL *.sql or Perl *.pl files found in $directory against the database.
Returns the count of all deployment statements for application $app (or 'default') that have already been deployed.
Deploys the statements in $sql which have not already been deployed for application $app (if given, 'default' otherwise).
Deploys the statements in $arrayref which have not already been deployed for application $app (if given, 'default' otherwise). $arrayref is an arrayref of hashrefs containing a single key/value pair. The key must be either sql or pl. Returns a two item list: the first value is the old deploy ID, the second value is the new deploy id.
Deploys the contents of $file (which must end in .sql or .pl) using deploy_arrayref().
Loads the SQL *.sql or Perl *.pl files found in $directory and deploys them using deploy_arrayref().
Returns a structure which you can save (any way you like) and use as the table_info parameter to the new method of DBIx::ThinSQL.
table_info
new
DBIx::ThinSQL
Mark Lawrence <nomad@null.net>
Copyright (C) 2013 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.
To install DBIx::ThinSQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::ThinSQL
CPAN shell
perl -MCPAN -e shell install DBIx::ThinSQL
For more information on module installation, please visit the detailed CPAN module installation guide.