packaging one directory
|
1 |
package DBIx::Custom::SQLite; |
2 | ||
3 |
use strict; |
|
update document
|
4 |
use warnings; |
rename DBIx::Custom::SQLite ...
|
5 | |
update document
|
6 |
use base 'DBIx::Custom'; |
7 | ||
8 |
__PACKAGE__->attr('database'); |
|
9 | ||
packaging one directory
|
10 |
sub connect { |
update document
|
11 |
my $proto = shift; |
12 |
|
|
cleanup
|
13 |
# Create a new object |
update document
|
14 |
my $self = ref $proto ? $proto : $proto->new(@_); |
packaging one directory
|
15 |
|
cleanup
|
16 |
# Data source |
add tests
|
17 |
my $database = $self->database; |
18 |
if (!$self->data_source && $database) { |
|
19 |
$self->data_source("dbi:SQLite:dbname=$database") |
|
packaging one directory
|
20 |
} |
21 |
|
|
22 |
return $self->SUPER::connect; |
|
23 |
} |
|
24 | ||
25 |
sub connect_memory { |
|
removed DESTROY method(not b...
|
26 |
my $self = shift->new(@_); |
packaging one directory
|
27 |
|
cleanup
|
28 |
# Data source |
packaging one directory
|
29 |
$self->data_source('dbi:SQLite:dbname=:memory:'); |
30 |
|
|
cleanup
|
31 |
# Connect to database |
packaging one directory
|
32 |
$self->connect; |
33 |
|
|
34 |
return $self; |
|
35 |
} |
|
36 | ||
removed register_format()
|
37 |
1; |
38 | ||
packaging one directory
|
39 |
=head1 NAME |
40 | ||
cleanup
|
41 |
DBIx::Custom::SQLite - SQLite implementation |
packaging one directory
|
42 | |
deprecated DBIx::Custom::MyS...
|
43 |
=head1 CAUTION |
44 | ||
45 |
B<This module is deprecated now> because This module is not very useful |
|
46 |
I expected. Please use DBIx::Custom instead.> |
|
47 | ||
rename DBIx::Custom::SQLite ...
|
48 |
=head1 SYNOPSYS |
packaging one directory
|
49 | |
50 |
use DBIx::Custom::SQLite; |
|
51 |
|
|
cleanup
|
52 |
# Connect to the database |
removed DESTROY method(not b...
|
53 |
my $dbi = DBIx::Custom::SQLite->connect(database => 'dbname'); |
packaging one directory
|
54 |
|
cleanup
|
55 |
# Connect to the memory database |
update document
|
56 |
my $dbi = DBIx::Custom::SQLite->connect_memory; |
57 |
|
|
removed DESTROY method(not b...
|
58 |
# Get last insert row id |
update document
|
59 |
my $id = $dbi->last_insert_rowid; |
packaging one directory
|
60 |
|
update document
|
61 |
=head1 ATTRIBUTES |
62 | ||
cleanup
|
63 |
L<DBIx::Custom::SQLite> inherits all attributes from L<DBIx::Custom> |
64 |
and implements the following new ones. |
|
update document
|
65 | |
removed DBIx::Custom commit ...
|
66 |
=head2 C<database> |
update document
|
67 | |
cleanup
|
68 |
my $database = $dbi->database; |
cleanup
|
69 |
$dbi = $dbi->database('dbname'); |
packaging one directory
|
70 | |
removed DESTROY method(not b...
|
71 |
Database name. |
cleanup
|
72 |
C<connect()> method use this value to connect the database |
73 |
if C<data_source> is not specified. |
|
removed DESTROY method(not b...
|
74 | |
rename DBIx::Custom::SQLite ...
|
75 |
=head1 METHODS |
packaging one directory
|
76 | |
cleanup
|
77 |
L<DBIx::Custom::SQLite> inherits all methods from L<DBIx::Custom> |
78 |
and implements the following new ones. |
|
packaging one directory
|
79 | |
cleanup
|
80 |
=head2 C<connect> |
removed DESTROY method(not b...
|
81 |
|
cleanup
|
82 |
my $dbi = DBIx::Custom::SQLite->connect(database => 'dbname'); |
packaging one directory
|
83 | |
cleanup
|
84 |
Create a new L<DBIx::Custom::SQLite> object and connect to the database. |
cleanup
|
85 |
This method overrides C<DBIx::Custom::connect()> method. |
cleanup
|
86 |
You can specify all attributes of L<DBIx::Custom> |
87 |
and L<DBIx::Custom::SQLite>, such as C<database>. |
|
packaging one directory
|
88 | |
removed DBIx::Custom commit ...
|
89 |
=head2 C<connect_memory> |
packaging one directory
|
90 | |
cleanup
|
91 |
my $dbi = DBIx::Custom::SQLite->connect_memory; |
packaging one directory
|
92 | |
cleanup
|
93 |
Create a new L<DBIx::Custom::SQLite> object and connect to the memory database. |
add Oracle, DB2, Pg,
|
94 | |
rename DBIx::Custom::SQLite ...
|
95 |
=cut |