You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Executing a simple query is throwing an exception. I'm creating a ASP.NET 5 / .NET Core 1.0 project using latest beta of Dapper.NET (1.50.0-beta7) with a SQLite db.
using Dapper;using Microsoft.Data.Sqlite;
...
var connectionString ="Data Source=./db/test.db";using(varconnection=new SqliteConnection(connectionString)){
connection.Open();
connection.Execute(@" CREATE TABLE IF NOT EXISTS [DinosaurTypes] ( [Id] UUID NOT NULL PRIMARY KEY, [Name] NVARCHAR(200) NOT NULL )");
connection.Execute(@" INSERT INTO [DinosaurTypes] (Id, Name) VALUES ('A1A38605-08D0-4695-A037-514A997FABF1', 'Stegosaurus')");// This throws a InvalidArgument exception.varresults= connection.Query<DinosaurType>("SELECT * FROM [DinosaurTypes]");// This works of course without the mapping to a model.varcommand=new CommandDefinition("SELECT * FROM [DinosaurTypes]");using(varreader= connection.ExecuteReader(command, CommandBehavior.Default)){object[]values=newobject[2];while(reader.Read()){
reader.GetValues(values);}}}
It appears Dapper wants to set CommandBehavior.SingleResult on the DataReader (for performance reasons?), but the SQLite adapter doesn't support that. Is there a fix planned for this, or am I missing something?
The text was updated successfully, but these errors were encountered:
This is the first I've heard of it; holy wow, that's a terrible thing for the SQLite adapter to do. If you can't support a suggested optimization, you (the adapter) should just carry on as normal - you shouldn't throw. That's really sucky, and IMO very definitely a bug in the SQLite adapter. I'll see if I can log it there. This would definitely break all recent dapper builds for SQLite. I'll investigate.
Executing a simple query is throwing an exception. I'm creating a ASP.NET 5 / .NET Core 1.0 project using latest beta of Dapper.NET (1.50.0-beta7) with a SQLite db.
My project.json looks like:
It appears Dapper wants to set CommandBehavior.SingleResult on the DataReader (for performance reasons?), but the SQLite adapter doesn't support that. Is there a fix planned for this, or am I missing something?
The text was updated successfully, but these errors were encountered: