PGObje...Change(3pm)

๐Ÿ“ฆ
version 0.050.4 ยท 2 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

๐Ÿ’– PGObject::Util::DBChange ๐Ÿ’–

okay bestie, so this is the manual page for PGObject::Util::DBChange, and it lives in the User Contributed Perl Documentation corner of your system's man pages. It's the whole thing. Grab a boba. ๐Ÿง‹


โœจ NAME โœจ

PGObject::Util::DBChange โ€” track applied change files in the database. that's it, that's the whole job, and it does it flawlessly ๐Ÿ’…


๐ŸŽ€ VERSION ๐ŸŽ€

Version 0.050.4


๐ŸŒธ SYNOPSIS ๐ŸŒธ

Quick summary of what the module does. (yes bestie, the original literally says that, we're keeping it ๐Ÿซถ)

Perhaps a little code snippet:

use PGObject::Util::DBChange;

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

look at that little ... at the end, it's giving mystery โœจ


๐Ÿฆ‹ PROPERTIES ๐Ÿฆ‹

path

Path to load content from โ€” must be defined and it must be '' or a string. no vibes allowed, no undef allowed. ๐Ÿšซ

no_transactions

If true, we assume success even if the transaction fails. ๐Ÿ˜ญ

Future versions may add additional checking possibilities instead.

content

Content of the file. Can be specified at load time, or it gets built by reading from the file. your call, bestie ๐Ÿ’–

succeeded (rwp)

Undefined until run. After run: 1 if success, 0 if failure. so basically it's a little mood ring for your query ๐Ÿ”ฎ

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 versions may read these from comments in the files themselves.

sha

The sha hash of the normalized content of the file โ€” normalized meaning comments and whitespace lines get stripped. so the hash is about the actual substance, not the filler. main character energy. ๐Ÿ‘‘

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. fancy. ๐Ÿ’…


๐Ÿ’œ METHODS ๐Ÿ’œ

content_wrapped($before, $after)

Returns content wrapped with before and after. like a little content sandwich ๐Ÿฅช

is_applied($dbh)

Returns 1 if it has already been applied, false if not. vibe check on your migrations. โœ…

run($dbh)

Runs against the current dbh without tracking. no receipts, no memory, just send it. ๐Ÿ’€

apply($dbh)

Applies the current file to the db in the current dbh. and this one does track. ๐Ÿ“


๐ŸŒˆ 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 it was up to date, 1 if it was initialized. those numbers matter, bestie, don't mix them up ๐Ÿซ 

update($dbh)

Updates the current schema to the most recent. glow up time โœจ


๐Ÿ‘‘ 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. so you're literally in the loop the whole time, iconic behavior fr fr ๐Ÿ’–

๐Ÿซถ 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/>

four whole places to lurk, we love options ๐ŸŒธ


๐Ÿงš 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. sponsorship is so real, thank u Sedex ๐Ÿซถ


Copyright 2016, 2017 Chris Travers.

This program is distributed under the (Revised) BSD License: <http://www.opensource.org/licenses/BSD-3-Clause>

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of LedgerSMB nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
**THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

okay that was a lot of capital letters, but like, legally required capital letters, no cap ๐Ÿ˜ญ


and that's the whole page bestie ๐Ÿ’œ this one was rendered with perl v5.34.0 and dated 2022-07-04, so if you're reading it way later, that's just the vintage. still slay. periodt. โœจ๐ŸŽ€