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

MySQL::Diff - Generates a database upgrade instruction set

Author

       Adam Spiers <mysqldiff@adamspiers.org>

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

Description

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

Methods

Constructor
       new( %options )
           Instantiate  the  objects,  providing  the  command  line  options  for  database  access and process
           requirements.

   PublicMethods
       Fuller documentation will appear here in time :)

       •   register_db($name,$inx)

           Reference  the  database,  and  setup  a  connection.  The  name   can   be   an   already   existing
           'MySQL::Diff::Database' database object. The index can be '1' or '2', and refers both to the order of
           the diff, and to the host, port, username and password arguments that have been supplied.

       •   db1()db2()

           Return the first and second databases registered via "register_db()".

       •   diff()

           Performs  the  diff,  returning  a  string containing the commands needed to change the schema of the
           first database into that of the second.

Name

       MySQL::Diff - Generates a database upgrade instruction set

See Also

       mysqldiff, MySQL::Diff::Database, MySQL::Diff::Table, MySQL::Diff::Utils

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();

See Also