SQLT-DIFF-OLD(1p)
π 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 TABLEandCREATE INDEXstatements 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
- debian trixie: libsql-translator-perl 1.66-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsql-translator-perl 1.66-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsql-translator-perl 1.66-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms