DBIx-Custom / lib / DBI / Custom.pm /
Newer Older
519 lines | 12.763kb
first commit
yuki-kimoto authored on 2009-10-13
1
package DBI::Custom;
2
use Object::Simple;
add test
yuki-kimoto authored on 2009-10-16
3

            
4
our $VERSION = '0.0101';
5

            
6
use Carp 'croak';
add some method
yuki-kimoto authored on 2009-10-14
7
use DBI;
add tests
yuki-kimoto authored on 2009-10-25
8
use DBI::Custom::SQL::Template;
add tests
yuki-kimoto authored on 2009-10-25
9
use DBI::Custom::Result;
cleanup
yuki-kimoto authored on 2009-10-29
10
use DBI::Custom::Query;
add tests
yuki-kimoto authored on 2009-10-25
11

            
12
### Class-Object Accessors
update document
yuki-kimoto authored on 2009-10-27
13
sub user        : ClassObjectAttr { initialize => {clone => 'scalar'} }
14
sub password    : ClassObjectAttr { initialize => {clone => 'scalar'} }
15
sub data_source : ClassObjectAttr { initialize => {clone => 'scalar'} }
add various thins
yuki-kimoto authored on 2009-10-29
16
sub database    : ClassObjectAttr { initialize => {clone => 'scalar'} }
catch up Object::Simple upda...
yuki-kimoto authored on 2009-10-26
17

            
cleanup
yuki-kimoto authored on 2009-10-29
18
sub dbi_options : ClassObjectAttr { initialize => {clone => 'hash', 
update document
yuki-kimoto authored on 2009-10-27
19
                                                  default => sub { {} } } }
catch up Object::Simple upda...
yuki-kimoto authored on 2009-10-26
20

            
update document
yuki-kimoto authored on 2009-10-27
21
sub bind_filter  : ClassObjectAttr { initialize => {clone => 'scalar'} }
22
sub fetch_filter : ClassObjectAttr { initialize => {clone => 'scalar'} }
catch up Object::Simple upda...
yuki-kimoto authored on 2009-10-26
23

            
add various thins
yuki-kimoto authored on 2009-10-29
24
sub no_filters   : ClassObjectAttr { initialize => {clone => 'array'} }
25

            
catch up Object::Simple upda...
yuki-kimoto authored on 2009-10-26
26
sub filters : ClassObjectAttr {
27
    type => 'hash',
28
    deref => 1,
29
    initialize => {
add tests
yuki-kimoto authored on 2009-10-25
30
        clone   => 'hash',
31
        default => sub { {} }
catch up Object::Simple upda...
yuki-kimoto authored on 2009-10-26
32
    }
33
}
first commit
yuki-kimoto authored on 2009-10-13
34

            
catch up Object::Simple upda...
yuki-kimoto authored on 2009-10-26
35
sub result_class : ClassObjectAttr {
36
    initialize => {
add tests
yuki-kimoto authored on 2009-10-25
37
        clone   => 'scalar',
38
        default => 'DBI::Custom::Result'
catch up Object::Simple upda...
yuki-kimoto authored on 2009-10-26
39
    }
40
}
cleanup
yuki-kimoto authored on 2009-10-14
41

            
catch up Object::Simple upda...
yuki-kimoto authored on 2009-10-26
42
sub sql_template : ClassObjectAttr {
43
    initialize => {
update document
yuki-kimoto authored on 2009-10-27
44
        clone   => sub {$_[0] ? $_[0]->clone : undef},
catch up Object::Simple upda...
yuki-kimoto authored on 2009-10-26
45
        default => sub {DBI::Custom::SQL::Template->new}
46
    }
47
}
cleanup
yuki-kimoto authored on 2009-10-15
48

            
add tests
yuki-kimoto authored on 2009-10-25
49
### Object Accessor
add tests
yuki-kimoto authored on 2009-10-18
50
sub dbh          : Attr {}
add tests
yuki-kimoto authored on 2009-10-25
51

            
52

            
53
### Methods
add various thins
yuki-kimoto authored on 2009-10-29
54

            
add tests
yuki-kimoto authored on 2009-10-25
55
# Add filter
56
sub add_filter {
57
    my $invocant = shift;
58
    
59
    my %old_filters = $invocant->filters;
60
    my %new_filters = ref $_[0] eq 'HASH' ? %{$_[0]} : @_;
61
    $invocant->filters(%old_filters, %new_filters);
update document
yuki-kimoto authored on 2009-10-27
62
    return $invocant;
add tests
yuki-kimoto authored on 2009-10-25
63
}
add various
yuki-kimoto authored on 2009-10-18
64

            
65
# Auto commit
update document
yuki-kimoto authored on 2009-10-27
66
sub _auto_commit {
add various
yuki-kimoto authored on 2009-10-18
67
    my $self = shift;
68
    
69
    croak("Cannot change AutoCommit becouse of not connected")
70
        unless $self->dbh;
71
    
72
    if (@_) {
73
        $self->dbh->{AutoCommit} = $_[0];
74
        return $self;
75
    }
76
    return $self->dbh->{AutoCommit};
77
}
add test
yuki-kimoto authored on 2009-10-16
78

            
add various things
yuki-kimoto authored on 2009-10-17
79
# Connect
add some method
yuki-kimoto authored on 2009-10-14
80
sub connect {
81
    my $self = shift;
update document
yuki-kimoto authored on 2009-10-27
82
    my $data_source = $self->data_source;
83
    my $user        = $self->user;
84
    my $password    = $self->password;
cleanup
yuki-kimoto authored on 2009-10-29
85
    my $dbi_options  = $self->dbi_options;
add test
yuki-kimoto authored on 2009-10-16
86
    
add some method
yuki-kimoto authored on 2009-10-14
87
    my $dbh = DBI->connect(
update document
yuki-kimoto authored on 2009-10-27
88
        $data_source,
89
        $user,
90
        $password,
add some method
yuki-kimoto authored on 2009-10-14
91
        {
92
            RaiseError => 1,
93
            PrintError => 0,
94
            AutoCommit => 1,
cleanup
yuki-kimoto authored on 2009-10-29
95
            %{$dbi_options || {} }
add some method
yuki-kimoto authored on 2009-10-14
96
        }
97
    );
98
    
99
    $self->dbh($dbh);
add various
yuki-kimoto authored on 2009-10-18
100
    return $self;
add some method
yuki-kimoto authored on 2009-10-14
101
}
first commit
yuki-kimoto authored on 2009-10-13
102

            
add tests
yuki-kimoto authored on 2009-10-25
103
# DESTROY
add tests
yuki-kimoto authored on 2009-10-18
104
sub DESTROY {
105
    my $self = shift;
add tests
yuki-kimoto authored on 2009-10-18
106
    $self->disconnect if $self->connected;
add tests
yuki-kimoto authored on 2009-10-18
107
}
108

            
add various things
yuki-kimoto authored on 2009-10-17
109
# Is connected?
110
sub connected {
111
    my $self = shift;
add tests
yuki-kimoto authored on 2009-10-18
112
    return exists $self->{dbh} && eval {$self->{dbh}->can('prepare')};
add various things
yuki-kimoto authored on 2009-10-17
113
}
114

            
115
# Disconnect
116
sub disconnect {
117
    my $self = shift;
add tests
yuki-kimoto authored on 2009-10-18
118
    if ($self->connected) {
add various things
yuki-kimoto authored on 2009-10-17
119
        $self->dbh->disconnect;
120
        delete $self->{dbh};
121
    }
122
}
123

            
124
# Reconnect
125
sub reconnect {
126
    my $self = shift;
add tests
yuki-kimoto authored on 2009-10-18
127
    $self->disconnect if $self->connected;
add various things
yuki-kimoto authored on 2009-10-17
128
    $self->connect;
129
}
130

            
try various
yuki-kimoto authored on 2009-10-21
131
# Run tranzaction
132
sub run_tranzaction {
133
    my ($self, $tranzaction) = @_;
134
    
update document
yuki-kimoto authored on 2009-10-27
135
    $self->_auto_commit(0);
try various
yuki-kimoto authored on 2009-10-21
136
    
137
    eval {
138
        $tranzaction->();
139
        $self->dbh->commit;
140
    };
141
    
142
    if ($@) {
143
        my $tranzaction_error = $@;
144
        
145
        $self->dbh->rollback or croak("$@ and rollback also failed");
146
        croak("$tranzaction_error");
147
    }
update document
yuki-kimoto authored on 2009-10-27
148
    $self->_auto_commit(1);
add tests
yuki-kimoto authored on 2009-10-18
149
}
150

            
add various thins
yuki-kimoto authored on 2009-10-29
151
sub create_query {
152
    my ($self, $template) = @_;
add test
yuki-kimoto authored on 2009-10-17
153
    
add various thins
yuki-kimoto authored on 2009-10-29
154
    # Create query from SQL template
155
    my $query = $self->sql_template->create_query($template);
add test
yuki-kimoto authored on 2009-10-17
156
    
add various thins
yuki-kimoto authored on 2009-10-29
157
    # Create Query object;
cleanup
yuki-kimoto authored on 2009-10-29
158
    $query = DBI::Custom::Query->new($query);
add various thins
yuki-kimoto authored on 2009-10-29
159
    
160
    # connect if not
161
    $self->connect unless $self->connected;
try varioud way
yuki-kimoto authored on 2009-10-17
162
    
add various thins
yuki-kimoto authored on 2009-10-29
163
    # Prepare statement handle
164
    my $sth = $self->dbh->prepare($query->{sql});
add tests
yuki-kimoto authored on 2009-10-18
165
    
add various thins
yuki-kimoto authored on 2009-10-29
166
    $query->sth($sth);
add tests
yuki-kimoto authored on 2009-10-18
167
    
add various thins
yuki-kimoto authored on 2009-10-29
168
    return $query;
169
}
170

            
171
sub execute {
172
    my ($self, $query, $params)  = @_;
add tests
yuki-kimoto authored on 2009-10-29
173
    $params ||= {};
try varioud way
yuki-kimoto authored on 2009-10-17
174
    
add various thins
yuki-kimoto authored on 2009-10-29
175
    # Create query if First argument is template
176
    if (!ref $query) {
177
        my $template = $query;
cleanup
yuki-kimoto authored on 2009-10-29
178
        $query = $self->create_query($template);
add various thins
yuki-kimoto authored on 2009-10-29
179
    }
add tests
yuki-kimoto authored on 2009-10-18
180
    
add various thins
yuki-kimoto authored on 2009-10-29
181
    # Set bind filter
182
    $query->bind_filter($self->bind_filter) unless $query->bind_filter;
add tests
yuki-kimoto authored on 2009-10-18
183
    
add various thins
yuki-kimoto authored on 2009-10-29
184
    # Set no filter keys
185
    $query->no_filters($self->no_filters) unless $query->no_filters;
add tests
yuki-kimoto authored on 2009-10-18
186
    
add various thins
yuki-kimoto authored on 2009-10-29
187
    # Create bind value
188
    my $bind_values = $self->_build_bind_values($query, $params);
add tests
yuki-kimoto authored on 2009-10-18
189
    
cleanup
yuki-kimoto authored on 2009-10-18
190
    # Execute
cleanup
yuki-kimoto authored on 2009-10-29
191
    my $sth = $query->sth;
192
    my $ret_val = $sth->execute(@$bind_values);
add various things
yuki-kimoto authored on 2009-10-17
193
    
cleanup
yuki-kimoto authored on 2009-10-18
194
    # Return resultset if select statement is executed
add various things
yuki-kimoto authored on 2009-10-17
195
    if ($sth->{NUM_OF_FIELDS}) {
196
        my $result_class = $self->result_class;
add various
yuki-kimoto authored on 2009-10-18
197
        my $result = $result_class->new({
198
            sth => $sth,
199
            fetch_filter => $self->fetch_filter
200
        });
add various things
yuki-kimoto authored on 2009-10-17
201
        return $result;
202
    }
add tests
yuki-kimoto authored on 2009-10-18
203
    return $ret_val;
add test
yuki-kimoto authored on 2009-10-17
204
}
205

            
add various thins
yuki-kimoto authored on 2009-10-29
206
sub _build_bind_values {
207
    my ($self, $query, $params) = @_;
cleanup
yuki-kimoto authored on 2009-10-29
208
    
209
    my $key_infos      = $query->key_infos;
210
    my $bind_filter    = $query->bind_filter;
211
    my $no_filters_map = $query->_no_filters_map || {};
cleanup
yuki-kimoto authored on 2009-10-18
212
    
add various thins
yuki-kimoto authored on 2009-10-29
213
    # binding values
214
    my @bind_values;
cleanup
yuki-kimoto authored on 2009-10-18
215
    
add various thins
yuki-kimoto authored on 2009-10-29
216
    # Filter and sdd bind values
cleanup
yuki-kimoto authored on 2009-10-29
217
    foreach my $key_info (@$key_infos) {
218
        my $filtering_key = $key_info->{key};
219
        my $access_keys = $key_info->{access_keys};
add various thins
yuki-kimoto authored on 2009-10-29
220
        
cleanup
yuki-kimoto authored on 2009-10-29
221
        my $original_key = $key_info->{original_key} || '';
222
        my $table        = $key_info->{table}        || '';
223
        my $column       = $key_info->{column}       || '';
add various thins
yuki-kimoto authored on 2009-10-29
224
        
225
        ACCESS_KEYS :
226
        foreach my $access_key (@$access_keys) {
227
            my $root_params = $params;
228
            for (my $i = 0; $i < @$access_key; $i++) {
229
                my $key = $access_key->[$i];
230
                
231
                croak("'access_keys' each value must be string or array reference")
232
                  unless (ref $key eq 'ARRAY' || ($key && !ref $key));
233
                
234
                if ($i == @$access_key - 1) {
235
                    if (ref $key eq 'ARRAY') {
236
                        if ($bind_filter && !$no_filters_map->{$original_key}) {
237
                            push @bind_values, $bind_filter->($root_params->[$key->[0]], $original_key, $table, $column);
238
                        }
239
                        else {
240
                            push @bind_values, scalar $root_params->[$key->[0]];
241
                        }
242
                    }
243
                    else {
244
                        next ACCESS_KEYS unless exists $root_params->{$key};
245
                        if ($bind_filter && !$no_filters_map->{$original_key}) {
246
                            push @bind_values, scalar $bind_filter->($root_params->{$key}, $original_key, $table, $column);
247
                        }
248
                        else {
249
                            push @bind_values, scalar $root_params->{$key};
250
                        }
251
                    }
252
                    return @bind_values;
253
                }
254
                
255
                if ($key eq 'ARRAY') {
256
                    $root_params = $root_params->[$key->[0]];
257
                }
258
                else {
259
                    next ACCESS_KEYS unless exists $root_params->{$key};
260
                    $root_params = $root_params->{$key};
261
                }
262
            }
263
        }
264
        croak("Cannot find key");
update document
yuki-kimoto authored on 2009-10-27
265
    }
add test
yuki-kimoto authored on 2009-10-17
266
}
267

            
add various thins
yuki-kimoto authored on 2009-10-29
268

            
add test
yuki-kimoto authored on 2009-10-17
269
Object::Simple->build_class;
270

            
first commit
yuki-kimoto authored on 2009-10-13
271
=head1 NAME
272

            
add test
yuki-kimoto authored on 2009-10-17
273
DBI::Custom - Customizable simple DBI
first commit
yuki-kimoto authored on 2009-10-13
274

            
275
=head1 VERSION
276

            
add test
yuki-kimoto authored on 2009-10-16
277
Version 0.0101
first commit
yuki-kimoto authored on 2009-10-13
278

            
279
=cut
280

            
281
=head1 SYNOPSIS
282

            
add test
yuki-kimoto authored on 2009-10-16
283
  my $dbi = DBI::Custom->new;
add various thins
yuki-kimoto authored on 2009-10-29
284
  
285
  my $query = $dbi->create_query($template);
286
  $dbi->execute($query);
first commit
yuki-kimoto authored on 2009-10-13
287

            
update document
yuki-kimoto authored on 2009-10-27
288
=head1 CLASS-OBJECT ACCESSORS
first commit
yuki-kimoto authored on 2009-10-13
289

            
update document
yuki-kimoto authored on 2009-10-27
290
=head2 user
291

            
292
    # Set and get database user name
293
    $self = $dbi->user($user);
294
    $user = $dbi->user;
295
    
296
    # Sample
297
    $dbi->user('taro');
298

            
299
=head2 password
300

            
301
    # Set and get database password
302
    $self     = $dbi->password($password);
303
    $password = $dbi->password;
304
    
305
    # Sample
306
    $dbi->password('lkj&le`@s');
307

            
308
=head2 data_source
309

            
310
    # Set and get database data source
311
    $self        = $dbi->data_source($data_soruce);
312
    $data_source = $dbi->data_source;
313
    
314
    # Sample(SQLite)
315
    $dbi->data_source(dbi:SQLite:dbname=$database);
316
    
317
    # Sample(MySQL);
318
    $dbi->data_source("dbi:mysql:dbname=$database");
319
    
320
    # Sample(PostgreSQL)
321
    $dbi->data_source("dbi:Pg:dbname=$database");
cleanup
yuki-kimoto authored on 2009-10-29
322
    
323
=head2 database
324

            
325
    # Set and get database name
326
    $self     = $dbi->database($database);
327
    $database = $dbi->database;
update document
yuki-kimoto authored on 2009-10-27
328

            
cleanup
yuki-kimoto authored on 2009-10-29
329
=head2 dbi_options
update document
yuki-kimoto authored on 2009-10-27
330

            
331
    # Set and get DBI option
cleanup
yuki-kimoto authored on 2009-10-29
332
    $self       = $dbi->dbi_options({$options => $value, ...});
333
    $dbi_options = $dbi->dbi_options;
update document
yuki-kimoto authored on 2009-10-27
334

            
335
    # Sample
cleanup
yuki-kimoto authored on 2009-10-29
336
    $dbi->dbi_options({PrintError => 0, RaiseError => 1});
update document
yuki-kimoto authored on 2009-10-27
337

            
cleanup
yuki-kimoto authored on 2009-10-29
338
dbi_options is used when you connect database by using connect.
update document
yuki-kimoto authored on 2009-10-27
339

            
340
=head2 sql_template
341

            
342
    # Set and get SQL::Template object
343
    $self         = $dbi->sql_template($sql_template);
344
    $sql_template = $dbi->sql_template;
345
    
346
    # Sample
347
    $dbi->sql_template(DBI::Cutom::SQL::Template->new);
348

            
349
=head2 filters
350

            
351
    # Set and get filters
352
    $self    = $dbi->filters($filters);
353
    $filters = $dbi->filters;
first commit
yuki-kimoto authored on 2009-10-13
354

            
add test
yuki-kimoto authored on 2009-10-16
355
=head2 bind_filter
first commit
yuki-kimoto authored on 2009-10-13
356

            
update document
yuki-kimoto authored on 2009-10-27
357
    # Set and get binding filter
358
    $self        = $dbi->bind_filter($bind_filter);
359
    $bind_filter = $dbi->bind_filter
first commit
yuki-kimoto authored on 2009-10-13
360

            
update document
yuki-kimoto authored on 2009-10-27
361
    # Sample
362
    $dbi->bind_filter($self->filters->{default_bind_filter});
363
    
first commit
yuki-kimoto authored on 2009-10-13
364

            
update document
yuki-kimoto authored on 2009-10-27
365
you can get DBI database handle if you need.
first commit
yuki-kimoto authored on 2009-10-13
366

            
add test
yuki-kimoto authored on 2009-10-16
367
=head2 fetch_filter
first commit
yuki-kimoto authored on 2009-10-13
368

            
update document
yuki-kimoto authored on 2009-10-27
369
    # Set and get Fetch filter
370
    $self         = $dbi->fetch_filter($fetch_filter);
371
    $fetch_filter = $dbi->fetch_filter;
first commit
yuki-kimoto authored on 2009-10-13
372

            
update document
yuki-kimoto authored on 2009-10-27
373
    # Sample
374
    $dbi->fetch_filter($self->filters->{default_fetch_filter});
add test
yuki-kimoto authored on 2009-10-16
375

            
cleanup
yuki-kimoto authored on 2009-10-29
376
=head2 no_filters
377

            
378
    # Set and get no filter keys
379
    $self       = $dbi->no_filters($no_filters);
380
    $no_filters = $dbi->no_filters;
381

            
update document
yuki-kimoto authored on 2009-10-27
382
=head2 result_class
first commit
yuki-kimoto authored on 2009-10-13
383

            
update document
yuki-kimoto authored on 2009-10-27
384
    # Set and get resultset class
385
    $self         = $dbi->result_class($result_class);
386
    $result_class = $dbi->result_class;
387
    
388
    # Sample
389
    $dbi->result_class('DBI::Custom::Result');
add test
yuki-kimoto authored on 2009-10-17
390

            
update document
yuki-kimoto authored on 2009-10-27
391
=head2 dbh
add test
yuki-kimoto authored on 2009-10-17
392

            
update document
yuki-kimoto authored on 2009-10-27
393
    # Get database handle
394
    $dbh = $self->dbh;
add test
yuki-kimoto authored on 2009-10-17
395

            
update document
yuki-kimoto authored on 2009-10-27
396
=head1 METHODS
add tests
yuki-kimoto authored on 2009-10-18
397

            
update document
yuki-kimoto authored on 2009-10-27
398
=head2 connect
399

            
400
    # Connect to database
401
    $self = $dbi->connect;
402
    
403
    # Sample
404
    $dbi = DBI::Custom->new(user => 'taro', password => 'lji8(', 
405
                            data_soruce => "dbi:mysql:dbname=$database");
406
    $dbi->connect;
add tests
yuki-kimoto authored on 2009-10-18
407

            
408
=head2 disconnect
409

            
update document
yuki-kimoto authored on 2009-10-27
410
    # Disconnect database
411
    $dbi->disconnect;
412

            
413
If database is already disconnected, this method do noting.
414

            
add tests
yuki-kimoto authored on 2009-10-18
415
=head2 reconnect
416

            
update document
yuki-kimoto authored on 2009-10-27
417
    # Reconnect
418
    $dbi->reconnect;
419

            
420
=head2 connected
421

            
422
    # Check connected
423
    $dbi->connected
424

            
425
=head2 add_filter
426

            
427
    # Add filter (hash ref or hash can be recieve)
428
    $self = $dbi->add_filter({$filter_name => $filter, ...});
429
    $self = $dbi->add_filter($filetr_name => $filter, ...);
430
    
431
    # Sample
432
    $dbi->add_filter(
433
        decode_utf8 => sub {
434
            my $value = shift;
435
            return Encode::decode('UTF-8', $value);
436
        },
437
        datetime_to_string => sub {
438
            my $value = shift;
439
            return $value->strftime('%Y-%m-%d %H:%M:%S')
440
        },
441
        default_bind_filter => sub {
442
            my ($value, $key, $filters) = @_;
443
            if (ref $value eq 'Time::Piece') {
444
                return $filters->{datetime_to_string}->($value);
445
            }
446
            else {
447
                return $filters->{decode_utf8}->($value);
448
            }
449
        },
450
        
451
        encode_utf8 => sub {
452
            my $value = shift;
453
            return Encode::encode('UTF-8', $value);
454
        },
455
        string_to_datetime => sub {
456
            my $value = shift;
457
            return DateTime::Format::MySQL->parse_datetime($value);
458
        },
459
        default_fetch_filter => sub {
460
            my ($value, $key, $filters, $type, $sth, $i) = @_;
461
            if ($type eq 'DATETIME') {
462
                return $self->filters->{string_to_datetime}->($value);
463
            }
464
            else {
465
                return $self->filters->{encode_utf8}->($value);
466
            }
467
        }
468
    );
469

            
470
add_filter add filter to filters
add tests
yuki-kimoto authored on 2009-10-18
471

            
cleanup
yuki-kimoto authored on 2009-10-29
472
=head2 create_query
473
    
474
    # Create Query object from SQL template
475
    my $query = $dbi->create_query($template);
476
    
477
=head2 execute
update document
yuki-kimoto authored on 2009-10-27
478

            
479
    # Parse SQL template and execute SQL
cleanup
yuki-kimoto authored on 2009-10-29
480
    $result = $dbi->query($query, $params);
481
    $result = $dbi->query($template, $params); # Shorcut
update document
yuki-kimoto authored on 2009-10-27
482
    
483
    # Sample
484
    $result = $dbi->query("select * from authors where {= name} && {= age}", 
485
                          {author => 'taro', age => 19});
486
    
487
    while (my @row = $result->fetch) {
488
        # do something
489
    }
490

            
491
See also L<DBI::Custom::SQL::Template>
492

            
cleanup
yuki-kimoto authored on 2009-10-22
493
=head2 run_tranzaction
first commit
yuki-kimoto authored on 2009-10-13
494

            
update document
yuki-kimoto authored on 2009-10-27
495
    # Run tranzaction
496
    $dbi->run_tranzaction(sub {
497
        # do something
498
    });
first commit
yuki-kimoto authored on 2009-10-13
499

            
update document
yuki-kimoto authored on 2009-10-27
500
If tranzaction is success, commit is execute. 
501
If tranzation is died, rollback is execute.
first commit
yuki-kimoto authored on 2009-10-13
502

            
cleanup
yuki-kimoto authored on 2009-10-29
503

            
504

            
add various
yuki-kimoto authored on 2009-10-18
505
=head1 AUTHOR
first commit
yuki-kimoto authored on 2009-10-13
506

            
add various
yuki-kimoto authored on 2009-10-18
507
Yuki Kimoto, C<< <kimoto.yuki at gmail.com> >>
first commit
yuki-kimoto authored on 2009-10-13
508

            
509
=head1 COPYRIGHT & LICENSE
510

            
511
Copyright 2009 Yuki Kimoto, all rights reserved.
512

            
513
This program is free software; you can redistribute it and/or modify it
514
under the same terms as Perl itself.
515

            
516

            
517
=cut
518

            
519
1; # End of DBI::Custom