-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SqLite ReadFirstAsync<int> #1301
Comments
Can you add some words here? I'm not sure if you're asking a question, reporting an issue, or just... showing me some code. Please clarify. |
For MSSql Server works I'm not good in English |
I am running into a similar problem. This works:
But if I try to do the same thing using QueryMultiple to avoid the second round trip, I get the following error on the rowCount query: dbc.QueryMultiple code that fails:
I remember running into a similar issue years ago using one of the Query extension method variations with SQLite but it was resolved at some point. I am able to work around the bug by doing:
But this creates additional problems when working with pluggable db providers. For context, I am running into this bug using .NET Core 3 preview 9, Dapper 2.04 and System.Data.SQLite.Core 1.0.111 |
@mgravell I have been doing some digging through old issues, and this problem looks related to So I did some more testing. The following gives Int64 as output:
So it seems the SQLite provider is sending back a long for whatever reason. This is on a type in SQLite that is set to "integer". But I think I read somewhere at some point that SQLite returns identity columns as Int64. But the following succeeds and somewhere along the line a conversion is happening successfully: Continuing on to the grid reader, the following outputs Int64:
But the following throws "Unable to cast object of type 'System.Int64' to type 'System.Int32'" Which leads me to the roundabout conclusion that this is related to 524 Apologies if I repeated myself a bit here. Just trying to explain as clearly as I can. |
public override async Task<IResultWithTotalCount> HandleAsync(PagedAnsweredQuestionsQuery query, CancellationToken token)
{
//const string sql = @"SELECT Questions.Id, Questions.DateCreated, Questions.DateAnswered, Questions.QuestionText, Questions.DisplayName, Questions.EmailAddress, Questions.AnswerText, Categories.Name AS CategoryName
//FROM Questions INNER JOIN
//Categories ON Questions.CategoryId = Categories.Id
//WHERE(NOT(Questions.DateAnswered IS NULL))
//ORDER BY Questions.DateAnswered DESC LIMIT @take OFFSET @Skip;
The text was updated successfully, but these errors were encountered: