DBIx/Class/Migration/Sandbox.pm

filter: Statementstmt 85.7% 18 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 82.1% 23 / 28 CC 1 SCAR 1.5
CC
1
Cov
86%
log_die
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« DBIx/Class/Migration/TempDirBuilder.pm ↑ Summary DBIx/Class/Migration/Types.pm »
1 package DBIx::Class::Migration::Sandbox;
2  
3 9 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use Log::Any;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use Carp 'croak';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 9 ▶use DBIx::Class::Migration::Types -all;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 9 has target_dir => (is=>'ro', required=>1);
9 9 has schema_class => (is=>'ro', required=>1);
10  
11 0 ▶sub log_die {
Subroutine log_die: not called CC=1 SCAR=6.9
Pod undocumented
12 0 my ($self, $msg) = @_;
13 0 $self->log->error($msg);
14 0 croak $msg;
15 }
16  
17 has log => (
18 is => 'ro',
19 isa => InstanceOf['Log::Any::Proxy'],
20 12 ▶ default => sub { Log::Any->get_logger( category => 'DBIx::Class::Migration') },
Subroutine __ANON__: called CC=1 SCAR=0.0
21 9 );
22  
23 9 requires 'make_sandbox';
24  
25 9 1;
26  
27 =head1 NAME
28  
29 DBIx::Class::Migration::Sandbox - DB Sandbox Role
30  
31 =head1 SYNOPSIS
32  
33 package MyApp::Schema::Sandbox;
34  
35 use Moo;
36 with 'DBIx::Class::Migration::Sandbox';
37  
38 sub make_sandbox {
39 my ($self) = @_;
40  
41 ## Custom Processing to establish a running database
42  
43 return $dsn, $user, $password;
44 }
45  
46 __PACKAGE__->meta->make_immutable;
47  
48  
49 =head1 DESCRIPTION
50  
51 L<DBIx::Class::Migration> lets you easily create user level sandboxes of
52 your databases, which are suitable for prototyping and development. It comes
53 with support for creating MySQL, Sqlite and Postgresql sandboxes. However you
54 might have custom sandboxing needs. In which you can create a class that does
55 this role.
56  
57 The one required method C<make_sandbox>, should return something we can pass
58 to L<DBIx::Class::Schema/connect>.
59  
60 =head1 SEE ALSO
61  
62 L<DBIx::Class::Migration>, L<DBIx::Class::Migration::SqliteSandbox>,
63 L<DBIx::Class::Migration::MySQLSandbox>,
64 L<DBIx::Class::Migration::PostgresqlSandbox>
65  
66 =head1 AUTHOR
67  
68 See L<DBIx::Class::Migration> for author information
69  
70 =head1 COPYRIGHT & LICENSE
71  
72 See L<DBIx::Class::Migration> for copyright and license information
73  
74 =cut
75  
76  
« DBIx/Class/Migration/TempDirBuilder.pm ↑ Summary DBIx/Class/Migration/Types.pm »