coldbox-modules / qb

Fluent Query Builder for CFML
https://qb.ortusbooks.com/
MIT License
40 stars 35 forks source link

[Improvement] Add a Limit() Method to Only Return X Number of Results #276

Closed homestar9 closed 9 months ago

homestar9 commented 9 months ago

It would be helpful to be able to limit the number of results in queries. Currently it's easy to get the first() record, paginate(), and get() all records.

I could see limit() working like this:

// get the first 5 rows from the product table
qb.get( "product" ).limit( 5 ).get();
elpete commented 9 months ago

https://qb.ortusbooks.com/query-builder/building-queries/limit-offset-and-pagination

homestar9 commented 9 months ago

Brainfart! Sorry Eric!