Skip to content

skuirrels/DuckDB.NET

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,096 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DuckDB.NET - Performance fork

This is the skuirrels/DuckDB.NET fork of the upstream DuckDB.NET project. It provides stable fork packages containing the cutting-edge performance work while the corresponding upstream pull requests are reviewed and released.

NuGet (Data) NuGet (Bindings) .NET 8 and 10 License: MIT

Usage

dotnet add package Skuirrels.DuckDB.NET.Data.Full

The fork packages retain the official DuckDB.NET.Data namespaces and assembly names. Do not reference this package and the official DuckDB.NET.Data.Full package in the same dependency graph.

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();
  }
}

Support

For a fork-specific problem, create an issue in this fork.

About

ADO.NET Provider for DuckDB - Performance Edition

Resources

Code of conduct

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages