PGObject::Util::DBChange(3pm)

PGObject::Util::DBChange3pm

Track applied change files in the database

Usage

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

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

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.

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.

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/>

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.

Releases

4 releases since Debian 10 (Buster); the text changed 2 times.

  1. 10
  2. 11
  3. 12–13

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.

From libpgobject-util-dbchange-perl 0.050.4-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.