File Coverage

blib/lib/SQL/Wizard/Expr/CTE.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 22 24 91.6


line stmt bran cond sub pod time code
1             package SQL::Wizard::Expr::CTE;
2              
3 14     14   89 use strict;
  14         26  
  14         533  
4 14     14   62 use warnings;
  14         22  
  14         786  
5 14     14   101 use parent 'SQL::Wizard::Expr';
  14         23  
  14         73  
6 14     14   919 use SQL::Wizard::Expr::Select;
  14         23  
  14         1895  
7              
8             sub new {
9 4     4 0 12 my ($class, %args) = @_;
10             # args:
11             # ctes => [ { name => 'recent', query => $select }, ... ]
12             # recursive => 0|1
13 4         13 $class->SUPER::new(%args);
14             }
15              
16             # Chain the main SELECT after WITH
17             sub select {
18 4     4 0 53 my ($self, %args) = @_;
19 4         43 SQL::Wizard::Expr::Select->from_args(%args, _cte => $self, _renderer => $self->{_renderer});
20             }
21              
22             1;