Skip to content

Instantly share code, notes, and snippets.

@dramaturg
Last active July 25, 2016 13:29
Show Gist options
  • Save dramaturg/ec718bc8b6ebe66b1c85899d6fb74ba5 to your computer and use it in GitHub Desktop.
Save dramaturg/ec718bc8b6ebe66b1c85899d6fb74ba5 to your computer and use it in GitHub Desktop.
Quick n' dirty SQL beautifier with SQL::Beautify
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use SQL::Beautify;
my $sql = SQL::Beautify->new(uc_keywords => 1);
my $inp = do { local $/; <STDIN> };
$sql->query($inp);
print $sql->beautify;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment