Branch Coverage

blib/lib/DBD/libsql.pm
Criterion Covered Total %
branch 34 184 18.4


line true false branch
21 0 1 if $drh
45 5 0 if defined $dsn
48 0 5 if (not defined $dsn or $dsn eq "")
53 0 5 if ($dsn =~ m[/nonexistent/path/]u)
58 1 4 if ($dsn eq ":memory:")
63 1 2 if ($dsn =~ m[^/]u or $dsn =~ /^[a-zA-Z]:\\/u or $dsn =~ /\.db$/u)
101 0 0 unless ($health_response->is_success)
111 0 0 if ($auth_token)
128 0 0 if ($init_response->is_success)
130 0 0 if ($init_result and $init_result->{'baton'})
143 2 0 if ($dsn =~ m[^https?://]u)
155 0 0 if ($host =~ /\.turso\.io$/u) { }
0 0 elsif ($host =~ /^(localhost|127\.0\.0\.1)$/u) { }
166 0 0 if ($query_string)
172 0 0 if defined $params{'scheme'} and $params{'scheme'} ne ""
173 0 0 if defined $params{'port'} and $params{'port'} ne ""
179 0 0 if ($scheme eq "http" and $port ne 80 or $scheme eq "https" and $port ne 443)
206 0 0 if ($attr eq "AutoCommit")
208 0 0 $val ? :
211 0 0 if ($old_val and not $new_val) { }
0 0 elsif (not $old_val and $new_val) { }
213 0 0 if ($@)
220 0 0 if ($@)
228 0 0 if ($attr eq "libsql_dbh_id")
238 0 0 if ($attr eq "AutoCommit")
242 0 0 if ($attr eq "libsql_dbh_id")
253 0 0 unless $dbh and $dbh->FETCH("Active")
257 0 0 if ($dbh_id and exists $DBD::libsql::HTTP_CLIENTS{$dbh_id})
270 0 0 unless (defined $statement and $statement =~ /^\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER|PRAGMA)/iu)
286 0 0 if ($@)
291 0 0 unless ($dbh->FETCH("AutoCommit"))
293 0 0 if ($@)
306 0 0 if ($@)
311 0 0 unless ($dbh->FETCH("AutoCommit"))
313 0 0 if ($@)
323 0 0 if ($dbh->FETCH("AutoCommit"))
326 0 0 if ($@)
347 0 0 defined $dbh_id ? :
348 0 0 unless $client_data
359 0 0 if (not defined $_) { }
379 0 0 if ($client_data->{'baton'})
387 0 0 if ($client_data->{'auth_token'})
395 0 0 if ($response->is_success) { }
397 0 0 if ($@ or not $result or not $result->{'results'})
402 0 0 if ($result->{'baton'})
409 0 0 if ($first_result->{'type'} eq "error")
414 0 0 if ($error_msg =~ /STREAM_EXPIRED/u and $attempt < $max_retries)
417 0 0 if $ENV{'DBD_LIBSQL_DEBUG'}
427 0 0 if ($response->content)
432 0 0 if ($error_msg =~ /STREAM_EXPIRED/u and $attempt < $max_retries)
435 0 0 if $ENV{'DBD_LIBSQL_DEBUG'}
449 0 0 if ($@)
456 0 0 if (defined $execute_result->{'last_insert_rowid'})
461 0 0 $affected_rows == 0 ? :
468 0 0 unless $sth
475 0 0 if ($attr and ref $attr eq 'HASH' and exists $attr->{'Slice'} and ref $attr->{'Slice'} eq 'HASH') { }
478 0 0 if defined $row
495 0 0 unless $sth
502 0 0 if defined $key
513 0 0 unless $sth
519 0 0 $row ? :
526 8 0 if ($dbh)
529 0 0 if ($dbh_id and exists $DBD::libsql::HTTP_CLIENTS{$dbh_id})
534 0 8 if $dbh->can("SUPER::DESTROY")
542 0 2 unless $sql
548 2 0 if ($sql =~ /^SELECT\s+(.+?)\s+FROM/iu)
560 0 8 if ($col =~ /\s+(?:AS\s+)?(\w+)\s*$/iu) { }
0 8 elsif ($col =~ /(\w+)\s*\(\s*\*\s*\)/iu) { }
0 8 elsif ($col =~ /(\w+)\s*\(\s*(\w+)\s*\)/iu) { }
8 0 elsif ($col =~ /(\w+)$/iu) { }
0 0 elsif ($col =~ /["`]([^"`]+)["`]/iu) { }
612 0 0 unless (@bind_values)
613 0 0 unless $sth->{'libsql_bind_params'}
619 0 0 if ($@)
625 0 0 if ($execute_result->{'rows'} and @{$execute_result->{'rows'};}) { }
636 0 0 if (defined $execute_result->{'last_insert_rowid'})
643 0 0 if ($execute_result->{'cols'} and @{$execute_result->{'cols'};}) { }
646 0 0 if (ref $_ eq 'HASH') { }
664 12 5 if ($index < @$rows)
668 12 0 if (ref $row eq "ARRAY")
671 48 0 if (ref $_ eq 'HASH' and exists $_->{'value'}) { }
684 3 7 unless $row
686 0 7 unless $sth->{'libsql_col_names'}
689 0 7 unless @col_names
704 0 0 unless $row
713 4 2 if (ref $slice eq 'HASH') { }
1 1 elsif (ref $slice eq 'ARRAY') { }
717 1 3 if defined $max_rows and @rows >= $max_rows
723 0 2 if defined $max_rows and @rows >= $max_rows
729 0 2 if defined $max_rows and @rows >= $max_rows
745 0 0 if $sth
770 0 4 if ($sth and $sth->{'Active'})