logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

PGObject::Util::DBChange - Track applied change files in the database

Acknowledgements

       Portions of this code were developed for LedgerSMB 1.5 and copied from appropriate sources there.

       Many thanks to Sedex Global for their sponsorship of portions of the module.

Author

       Chris Travers, "<chris.travers at gmail.com>"

Bugs

       Please report any bugs or feature requests to "bug-pgobject-util-dbchange at rt.cpan.org", or through the
       web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=PGObject-Util-DBChange>.  I will be
       notified, and then you'll automatically be notified of progress on your bug as I make changes.

Functions (Package-Level)

needs_init($dbh)
       Checks to see whether the schema has been initialized

   init($dbh);
       Initializes the system.  Modifications are maintained through the History module.  Returns 0 if was up to
       date, 1 if was initialized.

   update($dbh)
       Updates the current schema to the most recent.

Methods

content_wrapped($before,$after)
       Returns content wrapped with before and after.

   is_applied($dbh)
       returns 1 if has already been applied, false if not

   run($dbh)
       Runs against the current dbh without tracking.

   apply($dbh)
       Applies the current file to the db in the current dbh.

Name

       PGObject::Util::DBChange - Track applied change files in the database

Properties

path
       Path to load content from -- Must be defined and '' or a string

   no_transactions
       If true, we assume success even if transaction fails

       Future versions may add additional checking possibilies instead

   content
       Content of the file.  Can be specified at load, or is built by reading from the file.

   succeeded(rwp)
       Undefined until run.  After run, 1 if success, 0 if failure.

   dependencies
       A list of other changes to apply first.  If strings are provided, these are turned into path objects.

       Currently these must be explicitly provided. Future bersions may read these from comments in the files
       themselves.

   sha
       The sha hash of the normalized content (comments and whitespace lines stripped) of the file.

   begin_txn
       Code to begin transaction, defaults to 'BEGIN;'

   commit_txn
       Code to commit transaction, defaults to 'COMMIT;'

       Useful if one needs to do two phase commit or similar

Support

       You can find documentation for this module with the perldoc command.

           perldoc PGObject::Util::DBChange

       You can also look for information at:

       •   RT: CPAN's request tracker (report bugs here)

           <http://rt.cpan.org/NoAuth/Bugs.html?Dist=PGObject-Util-DBChange>

       •   AnnoCPAN: Annotated CPAN documentation

           <http://annocpan.org/dist/PGObject-Util-DBChange>

       •   CPAN Ratings

           <http://cpanratings.perl.org/d/PGObject-Util-DBChange>

       •   Search CPAN

           <http://search.cpan.org/dist/PGObject-Util-DBChange/>

Synopsis

       Quick summary of what the module does.

       Perhaps a little code snippet.

           use PGObject::Util::DBChange;

           my $foo = PGObject::Util::DBChange->new();
           ...

Version

       Version 0.050.4

See Also