>> So another approach would be to add
>>
>> int Query.fetchCount()
>>
>> to the API. The implementation should build SQL which ignores anything 
>> between "select" and "from". The implementation of this would be in 
>> the dialect.
> 
> I guess I could live with such a solution.

One of the recurring requirements that I have is a paged display with a result 
size count, so varying a query from "give me the result columns" to "just give 
me the result count" is something that I could make use of.

I suspect I'm not alone with this use case.

Aside note: I'm not sure whether "fetch" is the right terminology here, it is 
ringing some unappropriate overtones for me (in the sense of "page fetching" 
and "fetch limits"). I'd have designed it as a query transformer that takes a 
query and returns its SELECT COUNT(*) variation (so it can be reused, prepared 
with values, etc).
Not knowing the API that this is going into, I may be totally off the mark 
though. (I still haven't found the time to migrate to Jooq :-((( so my 
knowledge is very limited, and to be taken as an outsider's perspective.)

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to