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
var query = "SELECT * FROM table";
var cnn = ...
var firstRecord = await cnn.QueryUnbufferedAsync<type>(query).FirstAsync();
cnn.close();
If "table" has millions of rows this is slow. IAsyncEnumerable is designed to be more efficient, at least from a memory point of view. But when calling FirstAsync you would expect it to run quickly as each row is returned to the calling code when it is read.
The reader is being disposed without cancelling the command first. I did look at using ExecuteReaderAsync but I can't get access to the command.