DataGrip makes your SQL coding as easy and effective as possible. It completes keywords and identifiers, generates SQL, detects probable bugs in your SQL code and suggests the best options to fix them on the fly.
As soon as DataGrip finds a way to alter your code, you can apply it by pressing Alt+Enter. You’ll see the pop-up with Intention Actions, which cover a wide range of situations from warnings to optimization suggestions. Some of the most useful ones include:
- Create a table definition from INSERT statement
- Qualify/unqualify identifier
- Quote/unquote identifier
- Expand wildcard
- Introduce alias for the subquery
- Add a missing object to the database
Code completion is pretty fast in DataGrip. You get a list of suggestions as you type: our main goal is zero-latency here. Completion is automatic, but you can invoke it at any moment by pressing Ctrl+Space. It is also context-aware, which means that it tries to only suggest the objects and keywords you may need at any particular moment.
DataGrip detects probable bugs in your SQL code and suggests the best options to fix them on the fly. The IDE will notify you if there are:
- Unresolved objects: invalid objects in a query
- Ambiguous names in a query
- Mismatching number of columns in queries used in set operators
- Mismatching number of values in
Sometimes your code works but contains something that shouldn’t be there. DataGrip will warn you in case of:
- Unused parameters in procedure or function
- Unused subquery items
- Unreachable code
- Constant conditions in
- Unsafe statements you are going to run
Since using wildcards is not recommended in many cases, DataGrip can expand it to list all columns of the table for you. In the case of conflicts, identifiers will be qualified.
DataGrip can give you information about the names and types of parameters for functions and procedures as well. To see this tooltip press Ctrl+P.
Column names tooltip for INSERT statement
To assist you in inserting valid values, the IDE hints at the name and type of corresponding columns. Invoke it by pressing Ctrl+P.
Column names hints for INSERT statement
Try enabling Settings → Editor → General → Appearance → Show parameter name hints:
DataGrip will prompt you with information about the column names in