Language Injection Settings: SQL Injection
This dialog opens after you click in the Language Injection page, and choose SQL Injection from the context menu, or select an entry and click
.
Item | Description |
|---|---|
Name | The name of the injection. |
Language | The language to be injected.
The prefix and suffix are optional. |
Places Patterns | In this field, type the rules that define the context where you want CLion recognize literals as injections. SQL element patterns: Use SQL element patterns to identify SQL elements where a language injection applies. You can combine patterns to restrict matches by SQL dialect, function name, argument position, and number of function arguments.
Combined example: [Oracle] RegExp in Built-in rule name:
sqlElement()
.forDialects("Oracle")
.functionArgument(
1,
sqlFunctionCall()
.name("regexp_like")
.params(sqlExpressions().count(2, 3))
)
This pattern matches an SQL element in the Oracle dialect when the element is the argument at index The second argument of
SELECT 'Match'
FROM dual
WHERE REGEXP_LIKE('hello', '^[a-z]+$');
![]() More examples:
Multiple patterns You can define multiple place patterns for a single injection rule. The injection activates if any of the patterns match (they are combined with OR logic). Add each pattern on a separate line. |
Advanced | In this area, optionally specify additional settings to narrow the context where the injection rule is applicable and thus to enable more fine-grained control over the injection process.
|
![[Oracle] RegExp in REGEXP_LIKE [Oracle] RegExp in REGEXP_LIKE](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_sql_injection_example_oracle_regexp.png)
![[Oracle] XPath in XMLQUERY [Oracle] XPath in XMLQUERY](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_sql_injection_example_oracle_xpath.png)
![[Microsoft SQL Server] JSON in OPENJSON [Microsoft SQL Server] JSON in OPENJSON](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_sql_injection_example_ms_sql_server_json.png)