MySQL::Diff(3pm)

πŸ“¦
version 0.60 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– MySQL::Diff πŸ’–

okay so bestie, welcome to MySQL::Diff β€” she generates a database upgrade instruction set. that's the whole vibe. no cap.


✨ SYNOPSIS ✨

use MySQL::Diff;

my $md = MySQL::Diff->new( %options );
my $db1 = $md->register_db($ARGV[0], 1);
my $db2 = $md->register_db($ARGV[1], 2);
my $diffs = $md->diff();

🌸 DESCRIPTION 🌸

Generates the SQL instructions required to upgrade the first database to match the second.

that's it, that's the whole job. db1 walks in looking a mess, db2 is the glow-up goal, and this module writes you the to-do list. πŸ’…


πŸŽ€ METHODS πŸŽ€

🌈 Constructor

  • new( %options ) β€” instantiate the objects, providing the command line options for database access and process requirements. like, she needs to know how to talk to your databases before she does anything. feed her the options. 🫢

πŸ¦‹ Public Methods

fuller documentation will appear here in time :) β€” yes bestie, that's genuinely what the original says. iconic honesty. πŸ’€

  • register_db($name,$inx) β€” reference the database, and setup a connection. so like, this is the "hey girl, meet your database" moment.
    • the $name can be an already existing 'MySQL::Diff::Database' database object. so you can hand her a whole pre-built one, she's not picky. 😌
    • the $inx can be '1' or '2', and it refers both to the order of the diff, and to the host, port, username and password arguments that have been supplied. so like, index 1 = the "before" girlie, index 2 = the "after" girlie, and each index pulls its own connection credentials. periodt.
  • db1()
  • db2() β€” return the first and second databases registered via "register_db()". literally just handing them back to you. ✨
  • diff() β€” performs the diff, returning a string containing the commands needed to change the schema of the first database into that of the second. this is the main character method. she does the work and hands you a string full of SQL. πŸ‘‘

Copyright (c) 2000-2016 Adam Spiers. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

ngl the "same terms as Perl itself" clause is doing a lot of heavy lifting there but okay, slay, we love a permissive license. πŸ’œ

πŸ”₯ SEE ALSO πŸ”₯

  • mysqldiff
  • MySQL::Diff::Database
  • MySQL::Diff::Table
  • MySQL::Diff::Utils

go read those too, bestie, iykyk. πŸ“š


πŸ’« AUTHOR πŸ’«

Adam Spiers <mysqldiff@adamspiers.org>


perl v5.26.2 Β· 2018-07-20 Β· MySQL::Diff(3pm)

and that's the page, bestie πŸŽ€ β€” written up by the perl docs girlies back on 2018-07-20, running on perl v5.26.2, and filed under MySQL::Diff(3pm). mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from