oysteinkrog / SQLite.Net-PCL

Simple, powerful, cross-platform SQLite client and ORM - Updated version with PCL support
MIT License
353 stars 162 forks source link

[Question] Does the library construct queries in a way that includes conditions? #387

Closed IAmAgainst closed 3 years ago

IAmAgainst commented 3 years ago

In the following code: var users = con.Table<Users>().Where(u => u.Id == someId);

or something less direct like: var ids = new[] {15, 19, 25, 32 };

var users = con.Table<Users>().Where(u => ids.Contains(u.Id));

Do all the rows get pulled from the database and then the filters applied in-memory or does the library form the query in a way that the DB returns the final set of result directly? I ask because, although the above syntax is cleaner than hard coding the query, having the DB returning all the records seems not worth the performance cost over simply writing the query onself.

IAmAgainst commented 3 years ago

My mistake, I wanted to ask this in praeclarum/sqlite-net, I can't delete it now..