1Test::Database::Handle(U3s)er Contributed Perl DocumentatTieosnt::Database::Handle(3)
2
3
4
6 Test::Database::Handle - A class for Test::Database handles
7
9 use Test::Database;
10
11 my $handle = Test::Database->handle(@requests);
12 my $dbh = $handle->dbh();
13
15 "Test::Database::Handle" is a very simple class for encapsulating the
16 information about a test database handle.
17
18 "Test::Database::Handle" objects are used within a test script to
19 obtain the necessary information about a test database handle. Handles
20 are obtained through the "Test::Database->handles()" or
21 "Test::Database->handle()" methods.
22
24 "Test::Database::Handle" provides the following methods:
25
26 new( %args )
27 Return a new "Test::Database::Handle" with the given parameters
28 ("dsn", "username", "password").
29
30 The only mandatory argument is "dsn".
31
32 The following accessors are available.
33
34 dsn()
35 Return the Data Source Name.
36
37 username()
38 Return the connection username.
39
40 password()
41 Return the connection password.
42
43 connection_info()
44 Return the connection information triplet ("dsn", "username",
45 "password").
46
47 dbh( [ $attr ] )
48 Return the DBI database handle obtained when connecting with the
49 connection triplet returned by "connection_info()".
50
51 The optional parameter $attr is a reference to a hash of connection
52 attributes, passed directly to DBI's "connect()" method.
53
54 name()
55 Return the database name attached to the handle.
56
57 dbd()
58 Return the DBI driver name, as computed from the "dsn".
59
60 driver()
61 Return the "Test::Database::Driver" object attached to the handle.
62
64 Philippe Bruhat (BooK), "<book@cpan.org>"
65
67 Copyright 2008-2010 Philippe Bruhat (BooK), all rights reserved.
68
70 This module is free software; you can redistribute it and/or modify it
71 under the same terms as Perl itself.
72
73
74
75perl v5.12.3 2011-03-15 Test::Database::Handle(3)