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   78 use strict;
  14         25  
  14         511  
4 14     14   52 use warnings;
  14         20  
  14         580  
5 14     14   60 use parent 'SQL::Wizard::Expr';
  14         22  
  14         62  
6 14     14   749 use SQL::Wizard::Expr::Select;
  14         20  
  14         1724  
7              
8             sub new {
9 4     4 0 7 my ($class, %args) = @_;
10             # args:
11             # ctes => [ { name => 'recent', query => $select }, ... ]
12             # recursive => 0|1
13 4         11 $class->SUPER::new(%args);
14             }
15              
16             # Chain the main SELECT after WITH
17             sub select {
18 4     4 0 37 my ($self, %args) = @_;
19 4         36 SQL::Wizard::Expr::Select->from_args(%args, _cte => $self, _renderer => $self->{_renderer});
20             }
21              
22             1;