CPAN-SQLite

 view release on metacpan or  search on metacpan

lib/CPAN/SQLite/META.pm  view on Meta::CPAN

319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
  $CPAN::FrontEnd->myprint("Done!\n");
  return 1;
}
 
sub setup {
  my $obj = CPAN::SQLite->new(setup => 1);
  $obj->index() or die qq{CPAN::SQLite setup failed};
  return;
}
 
sub update {
  my $obj = CPAN::SQLite->new();
  $obj->index() or die qq{CPAN::SQLite update failed};
  return;
}
 
sub check {
  my $obj = CPAN::SQLite->new();
  my $db  = File::Spec->catfile($obj->{'db_dir'}, $obj->{'db_name'});
  my $dbh = DBI->connect("DBI:SQLite:$db", '', '', { 'RaiseError' => 0, 'PrintError' => 0, 'AutoCommit' => 1 });
  if (my $sth = $dbh->prepare('SELECT status FROM info WHERE status = 1')) {

lib/CPAN/SQLite/Populate.pm  view on Meta::CPAN

218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
  $sth->finish();
  undef $sth;
  $dbh->commit() or do {
    $cdbi->db_error();
    $self->{error_msg} = $cdbi->{error_msg};
    return;
  };
  return 1;
}
 
sub update {
  my $self = shift;
  unless ($dbh) {
    $self->{error_msg} = q{No db handle available};
    return;
  }
  my $data = $self->{update};
  my $cdbi = $self->{cdbi};
  unless (has_hash_data($data)) {
    $self->{info_msg} = q{No author data to update};
    return;

lib/CPAN/SQLite/Populate.pm  view on Meta::CPAN

340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
  $sth->finish();
  undef $sth;
  $dbh->commit() or do {
    $cdbi->db_error();
    $self->{error_msg} = $cdbi->{error_msg};
    return;
  };
  return 1;
}
 
sub update {
  my $self = shift;
  unless ($dbh) {
    $self->{error_msg} = q{No db handle available};
    return;
  }
  my $cdbi = $self->{cdbi};
  my $data = $self->{update};
  unless (has_hash_data($data)) {
    $self->{info_msg} = q{No dist data to update};
    return;

lib/CPAN/SQLite/Populate.pm  view on Meta::CPAN

495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
  $sth->finish();
  undef $sth;
  $dbh->commit() or do {
    $cdbi->db_error();
    $self->{error_msg} = $cdbi->{error_msg};
    return;
  };
  return 1;
}
 
sub update {
  my $self = shift;
  unless ($dbh) {
    $self->{error_msg} = q{No db handle available};
    return;
  }
  my $cdbi = $self->{cdbi};
  my $data = $self->{update};
  unless (has_hash_data($data)) {
    $self->{info_msg} = q{No module data to update};
    return;

lib/CPAN/SQLite/Populate.pm  view on Meta::CPAN

631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
  $sth->finish();
  undef $sth;
  $dbh->commit() or do {
    $cdbi->db_error();
    $self->{error_msg} = $cdbi->{error_msg};
    return;
  };
  return 1;
}
 
sub update {
  my $self = shift;
  $self->{'error_msg'} = 'update is not a valid call';
  return;
}
 
sub delete {
  my $self = shift;
  unless ($dbh) {
    $self->{error_msg} = q{No db handle available};
    return;



( run in 0.647 second using v1.01-cache-2.11-cpan-e5176c747c2 )