Sort columns alphabetically


Is it possible to force DataGrip to show columns alphabetically rather than in the order they were created?

Comment actions Permalink

There is a bit unusual way:

First, you need to assign keyboard shortcut for 'Sort lines' action. Go to File -> Settings -> Keymap,  type in search bar 'sort lines', double-click on first one and set here for example 'CTRL+ALT+W' (if you running Windows).

Second, please go to Editor -> Code style -> SQL -> <your dialect> -> Queries tab, scroll down to 'SELECT clause' section and set 'Place element on' = 'new line', 'place comma' = 'to begin'.

Now you can write a query like


place cursor on asterisk, hit ALT+ENTER -> expand column list, hit CTRL+ALT+L, select all column names and hit CTRL+ALT+W (shortcut defined before). You will get names sorted alphabetically.

And there is no way to sort columns in Data View when you just double-click on a table.

Comment actions Permalink

Is there any plan to make such a feature as it will be very useful with tables with 100s of columns.


Please sign in to leave a comment.