SQLT-DIFF-OLD(1p)

πŸ“¦
version 1.66 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– SQLT-DIFF-OLD(1p) πŸ’–

okay bestie, so this one lives in the User Contributed Perl Documentation section of the manual, and it's literally called sqlt-diff β€” it finds the differences b/w two schemas. yes, "b/w". iconic abbreviation behavior. πŸ¦‹


✨ NAME ✨

sqlt-diff β€” find the differences b/w two schemas πŸŽ€


🌸 SYNOPSIS 🌸

need help? say less:

sqlt-diff -h|--help

want the whole roster of valid parsers? bet:

sqlt -l|--list

ok so to actually diff two schemas:

sqlt-diff [options] file_name1=parser file_name2=parser

and the options, because of course there are options:

  • -d, --debug β€” show debugging info πŸ›

πŸ’… DESCRIPTION πŸ’…

so sqlt-diff is a utility for creating a file of SQL commands necessary to transform the first schema provided to the second. like, you hand it schema one, you hand it schema two, and it hands you back the SQL to make one become two. πŸ’«

ngl it's not yet exhaustive in its ability to mutate the entire schema β€” no cap, it does not do everything β€” but here's what it will report:

  • New tables ✨

Using the Producer class of the target (second) schema, any tables missing in the first schema will be generated in their entirety β€” that's fields, constraints, indices, the whole glow-up. πŸ’–

  • Missing/altered fields 😭

Any fields missing or altered between the two schemas will be reported as:

ALTER TABLE <table_name>
  [DROP <field_name>]
  [CHANGE <field_name> <datatype> (<size>)] ;
  • Missing/altered indices πŸ‘‘

Any indices missing or of a different type or on different fields will be indicated. Indices that should be dropped will be reported as such:

DROP INDEX <index_name> ON <table_name> ;

An index of a different type or on different fields will be reported as a new index as such:

CREATE [<index_type>] INDEX [<index_name>] ON <table_name>
  ( <field_name>[,<field_name>] ) ;
🚨 okay important one, don't skip this: ALTER/DROP TABLE and CREATE INDEX statements are not generated by the Producer, unfortunately, and may require massaging before being passed to your target database. so like… proofread before you yeet them at your db, fr fr. πŸ’€

🫢 AUTHOR 🫢

Ken Youens-Clark <kclark@cpan.org>. king behavior, we stan. πŸ’œ


🌈 SEE ALSO 🌈

SQL::Translator, <http://sqlfairy.sourceforge.net>. go read those too, iykyk πŸ“š


and that's the whole page, bestie!! brought to you by perl v5.40.0, dated 2024-11-23 β€” mwah, slay, periodt. πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from