SQL Dialect Mapping in Multi-Module Projects
26K reputation · 17 Apr 2021, 15:01 UTC
PhpStorm provides the ability to define a global SQL dialect under Settings > Languages & Frameworks > SQL Dialects, while allowing specific overrides for individual files or directories to support heterogeneous database environments.
In a multi-module project structure where different directories target distinct database engines, the IDE must resolve SQL strings within PHP code using the correct dialect to ensure accurate syntax highlighting and identifier validation via the Database tool window.
It is unclear how the IDE prioritizes dialect resolution when a PHP file resides in a directory assigned to one dialect but contains SQL strings intended for a data source assigned to another.
- Does the directory-level dialect override take precedence over the data source mapping for SQL injection resolution?
- Can multiple dialects be assigned to a single directory to support cross-database queries within the same module?