File: format-sql

package info (click to toggle)
libsql-abstract-perl 1.72-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 532 kB
  • sloc: perl: 6,501; makefile: 14
file content (16 lines) | stat: -rwxr-xr-x 417 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env perl

use SQL::Abstract::Tree;
use Getopt::Long::Descriptive;

my ($opt, $usage) = describe_options(
  'format-sql %o',
  [ 'profile|p=s',   "the profile to use", { default => 'console' } ],
  [ 'help',       "print usage message and exit" ],
);

  print($usage->text), exit if $opt->help;

my $sqlat = SQL::Abstract::Tree->new({ profile => $opt->profile });

print $sqlat->format($_) . "\n" while <>;