Fix missing doc (RT#62587)
[scpubgit/Q-Branch.git] / lib / SQL / Abstract / Tree.pm
index e3eba08..1c3a82f 100644 (file)
@@ -154,6 +154,7 @@ my %indents = (
    join          => 1,
    'left join'   => 1,
    on            => 2,
+   having        => 0,
    'group by'    => 0,
    'order by'    => 0,
    set           => 1,
@@ -212,6 +213,7 @@ my %profiles = (
               on                      => $blue,
 
               'group by'              => $yellow,
+              having                  => $yellow,
               'order by'              => $yellow,
 
               skip                    => $green,
@@ -254,6 +256,7 @@ my %profiles = (
          on            => ['<span class="on">'      , '</span>'],
 
          'group by'    => ['<span class="group-by">', '</span>'],
+         having        => ['<span class="having">',   '</span>'],
          'order by'    => ['<span class="order-by">', '</span>'],
 
          skip          => ['<span class="skip">',   '</span>'],
@@ -281,6 +284,9 @@ sub new {
    my $args  = shift || {};
 
    my $profile = delete $args->{profile} || 'none';
+
+   die "No such profile '$profile'!" unless exists $profiles{$profile};
+
    my $data = $merger->merge( $profiles{$profile}, $args );
 
    bless $data, $class
@@ -509,6 +515,10 @@ sub format { my $self = shift; $self->unparse($self->parse($_[0]), $_[1]) }
 
 =pod
 
+=head1 NAME
+
+SQL::Abstract::Tree - Represent SQL as an AST
+
 =head1 SYNOPSIS
 
  my $sqla_tree = SQL::Abstract::Tree->new({ profile => 'console' });