I've found that it's easy to break Dapper and I'm including a script to reproduce it here. Works fine with Sqlite.
Not sure about priority of this ... do we even care about Dapper at this point in time?.
#!/usr/bin/env -S dotnet fsi
#r "nuget: DuckDB.NET.Data, 0.4.0"
// or include path to DuckDB.NET.Data build and load the .dll directly
//#I "../org/DuckDB.NET/DuckDB.NET.Data/bin/Debug/netstandard2.0/"
//#r "DuckDB.NET.Data.dll"
// also put libduckdb.{dll|so} someplace (e.g. in current directory) and point to it here
#I "."
#r "nuget: Microsoft.Data.Sqlite, 6.0.6"
#r "nuget: Dapper, 2.0.123"
open DuckDB.NET.Data
open Microsoft.Data.Sqlite
open Dapper
open System.Data
// test with either DuckDb or Sqlite
let conn =
//new SqliteConnection("Data Source=:memory:") :> IDbConnection
new DuckDBConnection("Data Source=:memory:") :> IDbConnection
conn.Open()
conn.Execute("CREATE TABLE test (id INTEGER, name VARCHAR)") |> ignore
[<CLIMutable>] type Row = { id:int; name:string }
conn.Query<Row>("SELECT * FROM test")
|> Seq.length
|> printfn "initial rows: %d"
conn.Execute("INSERT INTO test (id,name) VALUES (123,'test')") |> ignore
for row in conn.Query<Row>("SELECT * FROM test") do
printfn $"after insertion: {row.id} {row.name}"
I've found that it's easy to break Dapper and I'm including a script to reproduce it here. Works fine with Sqlite.
Not sure about priority of this ... do we even care about Dapper at this point in time?.