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

[BUG]: Drizzle studio SQL runner - MySQL empty single quotes query linting false positive #2225

Open
zsiegel92 opened this issue Apr 29, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@zsiegel92
Copy link

What version of drizzle-orm are you using?

0.29.4

What version of drizzle-kit are you using?

0.20.17

Describe the Bug

In Drizzle Studio SQL Runner, valid MySQL queries that use empty single quotes do not validate, and the green "play" button does not appear. This is only a problem in the browser-based SQL Runner - I confirmed the queries work via CLI SQL tools.

Works with non-empty string literal in single quotes:

select
 tbl.a
from
  tbl
where
  tbl.column='hello';

Fails (no green play button appears) with empty string literal in single quotes:

select
 tbl.a
from
  tbl
where
  tbl.column='';

Works (green play button does appear) with empty string literal in double quotes:

select
 tbl.a
from
  tbl
where
  tbl.column="";

Note in the last example empty double quotes ("") work, which is valid in MySQL, but not valid in Postgres, where double quotes are not string literals but identifiers only.

Expected behavior

Queries with single quotes denoting empty string literals are valid SQL syntax (including MySQL), and the green "play" button should appear in SQL Runner when queries include this. Some linting rule driving the appearance of the green button has gone wrong.

Environment & setup

SQL Runner in local Drizzle Studio.

@zsiegel92 zsiegel92 added the bug Something isn't working label Apr 29, 2024
@Shodlik-Shomuratov
Copy link

I also didn't find the answer to this bug

@Shodlik-Shomuratov
Copy link

When I am writing query to database with the help of sql`` operator it gives me this kind of error

@Shodlik-Shomuratov
Copy link

How can we fix that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants