App-OverWatch

 view release on metacpan or  search on metacpan

lib/App/OverWatch/DB.pm  view on Meta::CPAN


    return $self;
}

sub type {
    my $self = shift;
    return $self->{Config}->db_type();
}

sub dbix_run {
    my ($self, $sql, @bind_values) = @_;

    my $conn = $self->_dbix_conn();

    return $conn->run(
        ping => sub {
            my $ret = 0;
            try {
                $ret = $_->do( $sql, {}, @bind_values);
            } catch {
                warn "Caught exception: $_\n";
                $ret = 0;
            };
            $ret;
        });
}

sub dbix_select {
    my ($self, $sql, @bind_values) = @_;

    my $conn = $self->_dbix_conn();

    return $conn->run( ping => sub {
                                   my $sth = undef;
                                   try {
                                       $sth = $_->prepare( $sql );
                                       $sth->execute( @bind_values );
                                   } catch {
                                       warn "Caught exception: $_\n";
                                       $sth = undef;
                                   };
                                   $sth;
                               });
}

## Private



( run in 0.845 second using v1.01-cache-2.11-cpan-2398b32b56e )