| 1 | package DBIO::DuckDB::Extension; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: The extension class of a DuckDB extension without rules | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 36 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 36 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 36 | our $VERSION = '0.900007'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 36 | ▶ | use base 'DBIO::Extension'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 36 | ▶ | use DBIO::Extension::List (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 5 | ▶ | sub extension_interface { 1 } | ||||||||||||||||||||||||||
|
Subroutine
extension_interface: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 4 | ▶ | sub driver { 'DBIO::DuckDB' } | ||||||||||||||||||||||||||
|
Subroutine
driver: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 1 | ▶ | sub activation { | ||||||||||||||||||||||||||
|
Subroutine
activation: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 21 | 1 | my ($class, $ctx) = @_; | |||||||||||||||||||||||||||
| 22 | 1 | return { load => $ctx->{self}{name} }; | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 4 | ▶ | sub family_class { return } | ||||||||||||||||||||||||||
|
Subroutine
family_class: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 11 | ▶ | sub resolve_list { | ||||||||||||||||||||||||||
|
Subroutine
resolve_list: called CC=8 SCAR=20.8
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 11 | my ($class, $schema, %opt) = @_; | |||||||||||||||||||||||||||
| 31 | 11 | ▶ | return undef unless $schema && $schema->can('duckdb_extensions'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$schema and $schema->can("duckdb_extensions")
MC/DC50%1/2
$schema and $schema->can("duckdb_extensions")
$schema
$schema->can("duckdb_extensions")
Truth table66%2/3
A and B
A= $schemaB= $schema->can("duckdb_extensions")
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 10 | my $classes = $schema->duckdb_extension_classes; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 10 | my @declaration; | |||||||||||||||||||||||||||
| 36 | 10 | for my $name ($schema->duckdb_extensions) { | |||||||||||||||||||||||||||
| 37 | 9 | ▶ | push @declaration, $name, (defined $classes->{$name} ? { class => $classes->{$name} } : ()); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | 10 | ▶ | return undef unless @declaration; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | my $list = DBIO::Extension::List->new( | ||||||||||||||||||||||||||||
| 42 | declaration => \@declaration, | ||||||||||||||||||||||||||||
| 43 | 3 | ▶ | class_table => sub { $class->family_class($_[0]) }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 44 | 7 | plain_class => __PACKAGE__, | |||||||||||||||||||||||||||
| 45 | ); | ||||||||||||||||||||||||||||
| 46 | 5 | ▶ | $list->check_driver('DBIO::DuckDB') if $opt{check_driver} // 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$opt{"check_driver"} // 1
MC/DC100%1/1
$opt{"check_driver"} // 1
$opt{"check_driver"}
Truth table100%2/2
A
A= $opt{"check_driver"}
| |||||||||||||||||||||||||||||
| 47 | 4 | return $list; | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 36 | 1; | |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||||||||||