File Coverage

blib/lib/DBD/Gofer/Policy/classic.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
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     10   8303 use strict;
  10         52  
  10         298  
11 10     10   56 use warnings;
  10         19  
  10         575  
12              
13             our $VERSION = "0.010088";
14              
15 10     10   55 use base qw(DBD::Gofer::Policy::Base);
  10         20  
  10         1572  
16              
17             __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             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 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
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.
77              
78             =cut
79