Daniel L. VanDenBosch
Daniel L. VanDenBosch

Reputation: 2715

Datagrip table prefixs when expanding column lists

Is there a way to make datagrip define the columns table names every time when I use the lightbulb to expand the column list from SELECT *. Right now, it will only explicitly define the table if there are 2 fields that are in common among the tables. I wish for it to do it for all the columns.

--example of what it does now
SELECT 
       a.id
     , number
     , name
     , b.id
 FROM       a
 INNER JOIN b ON a.id = b.a_id


--Desired result with all columns prefixed
    SELECT 
       a.id
     , a.number
     , a.name
     , b.id
 FROM       a
 INNER JOIN b ON a.id = b.a_id

Upvotes: 0

Views: 1041

Answers (1)

moscas
moscas

Reputation: 10335

Yes.

  1. Go to Settings | Editor | General | Smart keys

  2. Go to SQL section

  3. Put Always into Table and Alias

enter image description here

PS: you can also select all needed columns -> Alt+Enter -> Qualify.

Upvotes: 6

Related Questions