On Mon, Nov 17, 2008 at 11:23 PM, John Goulah <[EMAIL PROTECTED]> wrote:
> So far I've been using sqlt-diff to diff two files:
>  file1.sql=MySQL file2.sql=MySQL
>
>
> but what I really need is to be able to diff a file against the actual
> database and produce a diff.
>
>
> I see there is a parser called DBI-MySQL, but I'm not sure how to
> invoke it.  My thought would be to use a DSN string, but then how
> would one supply a username/password?
>
>
> If someone can clear this up I would be glad to patch the help output
> to give some better examples on how this may work.
>

Hi John,

I have done some work which involved creating a diff directly against
the database.

Essentially I create one SQLT object like so:

  my $db_tr = SQL::Translator->new({
                                    add_drop_table => 1,
                                    parser => 'DBI',
                                    parser_args => { dbh => $dbh }
                                   });

And then another from the other source (in my case a DBIx::Class
schema object) and then diff them using
SQL::Translator::Diff::schema_diff. For the whole thing, you can see
the badly written _create_db_to_schema_diff in the following class:
http://xrl.us/oxpkm

Cheers,
Luke.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-- 
sqlfairy-developers mailing list
sqlfairy-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlfairy-developers

Reply via email to