Parse:...:Output(3pm)

πŸ“¦
version 0.31 Β· 2 versions
  • 0.31 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.31 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Parse:...:Output(3pm) β€” the manual, but make it cute πŸ’–

okay bestie, this is the page for Parse::Dia::SQL::Output, straight out of the User Contributed Perl Documentation section of the perl manpages. it's a whole 3pm page and it's lowkey iconic. let's get into it ✨


🌸 NAME 🌸

Parse::Dia::SQL::Output β€” Create SQL base class. that's it, that's the name, and she's serving exactly what it says on the tin πŸ’…


✨ SYNOPSIS ✨

the whole vibe in four lines, no notes:

use Parse::Dia::SQL;
my $dia = Parse::Dia::SQL->new(...);
my $output = $dia->get_output_instance();
print $output->get_sql();

see how she does it? you make a Parse::Dia::SQL object, you grab the output instance off it, and then you just print the SQL. main character behaviour fr fr 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so this is the base sql formatter class for creating sql. she's the blueprint, the template, the mother of the whole sql-making situation.

she comes with the basic functionality built in β€” and the way that works is that subclasses can override it. and there's one subclass per RDBMS, so every database gets her own little customised version. it's giving "same base, different fonts" energy and honestly? obsessed 😭


πŸ’œ SEE ALSO πŸ’œ

sister classes, the extended universe, the group chat members:

  • Parse::Dia::SQL::Output::DB2
  • Parse::Dia::SQL::Output::Oracle

πŸ‘‘ METHODS πŸ‘‘

πŸŽ€ new()

the constructor, the entry point, the moment where it all begins ✨

arguments, and yes there's literally just one:

  • db β€” the target database type

that's your whole argument list. she keeps it simple, she keeps it clean, periodt πŸ’…

🌈 get_sql()

Return all sql. all of it. every last statement. she's not gatekeeping anything 🫢

and the sequence of statements goes like this, in exactly this order, no cutting the line:

constraints drop
permissions drop
view drop
schema drop
smallpackage pre sql
schema create
view create
permissions create
inserts
smallpackage post sql
associations create  (indices first, then foreign keys)
πŸ’€ note the order, bestie β€” drops happen before creates, and associations create comes dead last, and inside that one the indices go first and the foreign keys come after. the way that matters iykyk.

she drops all the old stuff first (constraints, permissions, view, schema), then runs smallpackage pre sql, then rebuilds the world in order (schema create, view create, permissions create), then the inserts, then smallpackage post sql, and finally associations create. slay πŸ”₯


and that's the whole page, bestie! this little manual came to you courtesy of perl v5.36.0, dated 2022-11-19, and it lives in the Parse:...:Output(3pm) corner of the docs. now go forth and generate some sql πŸ’–βœ¨πŸ§š