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

feat: add support for "limit 0" #2255

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sillvva
Copy link

@sillvva sillvva commented May 4, 2024

Fixes #2011

MySQL, PostgreSQL, and SQLite all support LIMIT 0 as a way to quickly return an empty dataset. Negative numbers are not supported.

It can be useful for testing queries, but in Drizzle's case, it can also be a simpler way to get conditional nested data without messing up the Typescript return type as demonstrated in #2011

The changes proposed ensure placeholders (object) and numbers >= 0 are still supported. If a developer tries to use a negative number, it would exclude the limit rather than throw an error.

@sillvva sillvva changed the title Add support for "limit 0" feat: add support for "limit 0" May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add support for LIMIT 0
1 participant