Skip to content

Quick Fixes

Quick fixes are context-aware suggestions for resolving problems reported by dbLinter, eliminating the need to search for solutions manually.

The first three options in the quick fix pop-up window are solutions to the problem on line 8, column 8.

Single Problem

The Replace nvl with coalesce. option produces the following result:

Fixed one Problem

Rather than fixing one problem at a time, you can select the option Fix all <rule> problems like ... to fix all problems for one rule in one go.

This option is only available if multiple problems have been reported for a rule in a file.

Fixed All Problems of One Rule

The Fix all G-2180 problems like 'Replace with unquoted identifier.' option produces the following result:

Fixed All Problems of One Rule

From the quick fix pop-up window, you can select the Fix all problems option. This option is available in every editor position if there are any quick fixes that can be safely applied to the file.

Fixed All Problems of One Rule

The Fix all problems. option produces the following result:

Fixed All Problems of One Rule

If you cannot fix a problem or choose to accept it, add a @dbLinter ignore(...) marker comment to suppress it. See Ignoring Issues for the syntax, scope and examples. For APEXlang files, use .dblinterapxignore to preserve exceptions across application exports.

The screenshot in Single Problem shows the two options, Fix and Explain, provided by the Copilot extension in VS Code. If you have set up an AI agent in VS Code, you will also have access to these options in your installation.

The next screenshot shows a violation of rule G-3185: Never use ROWNUM at the same query level as ORDER BY. In this case, dbLinter does not provide a quick fix. However, the AI agent can suggest code fixes based on the information it receives. In other words, the context. For example, this is:

  • The content in the editor.
  • The name and description of the violated rule.
  • The exact position of the rule violation in the editor.
  • Additional information about this rule available on the internet.

AI Fix

In this case, the AI agent is Copilot, which is configured to use the GPT-4.1 model. The following code change is proposed:

AI Suggestion

After accepting the proposal, the editor content looks similar to the following:

AI Suggestion Applied

The code violation has now been resolved, meaning the query produces the correct result.

However, you cannot be sure that the result is correct. Why? Because the result is not deterministic. Even with this simple example, we have experienced different results in the past. Some were correct and some were wrong. Therefore, you should always check the result produced by the AI agent.

In any case, the provided solution is not the best option. A modern solution would use the row_limiting_clause, which was introduced with the Oracle Database 12c. as shown in the second solution of G-3185.

That said, the fixes proposed by the AI agent are powerful and useful when a dbLinter quick fix is unavailable.