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
I just needed the Id column from a table so I did this: var ids = db.Query<int>("select id from Data where channel=?", [channel]);
and it happily returned a List with a single value of zero.
The answer, of course, is: var ids = db.QueryScalars<int>("select id from Data where channel=?", [channel]);
I see now that Query<> has to have a table type and that you can't specify a query that returns anything except entire rows.
Why, though, did it happily return a List instead of some kind of error? Is there a way to add error checking so it "notices" the mistake?
The text was updated successfully, but these errors were encountered:
I just needed the Id column from a table so I did this:
var ids = db.Query<int>("select id from Data where channel=?", [channel]);
and it happily returned a List with a single value of zero.
The answer, of course, is:
var ids = db.QueryScalars<int>("select id from Data where channel=?", [channel]);
I see now that Query<> has to have a table type and that you can't specify a query that returns anything except entire rows.
Why, though, did it happily return a List instead of some kind of error? Is there a way to add error checking so it "notices" the mistake?
The text was updated successfully, but these errors were encountered: