1DBIx::Connector::DriverU(s3e)r Contributed Perl DocumentaDtBiIoxn::Connector::Driver(3)
2
3
4
6 DBIx::Connector::Driver - Database-specific connection interface
7
9 Some of the things that DBIx::Connector does are implemented
10 differently by different drivers, or the official interface provided by
11 the DBI may not be implemented for a particular driver. The driver-
12 specific code therefore is encapsulated in this separate driver class.
13
14 Most of the DBI drivers work uniformly, so in most cases the
15 implementation provided here in DBIx::Connector::Driver will work just
16 fine. It's only when something is different that a driver subclass
17 needs to be added. In such a case, the subclass's name is the same as
18 the DBI driver. For example the driver for DBD::Pg is
19 DBIx::Connector::Driver::Pg and the driver for DBD::mysql is
20 DBIx::Connector::Driver::mysql.
21
22 If you're just a user of DBIx::Connector, you can ignore the driver
23 classes. DBIx::Connector uses them internally to do its magic, so you
24 needn't worry about them.
25
27 In case you need to implement a driver, here's the interface you can
28 modify.
29
30 Constructor
31 "new"
32
33 my $driver = DBIx::Connector::Driver->new( $driver );
34
35 Constructs and returns a driver object. Each driver class is
36 implemented as a singleton, so the same driver object is always
37 returned for the same driver. The "driver" parameter should be a Perl
38 DBI driver name, such as "Pg" for DBD::Pg or "SQLite" for DBD::SQLite.
39 If a subclass has been defined for $driver, then the object will be of
40 that class. Otherwise it will be an instance of the driver base class.
41
42 Instance Methods
43 "ping"
44
45 $driver->ping($dbh);
46
47 Calls "$dbh->ping". Override if for some reason the DBI driver doesn't
48 do it right.
49
50 "begin_work"
51
52 $driver->begin_work($dbh);
53
54 Calls "$dbh->begin_work". Override if for some reason the DBI driver
55 doesn't do it right.
56
57 "commit"
58
59 $driver->commit($dbh);
60
61 Calls "$dbh->commit". Override if for some reason the DBI driver
62 doesn't do it right.
63
64 "rollback"
65
66 $driver->rollback($dbh);
67
68 Calls "$dbh->rollback". Override if for some reason the DBI driver
69 doesn't do it right.
70
71 "savepoint"
72
73 $driver->savepoint($dbh, $name);
74
75 A no-op. Override if your database does in fact support savepoints. The
76 driver subclass should create a savepoint with the given $name. See the
77 implementations in DBIx::Connector::Driver::Pg and
78 DBIx::Connector::Driver::Oracle for examples.
79
80 "release"
81
82 $driver->release($dbh, $name);
83
84 A no-op. Override if your database does in fact support savepoints. The
85 driver subclass should release the savepoint with the given $name. See
86 the implementations in DBIx::Connector::Driver::Pg and
87 DBIx::Connector::Driver::Oracle for examples.
88
89 "rollback_to"
90
91 $driver->rollback_to($dbh, $name);
92
93 A no-op. Override if your database does in fact support savepoints. The
94 driver subclass should rollback to the savepoint with the given $name.
95 See the implementations in DBIx::Connector::Driver::Pg and
96 DBIx::Connector::Driver::Oracle for examples.
97
99 This module was written by:
100
101 David E. Wheeler <david@kineticode.com>
102
103 It is based on code written by:
104
105 Matt S. Trout <mst@shadowcatsystems.co.uk>
106 Peter Rabbitson <rabbit+dbic@rabbit.us>
107
109 Copyright (c) 2009-2013 David E. Wheeler. Some Rights Reserved.
110
111 This module is free software; you can redistribute it and/or modify it
112 under the same terms as Perl itself.
113
114
115
116perl v5.34.0 2022-01-21 DBIx::Connector::Driver(3)