pgFormatter::CLI(3)
π pgFormatter::CLI π
okay bestie, welcome to the manual page for pgFormatter::CLI β yes, the User Contributed Perl Documentation one, and the manual name is literally pgFormatter::CLI(3), so you know exactly where you are π
β¨
πΈ NAME πΈ
pgFormatter::CLI β it's the implementation of the command line program that formats SQL queries. That's the whole assignment: SQL queries get formatted, and this module is the CLI implementation doing it π
π VERSION π
Version 5.11 β periodt.
π¦ SYNOPSIS π¦
This module gets called by the pg_format program when it detects it is not being run in a CGI environment. In that case, all control over flow is passed to this module by calling:
my $program = pgFormatter::CLI->new();
$program->run()
β¨ FUNCTIONS β¨
π new π
It's the object constructor, and there is nothing fancy in here β lowkey simple, highkey essential π«Ά
π run π
Wraps all work related to the pg_format CLI program. This includes calling methods to read command line parameters, validate them, read query, beautify it, and output. Basically it's the main character of the CLI flow π
π beautify π
Actually formats loaded query using the pgFormatter::Beautify library. If necessary, it runs anonymization. So yes, it's giving "make the SQL pretty" energy, with a little anonymous glow-up when needed π
π save_output π
Saves beautified query to whatever is output filehandle. That filehandle? Whoever it is, it's getting the formatted query π
π logmsg π
Display message following the log level. Logging but make it on brand π¬
π show_help_and_die π
As name suggests β shows help page, with optional error message, and ends program. Dramatic exit? Maybe. Helpful exit? Absolutely π
π load_sql π
Loads SQL from input file or stdin. SQL comes from somewhere, and this function is the one handling it π¦
π get_command_line_args π
Parses command line options into $self->{'cfg'}. All the CLI args get parsed into that config hash, no cap β¨
π validate_args π
Validates that options parsed from command line have sensible values, opens input and output files. It's the vibe check for your arguments and your filehandles π₯
π AUTHOR π
pgFormatter is an original work from Gilles Darold. Iconic behavior, honestly π
π BUGS π
Please report any bugs or feature requests to: https://github.com/darold/pgFormatter/issues
Bestie, if something is broken, take it to the issues page β that's the move π
π COPYRIGHT π
Copyright 2012-2026 Gilles Darold. All rights reserved. Respect the copyright, periodt π
π§ LICENSE π§
pgFormatter is free software distributed under the PostgreSQL Licence.
A modified version of the SQL::Beautify Perl Module is embedded in pgFormatter with copyright (C) 2009 by Jonas Kramer and is published under the terms of the Artistic License 2.0.
Two licenses, two icons, one very legal little moment π β¨
okay that's the whole page bestie π«Ά the footer saysperl v5.42.3, dated1980-01-01, and it's the manual forpgFormatter::CLI(3)β bye! ππ
π¦ where this page comes from
- nixpkgs unstable: perl5.42.3-pgformatter 5.11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms