praeclarum / praeclarum/sqlite-net
ToListAsync fails if no items are found
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
In the async API ToListAsync() fails when no items are found.
When I'm debugging it stops the debugger with no error.
// relatedId value DOES NOT EXIST IN THE DATABASE...
var query = database.Table<T>().Where(i => i.RelatedId == relatedId);
var unOrdered = await query.ToListAsync(); // This line crashes.
Tested on Visual Studio Code for Mac in a netstandard lib used by a Xamarin project.
sqlite-net-pcl version 1.5.231 (from Nuget)
Edit: the behavior seems to be erratic. Sometimes has worked just by called .ToArrayAsync() before but but others not.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided ToListAsync() query with a relatedId that does not exist, using sqlite-net-pcl 1.5.231 in the described Xamarin/netstandard setup. Compare the behavior with ToArrayAsync(); the issue is done when an empty query returns an empty result without stopping the debugger or crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sqlite
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100