| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Test::DB; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
22832
|
use 5.014; |
|
|
1
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
20
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
22
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use Venus::Class; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
6
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# VERSION |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.10'; |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# AUTHORITY |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:AWNCORP'; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# METHODS |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub build { |
|
21
|
0
|
|
|
0
|
1
|
|
my ($self, %options) = @_; |
|
22
|
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my $type = $self->type($options{database}); |
|
24
|
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
if (lc($type) eq 'sqlite') { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return $self->sqlite(%options); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
elsif (lc($type) eq 'postgres') { |
|
29
|
0
|
|
|
|
|
|
return $self->postgres(%options); |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
elsif (lc($type) eq 'mysql') { |
|
32
|
0
|
|
|
|
|
|
return $self->mysql(%options); |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
elsif (lc($type) eq 'mssql') { |
|
35
|
0
|
|
|
|
|
|
return $self->mssql(%options); |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
else { |
|
38
|
0
|
|
|
|
|
|
return undef; |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub create { |
|
43
|
0
|
|
|
0
|
1
|
|
my ($self, %options) = @_; |
|
44
|
|
|
|
|
|
|
|
|
45
|
0
|
0
|
|
|
|
|
if (my $driver = $self->build(%options)) { |
|
46
|
0
|
|
|
|
|
|
return $driver->create; |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
else { |
|
49
|
0
|
|
|
|
|
|
return undef; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub clone { |
|
54
|
0
|
|
|
0
|
1
|
|
my ($self, %options) = @_; |
|
55
|
|
|
|
|
|
|
|
|
56
|
0
|
0
|
|
|
|
|
if (my $driver = $self->build(%options)) { |
|
57
|
0
|
|
|
|
|
|
return $driver->clone; |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
else { |
|
60
|
0
|
|
|
|
|
|
return undef; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub mssql { |
|
65
|
0
|
|
|
0
|
1
|
|
my ($self, %options) = @_; |
|
66
|
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
require Test::DB::Mssql; |
|
68
|
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
return Test::DB::Mssql->new(%options); |
|
70
|
|
|
|
|
|
|
} |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub mysql { |
|
73
|
0
|
|
|
0
|
1
|
|
my ($self, %options) = @_; |
|
74
|
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
require Test::DB::Mysql; |
|
76
|
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
return Test::DB::Mysql->new(%options); |
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub postgres { |
|
81
|
0
|
|
|
0
|
1
|
|
my ($self, %options) = @_; |
|
82
|
|
|
|
|
|
|
|
|
83
|
0
|
|
|
|
|
|
require Test::DB::Postgres; |
|
84
|
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
return Test::DB::Postgres->new(%options); |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub sqlite { |
|
89
|
0
|
|
|
0
|
1
|
|
my ($self, %options) = @_; |
|
90
|
|
|
|
|
|
|
|
|
91
|
0
|
|
|
|
|
|
require Test::DB::Sqlite; |
|
92
|
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
return Test::DB::Sqlite->new(%options); |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub type { |
|
97
|
0
|
|
|
0
|
0
|
|
my ($self, $name) = @_; |
|
98
|
|
|
|
|
|
|
|
|
99
|
0
|
|
0
|
|
|
|
return $name || $ENV{TESTDB_DATABASE} || 'sqlite'; |
|
100
|
|
|
|
|
|
|
} |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
1; |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 NAME |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Test::DB - Temporary Testing Databases |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 ABSTRACT |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Temporary Databases for Testing |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 VERSION |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
0.10 |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
use Test::DB; |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
my $tdb = Test::DB->new; |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
# my $tdbo = $tdb->create(database => 'sqlite'); |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
# my $dbh = $tdbo->dbh; |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=cut |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
This package provides a framework for setting up and tearing down temporary |
|
139
|
|
|
|
|
|
|
databases for testing purposes. This framework requires a user (optionally with |
|
140
|
|
|
|
|
|
|
password) which has the ability to create new databases and works by creating |
|
141
|
|
|
|
|
|
|
test-specific databases owned by the user specified. B Test databases |
|
142
|
|
|
|
|
|
|
are not automatically destroyed and should be cleaned up manually by call the |
|
143
|
|
|
|
|
|
|
C method on the database-specific test database object. |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head2 process |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
B |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=over 4 |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item #1 |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
Establish a connection to the DB using some "initial" database. |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
my $tdbo = $tdb->postgres(initial => 'template0'); |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item #2 |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Using the established connection, create the test/temporary database. |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
$tdbo->create; |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=item #3 |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
Establish a connection to the newly created test/temporary database. |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
$tdbo->create->dbh; |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=back |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
B |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=over 4 |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item #1 |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
Establish a connection to the DB using the "initial" database. |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
# using the created test/temporary database object |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=item #2 |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Using the established connection, drop the test/temporary database. |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
$tdbo->destroy; |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=back |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head2 usages |
|
190
|
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
B |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=over 4 |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=item #1 |
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
my $tdb = Test::DB->new; |
|
198
|
|
|
|
|
|
|
my $dbh = $tdb->sqlite(%options)->dbh; |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=back |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
B |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=over 4 |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=item #1 |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
my $tdb = Test::DB->new; |
|
209
|
|
|
|
|
|
|
my $tdbo = $tdb->postgres(%options)->create; |
|
210
|
|
|
|
|
|
|
my $schema = DBIx::Class::Schema->connect( |
|
211
|
|
|
|
|
|
|
dsn => $tdbo->dsn, |
|
212
|
|
|
|
|
|
|
username => $tdbo->username, |
|
213
|
|
|
|
|
|
|
password => $tdbo->password, |
|
214
|
|
|
|
|
|
|
); |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=back |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
B |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=over 4 |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=item #1 |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
my $tdb = Test::DB->new; |
|
225
|
|
|
|
|
|
|
my $tdbo = $tdb->mysql(%options)->create; |
|
226
|
|
|
|
|
|
|
my $mysql = Mojo::mysql->new($tdbo->uri); |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=back |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
B |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=over 4 |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=item #1 |
|
235
|
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
my $tdb = Test::DB->new; |
|
237
|
|
|
|
|
|
|
my $tdbo = $tdb->postgres(%options)->create; |
|
238
|
|
|
|
|
|
|
my $postgres = Mojo::Pg->new($tdbo->uri); |
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=back |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
B |
|
243
|
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
=over 4 |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=item #1 |
|
247
|
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
my $tdb = Test::DB->new; |
|
249
|
|
|
|
|
|
|
my $tdbo = $tdb->postgres(%options)->clone('template0'); |
|
250
|
|
|
|
|
|
|
my $postgres = Mojo::Pg->new($tdbo->uri); |
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
=back |
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
B |
|
255
|
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
=over 4 |
|
257
|
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
=item #1 |
|
259
|
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
my $tdb = Test::DB->new; |
|
261
|
|
|
|
|
|
|
my $tdbo = $tdb->sqlite(%options)->create; |
|
262
|
|
|
|
|
|
|
my $sqlite = Mojo::SQLite->new($tdbo->uri); |
|
263
|
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=back |
|
265
|
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
=cut |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
=head1 METHODS |
|
269
|
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
This package provides the following methods: |
|
271
|
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=cut |
|
273
|
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
=head2 clone |
|
275
|
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
clone(Str :$database, Str %options) : Maybe[Object] |
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
The clone method generates a database based on the type and database template |
|
279
|
|
|
|
|
|
|
specified and returns a driver object with an active connection, C and |
|
280
|
|
|
|
|
|
|
C. If the database specified doesn't have a corresponding database driver |
|
281
|
|
|
|
|
|
|
this method will returned the undefined value. The type of database can be |
|
282
|
|
|
|
|
|
|
omitted if the C environment variable is set, if not the type |
|
283
|
|
|
|
|
|
|
of database must be either C, C, C or C. Any |
|
284
|
|
|
|
|
|
|
options provided are passed along to the test database object class |
|
285
|
|
|
|
|
|
|
constructor. |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=over 4 |
|
288
|
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
=item clone example 1 |
|
290
|
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
# given: synopsis |
|
292
|
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
$ENV{TESTDB_DATABASE} = 'postgres'; |
|
294
|
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
$tdb->clone(template => 'template0'); |
|
296
|
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=back |
|
298
|
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
=over 4 |
|
300
|
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=item clone example 2 |
|
302
|
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
# given: synopsis |
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
$ENV{TESTDB_DATABASE} = 'postgres'; |
|
306
|
|
|
|
|
|
|
$ENV{TESTDB_TEMPLATE} = 'template0'; |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
$tdb->clone; |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=back |
|
311
|
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
=over 4 |
|
313
|
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
=item clone example 3 |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
# given: synopsis |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
$ENV{TESTDB_TEMPLATE} = 'template0'; |
|
319
|
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
$tdb->clone(database => 'postgres'); |
|
321
|
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
=back |
|
323
|
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
=cut |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
=head2 create |
|
327
|
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
create(Str :$database, Str %options) : Maybe[Object] |
|
329
|
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
The create method generates a database based on the type specified and returns |
|
331
|
|
|
|
|
|
|
a driver object with an active connection, C and C. If the database |
|
332
|
|
|
|
|
|
|
specified doesn't have a corresponding database driver this method will |
|
333
|
|
|
|
|
|
|
returned the undefined value. The type of database can be omitted if the |
|
334
|
|
|
|
|
|
|
C environment variable is set, if not the type of database |
|
335
|
|
|
|
|
|
|
must be either C, C, C or C. Any options |
|
336
|
|
|
|
|
|
|
provided are passed along to the test database object class constructor. |
|
337
|
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
=over 4 |
|
339
|
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
=item create example 1 |
|
341
|
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
# given: synopsis |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
$tdb->create; |
|
345
|
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
=back |
|
347
|
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
=over 4 |
|
349
|
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
=item create example 2 |
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
# given: synopsis |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
$ENV{TESTDB_DATABASE} = 'sqlite'; |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
$tdb->create; |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=back |
|
359
|
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
=over 4 |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
=item create example 3 |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
# given: synopsis |
|
365
|
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
$tdb->create(database => 'sqlite'); |
|
367
|
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
=back |
|
369
|
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
=cut |
|
371
|
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
=head2 mssql |
|
373
|
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
mssql(Str %options) : Maybe[InstanceOf["Test::DB::Mssql"]] |
|
375
|
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
The mssql method builds and returns a L object. |
|
377
|
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=over 4 |
|
379
|
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
=item mssql example 1 |
|
381
|
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
# given: synopsis |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
$tdb->mssql; |
|
385
|
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
=back |
|
387
|
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
=cut |
|
389
|
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
=head2 mysql |
|
391
|
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
mysql(Str %options) : Maybe[InstanceOf["Test::DB::Mysql"]] |
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
The mysql method builds and returns a L object. |
|
395
|
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
=over 4 |
|
397
|
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
=item mysql example 1 |
|
399
|
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
# given: synopsis |
|
401
|
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
$tdb->mysql; |
|
403
|
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
=back |
|
405
|
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
=cut |
|
407
|
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
=head2 postgres |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
postgres(Str %options) : Maybe[InstanceOf["Test::DB::Postgres"]] |
|
411
|
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
The postgres method builds and returns a L object. |
|
413
|
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
=over 4 |
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
=item postgres example 1 |
|
417
|
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
# given: synopsis |
|
419
|
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
$tdb->postgres; |
|
421
|
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
=back |
|
423
|
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
=cut |
|
425
|
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
=head2 sqlite |
|
427
|
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
sqlite(Str %options) : Maybe[InstanceOf["Test::DB::Sqlite"]] |
|
429
|
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
The sqlite method builds and returns a L object. |
|
431
|
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
=over 4 |
|
433
|
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
=item sqlite example 1 |
|
435
|
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
# given: synopsis |
|
437
|
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
$tdb->sqlite; |
|
439
|
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
=back |
|
441
|
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
=cut |