• 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

92.31
/DuckDB.NET.Data/DuckDBTransaction.cs
1
using DuckDB.NET.Data.Extensions;
2
using System;
3
using System.Data;
4
using System.Data.Common;
5

6
namespace DuckDB.NET.Data;
7

8
public class DuckDBTransaction : DbTransaction
9
{
10
    private bool finished = false;
11
    private readonly DuckDBConnection connection;
12

13
    protected override DbConnection DbConnection => connection;
3✔
14

15
    public override IsolationLevel IsolationLevel { get; }
3✔
16

17
    public DuckDBTransaction(DuckDBConnection connection, IsolationLevel isolationLevel)
24✔
18
    {
19
        this.connection = connection;
24✔
20
        IsolationLevel = isolationLevel;
24✔
21

22
        if (isolationLevel != IsolationLevel.Snapshot && isolationLevel != IsolationLevel.Unspecified)
24✔
23
        {
24
            throw new ArgumentException($"Unsupported isolation level: {isolationLevel}", nameof(isolationLevel));
3✔
25
        }
26

27
        this.connection.ExecuteNonQuery("BEGIN TRANSACTION;");
21✔
28
    }
21✔
29

30
    public override void Commit() => FinishTransaction("COMMIT;");
15✔
31

32
    public override void Rollback() => FinishTransaction("ROLLBACK");
18✔
33

34
    private void FinishTransaction(string finalizer)
35
    {
36
        if (finished)
33✔
37
        {
38
            throw new InvalidOperationException("Transaction has already been finished.");
12✔
39
        }
40

41
        try
42
        {
43
            connection.ExecuteNonQuery(finalizer);
21✔
44
            Cleanup();
21✔
45
        }
21✔
46
        // If something goes wrong with the transaction, to match the
47
        // transaction's internal duckdb state it should still be considered
48
        // finished and should no longer be used
UNCOV
49
        catch (DuckDBException ex) when (ex.ErrorType == Native.DuckDBErrorType.Transaction)
×
50
        {
UNCOV
51
            Cleanup();
×
UNCOV
52
            throw;
×
53
        }
54

55
        void Cleanup()
56
        {
57
            connection.Transaction = null;
21✔
58
            finished = true;
21✔
59
        }
21✔
60
    }
21✔
61

62
    protected override void Dispose(bool disposing)
63
    {
64
        base.Dispose(disposing);
21✔
65

66
        if (disposing && !finished && connection.IsOpen())
21✔
67
        {
68
            Rollback();
6✔
69
        }
70
    }
21✔
71
}
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