I have a SQLite table
create table cars (
id integer primary key,
name text,
data text);
Where data is a large clob and do not want to read it in every query. I have a class
public class Car
{
[Key]
public long Id { get; set; }
public string Name { get; set; }
}
And read a Car by the Dapper.Contrib query
It generates the SQL query
select * from cars where Id = @id
It's is not optimal, since the data column (large) is fetched too, and never used. I would expect the query
select t.id, t.name from cars t where Id = @id
I.e specify the columns in the select clause. The GetAll() method should has to be changed, too. (IMHO no ORM should use select * in it's core functions.)
Note: the [Computed] columns has to be omitted, too. With [Computed] the Dapper.Contrib Get query reads the column, but Update, Insert wont change the [Computed] column.
I have a SQLite table
Where
datais a large clob and do not want to read it in every query. I have a classAnd read a
Carby the Dapper.Contrib queryIt generates the SQL query
It's is not optimal, since the
datacolumn (large) is fetched too, and never used. I would expect the queryI.e specify the columns in the
selectclause. TheGetAll()method should has to be changed, too. (IMHO no ORM should useselect *in it's core functions.)Note: the
[Computed]columns has to be omitted, too. With[Computed]theDapper.ContribGetquery reads the column, but Update, Insert wont change the[Computed]column.