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 #[Language('GenericSQL')] attribute #454

Open
danielkurecka opened this issue Jan 28, 2024 · 0 comments
Open

Problem with #[Language('GenericSQL')] attribute #454

danielkurecka opened this issue Jan 28, 2024 · 0 comments

Comments

@danielkurecka
Copy link

The issue is that "GenericSQL" prevents advance code assistance in PHPStorm, e.g.:
When I add MySQL Data Source (View | Tool Windows | Database) and I set SQL dialect to MySQL (Settings | Languages & Framewors | SQL Dialects), I can get code completion of table/column names + syntax check.

But it will not work when parameter has language attribute set to "GenericSQL" as it has higher priority over the dialect that is configured in settings.

If the attribute would have just "SQL" than configuration in settings is respected.

I see that GenericSQL dialect is useful as it does not report syntax errors for queries like this:

<?php
$db->query('UPDATE foo SET %a', ['foo' => 'bar']);

But having it set in attribute, we loose the ability to change it on project/file bases. The only way is via PHPDoc for each query.

So I think using just SQL would be better as it gives more flexibility. I can set the dialect in the settings based on my needs.

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

No branches or pull requests

1 participant