Allowing raw limits
See original GitHub issueEnvironment
Knex version: 0.95.11 Database + version: Materialize 0.9.10 (based on Postgres) OS: Ubuntu 20
Feature discussion / request
- Explain what is your use case
Materialize (https://github.com/MaterializeInc/materialize) doesn’t allow prepared values for LIMIT. As far as I can tell, Knex always makes the LIMIT value a prepared value. The only way to hardcode it in the query is something like:
knex('foo')
.orderByRaw(`1 limit ${limit}`);
Would it be possible to have a raw limit value?
- Explain what kind of feature would support this
Allow .limit(raw(10))
.
- Give some API proposal, how the feature should work
Make .limit()
accept raw()
or add .limitRaw()
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Top Results From Across the Web
Rate limits on raw endpoints - GitLab Docs
This setting defaults to 300 requests per minute, and allows you to rate limit the requests to raw endpoints: On the top bar,...
Read more >My Photo Stream and Shared Albums limits - Apple Support
iCloud limits the number of photos that can be uploaded to My Photo ... Images for My Photo Stream: JPEG, TIFF, PNG, and...
Read more >Rate limits on raw endpoints · Settings · Admin area - ETSI Forge
This setting defaults to 300 requests per minute, and allows you to rate limit the requests to raw endpoints: On the top bar,...
Read more >State-by-State Raw Milk Laws - Milk - ProCon.org
Sales of raw milk are legal with a permit and only on the farm directly to the consumer who may not resell the...
Read more >raw forest products permit conditions (rs)
Maximum GVW permit weight 98,000 lbs. RS PERMIT CONDITION SHEET. RAW FOREST PRODUCTS @ 98,000 Pounds on 6 or more axles ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Linksku I made a PR where you can make this two syntaxes :
or shorter:
Feel free to post comments on the PR
I ran into this problem today. SphinxQL, which is a dialect for SphinxSearch ( fulltext search server - http://sphinxsearch.com/ ) uses for format
offset, limit
instead oflimit 1 offset 2
when using limits.The only way I have found using knex qb around this problem is to append raw sql to the raw query-string. Like so;
The ability to extend the qb with something like
limitRaw(offset, limit) => ´${offset}, ${limit}´
would really help, but seems not possible with current restrictions. Or am I missing something or any other ideas?