in reply to Re: SQL::Translator, sqlt-diff confusion
in thread SQL::Translator, sqlt-diff confusion

The question is specific, and not covered in the docs that I can see. I'm asking one specific thing, not for people to write a script for me. It's ok to pass a post by if you don't know the answer. It looks like you decided I was lazy without even taking your own advice. Anonymous posters can't "edit" their questions, have you read the perl monks documentation?
  • Comment on Re^2: SQL::Translator, sqlt-diff confusion

Replies are listed 'Best First'.
Re^3: SQL::Translator, sqlt-diff confusion
by ww (Archbishop) on Oct 02, 2014 at 14:19 UTC

    The doc:

    FINDING THE DIFFERENCES BETWEEN TWO SCHEMAS ^
    
    As mentioned above, the "sqlt-diff" schema examines two schemas and creates SQL schema modification statements that can be used to transform the first schema into the second. The flag syntax is somewhat quirky:
    
      $ sqlt-diff foo-v1.sql=MySQL foo-v2.sql=Oracle > diff.sql
    
    As demonstrated, the schemas need not even be from the same vendor, though this is likely to produce some spurious results as datatypes are not currently viewed equivalent unless they match exactly, even if they would be converted to the same. For example, MySQL's "integer" data type would be converted to Oracle's "number," but the differ isn't quite smart enough yet to figure this out. Also, as the SQL to ALTER a field definition varies from database vendor to vendor, these statements are made using just the keyword "CHANGE" and will likely need to be corrected for the target database.

    It appears to me that the modification statements will provide information one-SMOP from that for which you've asked (i.e., some further effort required; batteries not included).

    Update: And if that's not the solution, there are several other sections of the doc (manual) that look relevant, including "EXTRACT SQL SCHEMAS DIRECTLY FROM DATABASE," "AUTOMATED CODE-GENERATION" and 'SQLFAIRY SCRIPTS" (which refers you to separate perldocs for several possibly useful approaches).


    ++$anecdote ne $data


Re^3: SQL::Translator, sqlt-diff confusion
by Anonymous Monk on Oct 02, 2014 at 20:11 UTC
    It looks like you decided I was lazy

    The root node looks lazy and doesn't have any really good replies yet because it's two sentences in one paragraph, doesn't show input, code, output, error messages, it doesn't describe what has been tried, or what the bigger picture is, and is missing details like: what databases?

    To put it more briefly, it doesn't follow the guidelines from How do I post a question effectively? and related nodes on getting help effectively, so the reference to the PerlMonks documentation is pretty ironic.

      what databases?

      Nevermind that one... MySQL & Oracle. The rest is still true.