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

Giorgi / DuckDB.NET / 10773748422

09 Sep 2024 01:01PM UTC coverage: 89.795% (-0.2%) from 89.997%
10773748422

push

github

Giorgi
Merge branch 'nightly-builds' into develop

920 of 1056 branches covered (87.12%)

Branch coverage included in aggregate %.

192 of 232 new or added lines in 23 files covered. (82.76%)

5 existing lines in 3 files now uncovered.

1887 of 2070 relevant lines covered (91.16%)

897099.16 hits per line

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

92.31
/DuckDB.NET.Data/Internal/Writer/DateTimeVectorDataWriter.cs
1
using System;
2
using DuckDB.NET.Native;
3

4
namespace DuckDB.NET.Data.Internal.Writer;
5

6
internal sealed unsafe class DateTimeVectorDataWriter(IntPtr vector, void* vectorData, DuckDBType columnType) : VectorDataWriterBase(vector, vectorData, columnType)
48✔
7
{
8
    internal override bool AppendDateTime(DateTime value, ulong rowIndex)
9
    {
10
        if (ColumnType == DuckDBType.Date)
765,982✔
11
        {
12
            return AppendValueInternal(NativeMethods.DateTimeHelpers.DuckDBToDate((DuckDBDateOnly)value.Date), rowIndex);
750,652✔
13
        }
14

15
        var timestamp = NativeMethods.DateTimeHelpers.DuckDBToTimestamp(DuckDBTimestamp.FromDateTime(value));
15,330✔
16

17
        if (ColumnType == DuckDBType.TimestampNs)
15,330✔
18
        {
19
            timestamp.Micros *= 1000;
60✔
20
        }
21

22
        if (ColumnType == DuckDBType.TimestampMs)
15,330✔
23
        {
24
            timestamp.Micros /= 1000;
60✔
25
        }
26

27
        if (ColumnType == DuckDBType.TimestampS)
15,330✔
28
        {
29
            timestamp.Micros /= 1000000;
60✔
30
        }
31

32
        return AppendValueInternal(timestamp, rowIndex);
15,330✔
33
    }
34

35
    internal override bool AppendDateTimeOffset(DateTimeOffset value, ulong rowIndex)
36
    {
37
        var time = NativeMethods.DateTimeHelpers.DuckDBToTime((DuckDBTimeOnly)value.DateTime);
60✔
38
        var timeTz = NativeMethods.DateTimeHelpers.DuckDBCreateTimeTz(time.Micros, (int)value.Offset.TotalSeconds);
60✔
39

40
        return AppendValueInternal(timeTz, rowIndex);
60✔
41
    }
42

43
#if NET6_0_OR_GREATER
44
    internal override bool AppendDateOnly(DateOnly value, ulong rowIndex) => AppendValueInternal(NativeMethods.DateTimeHelpers.DuckDBToDate(value), rowIndex);
120✔
45

46
    internal override bool AppendTimeOnly(TimeOnly value, ulong rowIndex) => AppendValueInternal(NativeMethods.DateTimeHelpers.DuckDBToTime(value), rowIndex);
60✔
47
#endif
48

NEW
49
    internal override bool AppendDateOnly(DuckDBDateOnly value, ulong rowIndex) => AppendValueInternal(NativeMethods.DateTimeHelpers.DuckDBToDate(value), rowIndex);
×
50

NEW
51
    internal override bool AppendTimeOnly(DuckDBTimeOnly value, ulong rowIndex) => AppendValueInternal(NativeMethods.DateTimeHelpers.DuckDBToTime(value), rowIndex);
×
52
}
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

© 2025 Coveralls, Inc