DB2.pm

filter: Statementstmt 78.5% 11 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 78.9% 15 / 19 CC 1 SCAR 2.2
CC
1
Cov
79%
connection
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« DB2/Introspect.pm ↑ Summary DB2/Diff/ForeignKey.pm »
1 package DBIO::DB2;
2 1 our $VERSION = '0.900001';
3  
4  
5 # ABSTRACT: IBM DB2-specific schema management for DBIO
6  
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use base 'DBIO::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12  
13 0 ▶sub connection {
Subroutine connection: not called CC=1 SCAR=6.9
Pod documented
14 0 my ($self, @info) = @_;
15 0 $self->storage_type('+DBIO::DB2::Storage');
16 0 return $self->next::method(@info);
17 }
18  
19  
20  
21 1 1;
22  
23 __END__
24  
25 =pod
26  
27 =encoding UTF-8
28  
29 =head1 NAME
30  
31 DBIO::DB2 - IBM DB2-specific schema management for DBIO
32  
33 =head1 VERSION
34  
35 version 0.900001
36  
37 =head1 SYNOPSIS
38  
39 package MySchema;
40 use DBIO Schema => -db2;
41  
42 # ... elsewhere ...
43 my $schema = MySchema->connect($dsn, $user, $pass);
44 # Storage is automatically set to DBIO::DB2::Storage
45  
46 =head1 DESCRIPTION
47  
48 This class is a thin L<DBIO> subclass that automatically sets the storage
49 class to L<DBIO::DB2::Storage> when a connection is established. Load it
50 into your schema instead of the base L<DBIO> class when connecting to IBM
51 DB2 databases.
52  
53 The C<-db2> shortcut shown above (see L<DBIO::Shortcut::db2>) pins the DB2
54 storage driver onto your schema class without naming the storage class by
55 hand. It is equivalent to loading this class as a schema component.
56  
57 =head1 METHODS
58  
59 =head2 connection
60  
61 $schema->connection($dsn, $user, $pass, \%attrs);
62  
63 Sets the storage type to L<DBIO::DB2::Storage> before delegating to the
64 parent C<connection> method.
65  
66 =head1 SEE ALSO
67  
68 =over
69  
70 =item * L<DBIO::DB2::Storage> - DB2 storage implementation
71  
72 =item * L<DBIO> - Base ORM class
73  
74 =back
75  
76 =head1 AUTHOR
77  
78 DBIO & DBIx::Class Authors
79  
80 =head1 COPYRIGHT AND LICENSE
81  
82 Copyright (C) 2026 DBIO Authors
83 Portions Copyright (C) 2005-2025 DBIx::Class Authors
84 Based on DBIx::Class, heavily modified.
85  
86 This is free software; you can redistribute it and/or modify it under
87 the same terms as the Perl 5 programming language system itself.
88  
89 =cut
« DB2/Introspect.pm ↑ Summary DB2/Diff/ForeignKey.pm »