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

Problem with parameters in QL-chart and MySQL #209

Open
ktselishev opened this issue Oct 3, 2024 · 1 comment
Open

Problem with parameters in QL-chart and MySQL #209

ktselishev opened this issue Oct 3, 2024 · 1 comment
Labels
question Further information is requested

Comments

@ktselishev
Copy link

  • I have a MySQL database as a source for a QL-chart.
  • I have a parameter (string) that can have one or multiple values.
  • According to the documentation, “If the query contains the IN operator before a parameter, the substituted value is always converted into a tuple. Such a query will work correctly if you select one or more values.”
  • However, when I use only one value, it doesn’t work as expected — the value is not converted into a tuple and remains a string.
изображение
@ktselishev ktselishev changed the title Problem with parametrs in QL-chart and MySQL Problem with parameters in QL-chart and MySQL Oct 3, 2024
@artemipanchuk
Copy link

Hello ktselishev,

Thanks for your issue and sorry for the inconvinience.

According to the documentation, “If the query contains the IN operator before a parameter, the substituted value is always converted into a tuple. Such a query will work correctly if you select one or more values.”

In fact this is the issue. These rules apply only for ClickHouse and PostgreSQL connections. We will update the documentation soon.

Workaround for MySQL can be:
SELECT * FROM users WHERE name IN {{name}}
And if you need to use only one value in name, you may fill name with this value twice.

@Marginy605 Marginy605 added the question Further information is requested label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants