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.002232';
3             # ABSTRACT: Predefined searches to find what you want from the version storage
4              
5 9     9   10405 use strict;
  9         24  
  9         316  
6 9     9   57 use warnings;
  9         21  
  9         309  
7              
8 9     9   110 use parent 'DBIx::Class::ResultSet';
  9         31  
  9         78  
9              
10 9     9   751 use Try::Tiny;
  9         22  
  9         1875  
11              
12             sub version_storage_is_installed {
13 20     20 1 279 my $self = shift;
14 20     13   1050 try { $self->count; 1 } catch { undef }
  8         27140  
  12         291595  
15 20         170 }
16              
17             sub database_version {
18 25     25 1 400 my $self = shift;
19 25         306 $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