Structural replace for SQL functions
I want to force precision settings for time functions in a project, so that `CURRENT_TIMESTAMP()`, for example, is replaced by `CURRENT_TIMESTAMP(6)`. I tried creating structural inspection for SQL language, but it does not like anything like `CURRENT_TIMESTAMP($p$)`, expecting the `$p$` to be a column reference. I worked around this with a regex replacement instead, but now some other functions (like DateTime, Timestamp, Now) result in false positives outside of SQL context. Setting language for regex replace to SQL does not affect that, so PHP namespace like `\DateTime` or a variable like `$timestamp` get highlighted by the inspection.
Is it possible to make a structural replace inspection, that would allow targeting SQL functions specifically? Or make regex replacement work only in SQL context?
请先登录再写评论。
The type of code inspection you described is currently not supported. We have therefore created a feature request:
https://youtrack.jetbrains.com/issue/DBE-25267
Please follow this issue to stay updated on the progress