Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you set a cell to null in datagrip?

Tags:

datagrip

Is there a quick way without diving into sql to set a particular attribute back to null? entering in "" doesn't work.

like image 969
1mike12 Avatar asked Oct 20 '16 05:10

1mike12


People also ask

How do you insert a null in a non null column?

Code Inspection: Insert NULL into NOT NULL column You cannot insert NULL values in col1 and col2 because they are defined as NOT NULL. If you run the script as is, you will receive an error. To fix this code, replace NULL in the VALUES part with some values (for example, 42 and 'bird' ).

How do I edit a view in DataGrip?

In the Database Explorer (View | Tool Windows | Database Explorer), right-click a and select Modify. In the Modify Table dialog, specify the settings that you need.

How do you refresh a DataGrip?

In the Database Explorer (View | Tool Windows | Database Explorer), right-click a data source and select Tools | Force Refresh.

How do I find a column in DataGrip?

In case you want to search for columns in a result set or table, invoke the File Structure action Ctrl+F12 and start typing. Speed search filters columns automatically. Press Enter to navigate to the column that you need.


4 Answers

You can either:

  1. Select the field, right-click, and select "Set NULL"
  2. Select the field, press CTRL+ALT+N (on Windows).

Note that boolean fields will show up as a box filled with a dash (-) when null.

If the "Set NULL" option is not appearing, you might need to refresh the schema which you can do by clicking the synchronize button:

enter image description here

or by pressing Ctrl+Alt+Y (on Windows).

like image 62
Gus King Avatar answered Oct 14 '22 21:10

Gus King


If set null is not an option, try synchronizing the table schema. Right click the table and Synchronize (Ctrl-Alt-Y)

like image 20
Dustin Graham Avatar answered Oct 14 '22 22:10

Dustin Graham


In Windows, there are two easy ways:

  1. Select specific field and then press Ctrl+Alt+N
  2. Right click on the specific field and then select Set NULL

enter image description here

like image 26
Sina Lotfi Avatar answered Oct 14 '22 21:10

Sina Lotfi


Also, be sure that your field is nullable otherwise, DataGrip WILL NOT present the Set NULL option :)

like image 34
ChromeKK Avatar answered Oct 14 '22 22:10

ChromeKK