DuckDB/Constants.pm

filter: Statementstmt 100% 29 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 97.3% 37 / 38 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« DuckDB/GetInfo.pm ↑ Summary DuckDB/FFI.pm »
1 package DBD::DuckDB::Constants;
2  
3 22 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 22 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 22 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 22 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 22 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 22 our @DUCKDB_TYPES = qw(
11 DUCKDB_TYPE_INVALID
12 DUCKDB_TYPE_BOOLEAN
13 DUCKDB_TYPE_TINYINT
14 DUCKDB_TYPE_SMALLINT
15 DUCKDB_TYPE_INTEGER
16 DUCKDB_TYPE_BIGINT
17 DUCKDB_TYPE_UTINYINT
18 DUCKDB_TYPE_USMALLINT
19 DUCKDB_TYPE_UINTEGER
20 DUCKDB_TYPE_UBIGINT
21 DUCKDB_TYPE_FLOAT
22 DUCKDB_TYPE_DOUBLE
23 DUCKDB_TYPE_TIMESTAMP
24 DUCKDB_TYPE_DATE
25 DUCKDB_TYPE_TIME
26 DUCKDB_TYPE_INTERVAL
27 DUCKDB_TYPE_HUGEINT
28 DUCKDB_TYPE_VARCHAR
29 DUCKDB_TYPE_BLOB
30 DUCKDB_TYPE_DECIMAL
31 DUCKDB_TYPE_TIMESTAMP_S
32 DUCKDB_TYPE_TIMESTAMP_MS
33 DUCKDB_TYPE_TIMESTAMP_NS
34 DUCKDB_TYPE_ENUM
35 DUCKDB_TYPE_LIST
36 DUCKDB_TYPE_STRUCT
37 DUCKDB_TYPE_MAP
38 DUCKDB_TYPE_UUID
39 DUCKDB_TYPE_UNION
40 DUCKDB_TYPE_BIT
41 DUCKDB_TYPE_TIME_TZ
42 DUCKDB_TYPE_TIMESTAMP_TZ
43 DUCKDB_TYPE_UHUGEINT
44 DUCKDB_TYPE_ARRAY
45 DUCKDB_TYPE_ANY
46 DUCKDB_TYPE_BIGNUM
47 DUCKDB_TYPE_SQLNULL
48 DUCKDB_TYPE_STRING_LITERAL
49 DUCKDB_TYPE_INTEGER_LITERAL
50 DUCKDB_TYPE_TIME_NS
51 );
52  
53 22 our @DUCKDB_RESULT_TYPES = qw(
54 DUCKDB_RESULT_TYPE_INVALID
55 DUCKDB_RESULT_TYPE_CHANGED_ROWS
56 DUCKDB_RESULT_TYPE_NOTHING
57 DUCKDB_RESULT_TYPE_QUERY_RESULT
58 );
59  
60 22 our @EXPORT = (@DUCKDB_TYPES, @DUCKDB_RESULT_TYPES);
61  
62 22 our %EXPORT_TAGS = (all => \@EXPORT, duckdb_types => \@DUCKDB_TYPES, duckdb_result_types => \@DUCKDB_RESULT_TYPES);
63  
64 # enum duckdb_type
65 use constant {
66 22 DUCKDB_TYPE_INVALID => 0,
67 DUCKDB_TYPE_BOOLEAN => 1, # bool
68 DUCKDB_TYPE_TINYINT => 2, # int8_t
69 DUCKDB_TYPE_SMALLINT => 3, # int16_t
70 DUCKDB_TYPE_INTEGER => 4, # int32_t
71 DUCKDB_TYPE_BIGINT => 5, # int64_t
72 DUCKDB_TYPE_UTINYINT => 6, # uint8_t
73 DUCKDB_TYPE_USMALLINT => 7, # uint16_t
74 DUCKDB_TYPE_UINTEGER => 8, # uint32_t
75 DUCKDB_TYPE_UBIGINT => 9, # uint64_t
76 DUCKDB_TYPE_FLOAT => 10, # float
77 DUCKDB_TYPE_DOUBLE => 11, # double
78 DUCKDB_TYPE_TIMESTAMP => 12, # duckdb_timestamp (microseconds)
79 DUCKDB_TYPE_DATE => 13, # duckdb_date
80 DUCKDB_TYPE_TIME => 14, # duckdb_time
81 DUCKDB_TYPE_INTERVAL => 15, # duckdb_interval
82 DUCKDB_TYPE_HUGEINT => 16, # duckdb_hugeint
83 DUCKDB_TYPE_VARCHAR => 17, # const char*
84 DUCKDB_TYPE_BLOB => 18, # duckdb_blob
85 DUCKDB_TYPE_DECIMAL => 19, # duckdb_decimal
86 DUCKDB_TYPE_TIMESTAMP_S => 20, # duckdb_timestamp_s (seconds)
87 DUCKDB_TYPE_TIMESTAMP_MS => 21, # duckdb_timestamp_ms (milliseconds)
88 DUCKDB_TYPE_TIMESTAMP_NS => 22, # duckdb_timestamp_ns (nanoseconds)
89 DUCKDB_TYPE_ENUM => 23, # enum type, only useful as logical type
90 DUCKDB_TYPE_LIST => 24, # list type, only useful as logical type
91 DUCKDB_TYPE_STRUCT => 25, # struct type, only useful as logical type
92 DUCKDB_TYPE_MAP => 26, # map type, only useful as logical type
93 DUCKDB_TYPE_UUID => 27, # duckdb_hugeint
94 DUCKDB_TYPE_UNION => 28, # union type, only useful as logical type
95 DUCKDB_TYPE_BIT => 29, # duckdb_bit
96 DUCKDB_TYPE_TIME_TZ => 30, # duckdb_time_tz
97 DUCKDB_TYPE_TIMESTAMP_TZ => 31, # duckdb_timestamp (microseconds)
98 DUCKDB_TYPE_UHUGEINT => 32, # duckdb_uhugeint
99 DUCKDB_TYPE_ARRAY => 33, # duckdb_array, only useful as logical type
100 DUCKDB_TYPE_ANY => 34, # enum type, only useful as logical type
101 DUCKDB_TYPE_BIGNUM => 35, # duckdb_bignum
102 DUCKDB_TYPE_SQLNULL => 36, # enum type, only useful as logical type
103 DUCKDB_TYPE_STRING_LITERAL => 37, # enum type, only useful as logical type
104 DUCKDB_TYPE_INTEGER_LITERAL => 38, # enum type, only useful as logical type
105 DUCKDB_TYPE_TIME_NS => 39, # duckdb_time_ns (nanoseconds)
106 22 ▶};
Subroutine BEGIN: called CC=1 SCAR=0.0
107  
108 # enum duckdb_result_type
109 use constant {
110 22 DUCKDB_RESULT_TYPE_INVALID => 0,
111 DUCKDB_RESULT_TYPE_CHANGED_ROWS => 1,
112 DUCKDB_RESULT_TYPE_NOTHING => 2,
113 DUCKDB_RESULT_TYPE_QUERY_RESULT => 3,
114 22 ▶};
Subroutine BEGIN: called CC=1 SCAR=0.0
115  
116 22 my $_i = 0;
117 22 our %DUCKDB_TYPE_IDS = map { $_i++ => $_ } @DUCKDB_TYPES;
118  
119 6363 ▶sub DUCKDB_TYPE { $DUCKDB_TYPE_IDS{$_[1]} }
Subroutine DUCKDB_TYPE: called CC=1 SCAR=0.0
Pod undocumented
120  
121  
122 22 1;
123  
124 __END__
« DuckDB/GetInfo.pm ↑ Summary DuckDB/FFI.pm »