blib/lib/DBD/Gofer/Policy/classic.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 15 / 15 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/DBI/ProfileSubs.pm ↑ Summary blib/lib/DBD/Gofer/Policy/pedantic.pm »
1 package DBD::Gofer::Policy::classic;
2  
3 # $Id: classic.pm 10087 2007-10-16 12:42:37Z Tim $
4 #
5 # Copyright (c) 2007, Tim Bunce, Ireland
6 #
7 # You may distribute under the terms of either the GNU General Public
8 # License or the Artistic License, as specified in the Perl README file.
9  
10 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 10 our $VERSION = "0.010088";
14  
15 10 ▶use base qw(DBD::Gofer::Policy::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 10 __PACKAGE__->create_policy_subs({
18  
19 # always use connect_cached on server
20 connect_method => 'connect_cached',
21  
22 # use same methods on server as is called on client
23 prepare_method => '',
24  
25 # don't skip the connect check since that also sets dbh attributes
26 # although this makes connect more expensive, that's partly offset
27 # by skip_ping=>1 below, which makes connect_cached very fast.
28 skip_connect_check => 0,
29  
30 # most code doesn't rely on sth attributes being set after prepare
31 skip_prepare_check => 1,
32  
33 # we're happy to use local method if that's the same as the remote
34 skip_default_methods => 1,
35  
36 # ping is not important for DBD::Gofer and most transports
37 skip_ping => 1,
38  
39 # only update dbh attributes on first contact with server
40 dbh_attribute_update => 'first',
41  
42 # we'd like to set locally_* but can't because drivers differ
43  
44 # get_info results usually don't change
45 cache_get_info => 1,
46 });
47  
48  
49 10 1;
50  
51 =head1 NAME
52  
53 DBD::Gofer::Policy::classic - The 'classic' policy for DBD::Gofer
54  
55 =head1 SYNOPSIS
56  
57 $dbh = DBI->connect("dbi:Gofer:transport=...;policy=classic", ...)
58  
59 The C<classic> policy is the default DBD::Gofer policy, so need not be included in the DSN.
60  
61 =head1 DESCRIPTION
62  
63 Temporary docs: See the source code for list of policies and their defaults.
64  
65 In a future version the policies and their defaults will be defined in the pod and parsed out at load-time.
66  
67 =head1 AUTHOR
68  
69 Tim Bunce, L<http://www.tim.bunce.name>
70  
71 =head1 LICENCE AND COPYRIGHT
72  
73 Copyright (c) 2007, Tim Bunce, Ireland. All rights reserved.
74  
75 This module is free software; you can redistribute it and/or
76 modify it under the same terms as Perl itself. See L<perlartistic>.
77  
78 =cut
79  
« blib/lib/DBI/ProfileSubs.pm ↑ Summary blib/lib/DBD/Gofer/Policy/pedantic.pm »