Giorgi / DuckDB.NET

Bindings and ADO.NET Provider for DuckDB
https://duckdb.net
MIT License
356 stars 62 forks source link

Strange Exception error on sample #12

Closed mmauri closed 2 years ago

mmauri commented 2 years ago

Hi, The idea to have access from c# to DuckDB performance & its easiness to read parquet files looks amazing, but I tried to run this sample from the readme, and it returns a strange exception with the following message: "plú=:☻"

this is the code producing it: (using windows amd64 duckdb.dll v0.2.8)

 using (var conn = new DuckDBConnection("Data Source=:memory:"))
  {
      try
      {
          conn.Open();
          var command = conn.CreateCommand();
          command.CommandText = "CREATE TABLE integers(foo INTEGER, bar INTEGER);";
          var executeNonQuery = command.ExecuteNonQuery();
      }
      catch (Exception ex)
      {
          Console.WriteLine(ex.Message);
      }
  }

Thanks,

Giorgi commented 2 years ago

The duckdb_result struct has changed so that's why the result is corrupted.

I will update the library.

Giorgi commented 2 years ago

Fixed in 070aade3593302afdd7e16283606833373d14907

Giorgi commented 2 years ago

@mmauri New version of NuGet packages uploaded. They will become available in a couple of minutes.