Skip to content

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

@danielkurecka

Description

@danielkurecka

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions