• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Giorgi / DuckDB.NET / 21786556530

07 Feb 2026 08:39PM UTC coverage: 89.155% (-0.07%) from 89.223%
21786556530

push

github

Giorgi
Added support for clearing in-progress adapter

Requires DuckDB 1.5

1199 of 1393 branches covered (86.07%)

Branch coverage included in aggregate %.

6 of 8 new or added lines in 1 file covered. (75.0%)

193 existing lines in 43 files now uncovered.

2336 of 2572 relevant lines covered (90.82%)

557295.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

64.1
/DuckDB.NET.Bindings/DuckDBNativeObjects.cs
1
namespace DuckDB.NET.Native;
2

3
public enum DuckDBState
4
{
5
    Success = 0,
6
    Error = 1
7
}
8

9
public enum DuckDBType
10
{
11
    Invalid = 0,
12
    // bool
13
    Boolean = 1,
14
    // int8_t
15
    TinyInt = 2,
16
    // int16_t
17
    SmallInt = 3,
18
    // int32_t
19
    Integer = 4,
20
    // int64_t
21
    BigInt = 5,
22
    // uint8_t
23
    UnsignedTinyInt = 6,
24
    // uint16_t
25
    UnsignedSmallInt = 7,
26
    // uint32_t
27
    UnsignedInteger = 8,
28
    // uint64_t
29
    UnsignedBigInt = 9,
30
    // float
31
    Float = 10,
32
    // double
33
    Double = 11,
34
    // duckdb_timestamp
35
    Timestamp = 12,
36
    // duckdb_date
37
    Date = 13,
38
    // duckdb_time
39
    Time = 14,
40
    // duckdb_interval
41
    Interval = 15,
42
    // duckdb_hugeint
43
    HugeInt = 16,
44
    // duckdb_uhugeint
45
    UnsignedHugeInt = 32,
46
    // const char*
47
    Varchar = 17,
48
    // duckdb_blob
49
    Blob = 18,
50
    //decimal
51
    Decimal = 19,
52
    // duckdb_timestamp, in seconds
53
    TimestampS = 20,
54
    // duckdb_timestamp, in milliseconds
55
    TimestampMs = 21,
56
    // duckdb_timestamp, in nanoseconds
57
    TimestampNs = 22,
58
    // enum type, only useful as logical type
59
    Enum = 23,
60
    // list type, only useful as logical type
61
    List = 24,
62
    // duckdb_array, only useful as logical type
63
    Array = 33,
64
    // struct type, only useful as logical type
65
    Struct = 25,
66
    // map type, only useful as logical type
67
    Map = 26,
68
    // duckdb_hugeint
69
    Uuid = 27,
70
    // union type, only useful as logical type
71
    Union = 28,
72
    // duckdb_bit
73
    Bit = 29,
74
    // duckdb_time_tz
75
    TimeTz = 30,
76
    // duckdb_timestamp
77
    TimestampTz = 31,
78
    // ANY type
79
    Any = 34,
80
    // duckdb_varint
81
    VarInt = 35,
82
    // SQLNULL type
83
    SqlNull = 36,
84
}
85

86
[StructLayout(LayoutKind.Sequential)]
87
public struct DuckDBResult
88
{
89
    [Obsolete]
90
    private long ColumnCount;
91

92
    [Obsolete]
93
    private long RowCount;
94

95
    [Obsolete]
96
    private long RowsChanged;
97

98
    [Obsolete]
99
    private IntPtr columns;
100

101
    [Obsolete]
102
    private IntPtr ErrorMessage;
103

104
    private IntPtr internal_data;
105

106
    public void Close()
107
    {
108
        NativeMethods.Query.DuckDBDestroyResult(ref this);
157,155✔
109
    }
157,155✔
110
}
111

112
[StructLayout(LayoutKind.Sequential)]
113
public struct DuckDBDate
114
{
115
    /// <summary>
116
    /// Represents DuckDB's positive infinity date value.
117
    /// This is the value used in the DuckDB source code for +infinity dates.
118
    /// </summary>
119
    public static readonly DuckDBDate PositiveInfinity = new() { Days = int.MaxValue };
3✔
120
    /// <summary>
121
    /// Represents DuckDB's negative infinity date value.
122
    /// This is the value used in the DuckDB source code for -infinity dates.
123
    /// </summary>
124
    public static readonly DuckDBDate NegativeInfinity = new() { Days = -int.MaxValue };
3✔
125

126
    public int Days { get; set; }
1,489,684✔
127

UNCOV
128
    public bool IsInfinity => IsPositiveInfinity || IsNegativeInfinity;
×
129
    public bool IsPositiveInfinity => Days == int.MaxValue;
744,854✔
130
    public bool IsNegativeInfinity => Days == -int.MaxValue;
744,818✔
131
}
132

133
[StructLayout(LayoutKind.Sequential)]
134
public struct DuckDBTime
135
{
136
    public long Micros { get; set; }
702✔
137
}
138

139
[StructLayout(LayoutKind.Sequential)]
140
public struct DuckDBTimeTzStruct
141
{
UNCOV
142
    public ulong Bits { get; set; }
×
143
}
144

145
[StructLayout(LayoutKind.Sequential)]
146
public struct DuckDBTimeTz
147
{
148
    public DuckDBTimeOnly Time { get; set; }
747✔
149
    public int Offset { get; set; }
747✔
150
}
151

152
[StructLayout(LayoutKind.Sequential)]
153
public struct DuckDBTimestampStruct
154
{
155
    /// <summary>
156
    /// Represents DuckDB's positive infinity timestamp value.
157
    /// This is the value used in the DuckDB source code for +infinity timestamps.
158
    /// </summary>
159
    public static readonly DuckDBTimestampStruct PositiveInfinity = new() { Micros = long.MaxValue };
3✔
160
    /// <summary>
161
    /// Represents DuckDB's negative infinity timestamp value.
162
    /// This is the value used in the DuckDB source code for -infinity timestamps.
163
    /// </summary>
164
    public static readonly DuckDBTimestampStruct NegativeInfinity = new() { Micros = -long.MaxValue };
3✔
165

166
    public long Micros { get; set; }
33,672✔
167

UNCOV
168
    public bool IsInfinity => IsPositiveInfinity || IsNegativeInfinity;
×
169
    public bool IsPositiveInfinity => Micros == long.MaxValue;
16,077✔
170
    public bool IsNegativeInfinity => Micros == -long.MaxValue;
16,038✔
171
}
172

173
[StructLayout(LayoutKind.Sequential)]
174
public readonly struct DuckDBBlob : IDisposable
175
{
UNCOV
176
    public IntPtr Data { get; }
×
177

UNCOV
178
    public long Size { get; }
×
179

180
    public void Dispose()
181
    {
UNCOV
182
        NativeMethods.Helpers.DuckDBFree(Data);
×
UNCOV
183
    }
×
184
}
185

186
[StructLayout(LayoutKind.Sequential)]
187
public struct DuckDBListEntry(ulong offset, ulong length)
188
{
189
    public ulong Offset { get; private set; } = offset;
2,074,969✔
190
    public ulong Length { get; private set; } = length;
2,075,002✔
191
}
192

193
public struct DuckDBString
194
{
195
    public _value_e__Union value;
196

197
    private const int InlineStringMaxLength = 12;
198

199
    public readonly int Length => (int)value.inlined.length;
2,519,695✔
200

201
    public readonly unsafe sbyte* Data
202
    {
203
        get
204
        {
205
            if (Length <= InlineStringMaxLength)
1,053,446✔
206
            {
292,225✔
207
                fixed (sbyte* pointerToFirst = value.inlined.inlined)
292,225✔
208
                {
209
                    return pointerToFirst;
292,225✔
210
                }
211
            }
212
            else
213
            {
214
                return value.pointer.ptr;
761,221✔
215
            }
216
        }
217
    }
218

219
    [StructLayout(LayoutKind.Explicit)]
220
    public partial struct _value_e__Union
221
    {
222
        [FieldOffset(0)]
223
        public DuckDBStringPointer pointer;
224

225
        [FieldOffset(0)]
226
        public DuckDBStringInlined inlined;
227

228
        public unsafe partial struct DuckDBStringPointer
229
        {
230
            public uint length;
231

232
            public fixed sbyte prefix[4];
233

234
            public sbyte* ptr;
235
        }
236

237
        public unsafe partial struct DuckDBStringInlined
238
        {
239
            public uint length;
240

241
            public fixed sbyte inlined[12];
242
        }
243
    }
244
}
245

246
[StructLayout(LayoutKind.Sequential)]
247
public struct DuckDBQueryProgress
248
{
UNCOV
249
    public double Percentage { get; }
×
UNCOV
250
    public ulong RowsProcessed { get; }
×
UNCOV
251
    public ulong TotalRowsToProcess { get; }
×
252
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc