File Coverage

blib/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/VersionResultSet.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 2 2 100.0
total 28 28 100.0


line stmt bran cond sub pod time code
1             package DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResultSet;
2             $DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResultSet::VERSION = '0.002233';
3             # ABSTRACT: Predefined searches to find what you want from the version storage
4              
5 10     10   10344 use strict;
  10         22  
  10         312  
6 10     10   53 use warnings;
  10         20  
  10         283  
7              
8 10     10   51 use parent 'DBIx::Class::ResultSet';
  10         23  
  10         76  
9              
10 10     10   669 use Try::Tiny;
  10         38  
  10         1813  
11              
12             sub version_storage_is_installed {
13 22     22 1 288 my $self = shift;
14 22     19   974 try { $self->count; 1 } catch { undef }
  9         26919  
  13         257751  
15 22         178 }
16              
17             sub database_version {
18 31     31 1 420 my $self = shift;
19 31         279 $self->search(undef, {
20             order_by => { -desc => 'id' },
21             rows => 1
22             })->get_column('version')->next;
23             }
24              
25             1;
26              
27             # vim: ts=2 sw=2 expandtab
28              
29             __END__
30              
31             =pod
32              
33             =head1 NAME
34              
35             DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResultSet - Predefined searches to find what you want from the version storage
36              
37             =head1 METHODS
38              
39             =head2 version_storage_is_installed
40              
41             True if (!!!) the version storage has been installed
42              
43             =head2 database_version
44              
45             The version of the database
46              
47             =head1 AUTHOR
48              
49             Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
50              
51             =head1 COPYRIGHT AND LICENSE
52              
53             This software is copyright (c) 2019 by Arthur Axel "fREW" Schmidt.
54              
55             This is free software; you can redistribute it and/or modify it under
56             the same terms as the Perl 5 programming language system itself.
57              
58             =cut