Automatically add alias in front of field names when selecting

Hi eveyrone, I am using a MariaDB source and I have a query like this:

Select name
from organization o
join user u on u.organization_id = o.id

The two tables have some fields that have the same name and some that are unique to each table.
If I SELECT “id”, the auto-complete suggests:
id (o)
id (u)
and if i pick the first one, it automatically inserts o.id

But if I select a field that is unique to one table, like “name”, the autosuggest shows 
name (o)
and when I pick it, it just inserts “name”, without the table alias in front. I would like to have “o.name” though.

I understand the logic, but sometimes I am building queries where I later join another table that *does* have a field called name. So ideally I always want to put the alias in front when selecting a field.
Is this something that can be configured/set up?

Thanks for your help!

0
3 comments

Hi Ferdinandsommer 

Please specify your current IDE version and check if you have the following options enabled in File | Settings | Editor | General | Code Completion 

Qualify Objects with - Table / View as Always 
Automatically add aliases when completing table name
Basic Completion

0

Aleksandr Molchanov thanks a lot, that is exactly what I was looking for!

Absolutely brilliant, all the customization options in DataGrip. I am pretty amazed by the UX.

0
Good to hear you have it configured the way you want it to. And we do appreciate your feedback!
0

Please sign in to leave a comment.