add Oracle, DB2, Pg,
|
1 |
package DBIx::Custom::Pg; |
packaging one directory
|
2 |
use base 'DBIx::Custom::Basic'; |
3 | ||
4 |
use warnings; |
|
5 |
use strict; |
|
6 | ||
7 |
my $class = __PACKAGE__; |
|
8 | ||
9 | ||
10 |
sub connect { |
|
11 |
my $self = shift; |
|
12 |
|
|
13 |
if (!$self->data_source && (my $database = $self->database)) { |
|
add Oracle, DB2, Pg,
|
14 |
$self->data_source("dbi:Pg:dbname=$database"); |
packaging one directory
|
15 |
} |
16 |
|
|
17 |
return $self->SUPER::connect; |
|
18 |
} |
|
19 | ||
20 |
=head1 NAME |
|
21 | ||
add Oracle, DB2, Pg,
|
22 |
DBIx::Custom::Pg - DBIx::Custom PostgreSQL implementation |
packaging one directory
|
23 | |
24 |
=head1 Synopsys |
|
25 | ||
26 |
=head1 See DBIx::Custom and DBI::Custom::Basic documentation |
|
27 | ||
28 |
This class is L<DBIx::Custom::Basic> subclass, |
|
29 |
and L<DBIx::Custom::Basic> is L<DBIx::Custom> subclass. |
|
30 | ||
31 |
You can use all methods of L<DBIx::Custom::Basic> and <DBIx::Custom> |
|
32 |
Please see L<DBIx::Custom::Basic> and <DBIx::Custom> documentation. |
|
33 | ||
34 |
=head1 Object methods |
|
35 | ||
36 |
=head2 connect |
|
37 | ||
38 |
This method override DBIx::Custom::connect |
|
39 |
|
|
40 |
If database attribute is set, automatically data source is created and connect |
|
41 | ||
add Oracle, DB2, Pg,
|
42 |
=head2 last_insert_id |
43 | ||
packaging one directory
|
44 |
=head1 Author |
45 | ||
46 |
Yuki Kimoto, C<< <kimoto.yuki at gmail.com> >> |
|
47 | ||
48 |
Github L<http://github.com/yuki-kimoto> |
|
49 | ||
50 |
I develope this module L<http://github.com/yuki-kimoto/DBIx-Custom> |
|
51 | ||
52 |
=head1 Copyright & license |
|
53 | ||
54 |
Copyright 2009 Yuki Kimoto, all rights reserved. |
|
55 | ||
56 |
This program is free software; you can redistribute it and/or modify it |
|
57 |
under the same terms as Perl itself. |
|
58 | ||
59 |