Acrux-DBI

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

sub init {
    my $self = shift->connect_cached;

    my $is_new = 0;
    my $dbh = $self->dbh;
    if (defined($dbh)) {
        if ($self->is_sqlite) {
            my $file = $dbh->sqlite_db_filename();
            unless ($file && (-e $file) && !(-z $file)) {
                touch($file);
                chmod(0666, $file);
                $is_new = 1;
            }
        } elsif ($self->is_mysql) {
            if (my $res = $self->query("SHOW TABLES FROM
            `" . $self->database() . "` LIKE 'altair'")) {
                $is_new = 1 if is_void($res->array);
            }
        }
    }



( run in 1.564 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )