DuckDB.NET.Bindings 1.0.2

DuckDB.NET

DuckDB bindings for C#

GitHub Workflow Status Coveralls License Ko-Fi Discord

NuGet DuckDB.NET.Data NuGet DuckDB.NET.Bindings

NuGet DuckDB.NET.Data.Full NuGet DuckDB.NET.Bindings.Full

Project Icon

Usage

dotnet add package DuckDB.NET.Data.Full
using (var duckDBConnection = new DuckDBConnection("Data Source=file.db"))
{
  duckDBConnection.Open();

  using var command = duckDBConnection.CreateCommand();

  command.CommandText = "CREATE TABLE integers(foo INTEGER, bar INTEGER);";
  var executeNonQuery = command.ExecuteNonQuery();

  command.CommandText = "INSERT INTO integers VALUES (3, 4), (5, 6), (7, 8);";
  executeNonQuery = command.ExecuteNonQuery();

  command.CommandText = "Select count(*) from integers";
  var executeScalar = command.ExecuteScalar();

  command.CommandText = "SELECT foo, bar FROM integers";
  var reader = command.ExecuteReader();

  PrintQueryResults(reader);
}

private static void PrintQueryResults(DbDataReader queryResult)
{
  for (var index = 0; index < queryResult.FieldCount; index++)
  {
    var column = queryResult.GetName(index);
    Console.Write($"{column} ");
  }

  Console.WriteLine();

  while (queryResult.Read())
  {
    for (int ordinal = 0; ordinal < queryResult.FieldCount; ordinal++)
    {
      var val = queryResult.GetInt32(ordinal);
      Console.Write(val);
      Console.Write(" ");
    }

    Console.WriteLine();
  }
}

Documentation

Documentation is available at https://duckdb.net

Support

If you encounter a bug with the library Create an Issue. Join the DuckDB dotnet channel for DuckDB.NET-related topics.

Contributors

Contributors

Sponsors

A big thanks to the AWS Open Source Software Fund for sponsoring the project!

AWS

Showing the top 20 packages that depend on DuckDB.NET.Bindings.

Packages Downloads
DuckDB.NET.Data
DuckDB ADO.NET Provider for C#. This package does not include a copy of the native DuckDB library.
9
DuckDB.NET.Data
DuckDB ADO.NET Provider for C#. This package does not include a copy of the native DuckDB library.
7
DuckDB.NET.Data
DuckDB ADO.NET Provider for C#
7
DuckDB.NET.Data
DuckDB ADO.NET Provider for C#. This package does not include a copy of the native DuckDB library.
6
DuckDB.NET.Data
DuckDB ADO.NET Provider for C#
6

Update to DuckDB 1.0.0. 🚀

.NET 6.0

  • No dependencies.

.NET Standard 2.0

  • No dependencies.

Version Downloads Last updated
1.3.2 9 08/10/2025
1.3.0 6 08/10/2025
1.2.1 8 08/10/2025
1.2.1-alpha.8 6 08/10/2025
1.2.0 5 08/10/2025
1.1.3 6 08/10/2025
1.1.2.1 6 08/10/2025
1.1.2-alpha.5 6 08/10/2025
1.1.1 6 08/10/2025
1.1.0.1 6 08/10/2025
1.0.2 6 08/10/2025
1.0.1 5 08/10/2025
1.0.0 7 08/10/2025
0.10.3 7 08/10/2025
0.10.2 6 08/10/2025
0.10.1 7 08/10/2025
0.9.2 6 08/10/2025
0.9.1 6 08/10/2025
0.9.0.3 6 08/10/2025
0.9.0 6 08/10/2025
0.8.1 6 08/10/2025
0.8.0 5 08/10/2025
0.7.1 6 08/10/2025
0.6.1 6 08/10/2025
0.4.0.10 6 08/10/2025
0.4.0.1 5 08/10/2025
0.4.0 6 08/10/2025
0.2.9.1 6 08/10/2025
0.2.9 5 08/10/2025
0.1.3 6 08/10/2025
0.1.2 5 08/10/2025
0.1.1 5 08/10/2025
0.1.0 6 08/10/2025