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         21  
  14         447  
4 14     14   51 use warnings;
  14         28  
  14         664  
5 14     14   61 use parent 'SQL::Wizard::Expr';
  14         21  
  14         63  
6 14     14   744 use SQL::Wizard::Expr::Select;
  14         24  
  14         1686  
7              
8             sub new {
9 4     4 0 16 my ($class, %args) = @_;
10             # args:
11             # ctes => [ { name => 'recent', query => $select }, ... ]
12             # recursive => 0|1
13 4         17 $class->SUPER::new(%args);
14             }
15              
16             # Chain the main SELECT after WITH
17             sub select {
18 4     4 0 69 my ($self, %args) = @_;
19 4         66 SQL::Wizard::Expr::Select->from_args(%args, _cte => $self, _renderer => $self->{_renderer});
20             }
21              
22             1;