Rezoom.SQL icon indicating copy to clipboard operation
Rezoom.SQL copied to clipboard

Single row queries

Open rkosafo opened this issue 8 years ago • 1 comments

Given the query

type UserCount = SQL<"Select count(*) as cnt from Users">

UserCount.Command has signature Command<IReadOnlyList<Row>>

Is there a way to write the query such that the output is Command<Row> so .Scalar() can be called on it instead of .Plan() or .ExactlyOne()?

Currently using .ExactlyOne() though.

rkosafo avatar Aug 11 '17 18:08 rkosafo

Right now, no way to do it. However it shouldn't be too hard to add this type of query (aggregates in the select clause, no group by, no limit) to the ones that get detected as single-row queries.

rspeele avatar Aug 12 '17 17:08 rspeele