Open
Description
I want to apply limit_
conditionally, like this:
select_ $
if limitNeeded then limit_ 10 else id $
all_ someTable
This fails with cannot construct the infinite type: s ~ QNested s
. I get that limit_
changes the type and id
doesn't, but I can't figure out what I can use instead of id
. I thought subselect_
could work, but I'm getting ugly nested queries when limitNeeded
is false:
SELECT `t0`.`res0` AS `res0`, `t0`.`res1` AS `res1` FROM
(SELECT `t0`.`email` AS `res0`, `t0`.`enabled` AS `res1` FROM `table` AS `t0`)
Any advice?