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

Giorgi / DuckDB.NET / 21786443631

07 Feb 2026 08:33PM UTC coverage: 89.223% (-0.2%) from 89.45%
21786443631

push

github

Giorgi
Drop netstandard2.0 and net6.0 target frameworks

Update target frameworks to net8.0 and net10.0,
remove all conditional compilation directives for
NET5_0_OR_GREATER, NET6_0_OR_GREATER, and
NET8_0_OR_GREATER. Delete polyfills and shims that
were only needed for older frameworks. Remove
[Experimental] attributes from scalar/table function
APIs.

1197 of 1389 branches covered (86.18%)

Branch coverage included in aggregate %.

12 of 12 new or added lines in 8 files covered. (100.0%)

14 existing lines in 8 files now uncovered.

2330 of 2564 relevant lines covered (90.87%)

557293.59 hits per line

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

81.82
/DuckDB.NET.Data/DataChunk/Writer/VectorDataWriterBase.cs
1
using System;
2
using System.Collections;
3
using System.Numerics;
4
using DuckDB.NET.Native;
5

6
namespace DuckDB.NET.Data.DataChunk.Writer;
7

8
internal unsafe class VectorDataWriterBase(IntPtr vector, void* vectorData, DuckDBType columnType) : IDisposable, IDuckDBDataWriter
1,239✔
9
{
10
    private ulong* validity;
11

12
    internal IntPtr Vector => vector;
851,585✔
13
    internal DuckDBType ColumnType => columnType;
3,902,849✔
14

15
    public void WriteNull(ulong rowIndex)
16
    {
17
        if (validity == default)
5,244,388✔
18
        {
19
            NativeMethods.Vectors.DuckDBVectorEnsureValidityWritable(Vector);
762✔
20
            validity = NativeMethods.Vectors.DuckDBVectorGetValidity(Vector);
762✔
21
        }
22

23
        NativeMethods.ValidityMask.DuckDBValiditySetRowValidity(validity, rowIndex, false);
5,244,388✔
24
    }
5,244,388✔
25

26
    public void WriteValue<T>(T value, ulong rowIndex)
27
    {
28
        if (value == null)
26,637,189✔
29
        {
30
            WriteNull(rowIndex);
5,244,388✔
31
            return;
5,244,388✔
32
        }
33

34
        _ = value switch
21,392,801!
35
        {
21,392,801✔
36
            bool val => AppendBool(val, rowIndex),
1,121,364✔
37

21,392,801✔
38
            sbyte val => AppendNumeric(val, rowIndex),
1,128,905✔
39
            short val => AppendNumeric(val, rowIndex),
1,131,607✔
40
            int val => AppendNumeric(val, rowIndex),
1,552,785✔
41
            long val => AppendNumeric(val, rowIndex),
1,241,406✔
42

21,392,801✔
43
            byte val => AppendNumeric(val, rowIndex),
1,133,544✔
44
            ushort val => AppendNumeric(val, rowIndex),
1,124,402✔
45
            uint val => AppendNumeric(val, rowIndex),
1,122,850✔
46
            ulong val => AppendNumeric(val, rowIndex),
1,114,836✔
47

21,392,801✔
48
            float val => AppendNumeric(val, rowIndex),
1,118,561✔
49
            double val => AppendNumeric(val, rowIndex),
1,118,485✔
50

21,392,801✔
51
            decimal val => AppendDecimal(val, rowIndex),
1,184,841✔
52
            BigInteger val => AppendBigInteger(val, rowIndex),
1,498,406✔
53

21,392,801✔
54
            Enum val => AppendEnum(val, rowIndex),
557,272✔
55

21,392,801✔
56
            string val => AppendString(val, rowIndex),
1,407,360✔
57
            Guid val => AppendGuid(val, rowIndex),
1,290,308✔
58
            DateTime val => AppendDateTime(val, rowIndex),
763,226✔
59
            TimeSpan val => AppendTimeSpan(val, rowIndex),
741,363✔
60
            DuckDBDateOnly val => AppendDateOnly(val, rowIndex),
120✔
61
            DuckDBTimeOnly val => AppendTimeOnly(val, rowIndex),
60✔
UNCOV
62
            DateOnly val => AppendDateOnly(val, rowIndex),
×
63
            TimeOnly val => AppendTimeOnly(val, rowIndex),
×
64
            DateTimeOffset val => AppendDateTimeOffset(val, rowIndex),
120✔
65
            ICollection val => AppendCollection(val, rowIndex),
1,040,980✔
66
            _ => ThrowException<T>()
×
67
        };
21,392,801✔
68
    }
×
69

70
    internal virtual bool AppendBool(bool value, ulong rowIndex) => ThrowException<bool>();
×
71

72
    internal virtual bool AppendDecimal(decimal value, ulong rowIndex) => ThrowException<decimal>();
×
73

74
    internal virtual bool AppendTimeSpan(TimeSpan value, ulong rowIndex) => ThrowException<TimeSpan>();
×
75

76
    internal virtual bool AppendGuid(Guid value, ulong rowIndex) => ThrowException<Guid>();
×
77

78
    internal virtual bool AppendBlob(byte* value, int length, ulong rowIndex) => ThrowException<byte[]>();
×
79

80
    internal virtual bool AppendString(string value, ulong rowIndex) => ThrowException<string>();
×
81

82
    internal virtual bool AppendDateTime(DateTime value, ulong rowIndex) => ThrowException<DateTime>();
×
83

UNCOV
84
    internal virtual bool AppendDateOnly(DateOnly value, ulong rowIndex) => ThrowException<DateOnly>();
×
85

86
    internal virtual bool AppendTimeOnly(TimeOnly value, ulong rowIndex) => ThrowException<TimeOnly>();
×
87

UNCOV
88
    internal virtual bool AppendDateOnly(DuckDBDateOnly value, ulong rowIndex) => ThrowException<DuckDBDateOnly>();
×
89

90
    internal virtual bool AppendTimeOnly(DuckDBTimeOnly value, ulong rowIndex) => ThrowException<DuckDBTimeOnly>();
×
91

92
    internal virtual bool AppendDateTimeOffset(DateTimeOffset value, ulong rowIndex) => ThrowException<DateTimeOffset>();
×
93

94
    internal virtual bool AppendNumeric<T>(T value, ulong rowIndex) where T : unmanaged => ThrowException<T>();
3✔
95

96
    internal virtual bool AppendBigInteger(BigInteger value, ulong rowIndex) => ThrowException<BigInteger>();
×
97

98
    internal virtual bool AppendEnum<TEnum>(TEnum value, ulong rowIndex) where TEnum : Enum => ThrowException<TEnum>();
×
99

100
    internal virtual bool AppendCollection(ICollection value, ulong rowIndex) => ThrowException<ICollection>();
×
101

102
    private bool ThrowException<T>()
103
    {
104
        throw new InvalidOperationException($"Cannot write {typeof(T).Name} to {columnType} column");
3✔
105
    }
106

107
    internal bool AppendValueInternal<T>(T value, ulong rowIndex) where T : unmanaged
108
    {
109
        ((T*)vectorData)[rowIndex] = value;
20,540,109✔
110
        return true;
20,540,109✔
111
    }
112

113
    internal void InitializeWriter()
114
    {
115
        validity = default;
1,689✔
116
        vectorData = NativeMethods.Vectors.DuckDBVectorGetData(Vector);
1,689✔
117
    }
1,689✔
118

119
    public virtual void Dispose()
120
    {
121

122
    }
717✔
123
}
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