initial profile and configuration support
[dbsrgits/SQL-Abstract.git] / t / 11unparse.t
1 use strict;
2 use warnings;
3
4 use SQL::Abstract::Tree;
5
6 my $sqlat = SQL::Abstract::Tree->new({ profile => 'console' });
7
8 {
9    my $sql = "SELECT a, b, c FROM foo WHERE foo.a =1 and foo.b LIKE 'station'";
10
11    print "$sql\n";
12    print $sqlat->format($sql) . "\n";
13 }
14
15 {
16    my $sql = "SELECT * FROM (SELECT * FROM foobar) WHERE foo.a =1 and foo.b LIKE 'station'";
17
18    print "$sql\n";
19    print $sqlat->format($sql) . "\n";
20 }
21
22 {
23    my $sql = "SELECT * FROM lolz WHERE ( foo.a =1 ) and foo.b LIKE 'station'";
24
25    print "$sql\n";
26    print $sqlat->format($sql) . "\n";
27 }
28
29 # stuff we want:
30 #    Nested indentation
31 #    Max Width
32 #    Color coding (console)
33 #    Color coding (html)