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

Cannot set LIMIT 0 #194

Open
3 tasks done
ghost opened this issue Jan 21, 2020 · 1 comment
Open
3 tasks done

Cannot set LIMIT 0 #194

ghost opened this issue Jan 21, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 21, 2020

Describe the bug
Using .Limit(0) clears the limit.

To Reproduce
Any query using .Limit(0).

Expected behavior
.Limit(0) should append LIMIT 0 to the query.

Dialect:

  • postgres
  • mysql
  • sqlite3

Additional context
I know this is kind of a weird use case, but it allows for SELECT 1, 2, 3 FROM dual-style Oracle queries. There also appears to be a ClearLimit() function, so Limit(0) doesn't overlap with it.

@doug-martin
Copy link
Owner

Hi @im-roryl sorry I havent gotten around to this sooner.

I'm hesitant to change this functionality since it would require a major version change as it is changing existing functionality.

One way we could add this is to create a new LimitZero or ZeroLimit method to allow forcing this as it doesnt make sense in other SQL dialects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant