Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single row queries #13

Open
rkosafo opened this issue Aug 11, 2017 · 1 comment
Open

Single row queries #13

rkosafo opened this issue Aug 11, 2017 · 1 comment
Assignees

Comments

@rkosafo
Copy link
Contributor

rkosafo commented Aug 11, 2017

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.

@rspeele
Copy link
Collaborator

rspeele commented Aug 12, 2017

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 rspeele self-assigned this Aug 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants