Azuredatastudio: Can intellisense expand column names?

Created on 7 Nov 2018  路  12Comments  路  Source: microsoft/azuredatastudio

In almost all SQL intellisense, when you type Tab after * or sometable in the following example, all column names can be auto filled. But I can't figure out where this is. Can someone give a hint? Thanks.

SELECT * FROM sometable
INSERT INTO sometable

  • Azure Data Studio Version: 1.2.4
Area - Language Service Enhancement

Most helpful comment

"Star expanstion" should work for SQL in Azure Data Studio and SQL Server Management Studio and Visual Studio, out of the box. The implementation should be:

  • When you press TAB (or whatever the autocomplete key is) after the asterisk character the editor should insert a formatted list of all the columns implied by the corresponding "from" clause and query context.
  • If the asterisk stands alone the resulting list should contain all columns from all tables/views/etc. implied by "from." In other words, all the columns that server would use in the execution of the query with the *.
  • If the asterisk is qualified by a table alias ( a.* ) then the list should contain all columns from the table that uses that alias ( sometable as a ). As above, this means the set of columns the server would use in the execution of the query.
  • The list should resolve and insert correct aliases as given by the context (ie. if columns come from "sometable as a" then the generated list should be like "a.col1, a.col2" etc.)
  • The list should be formatted. That means it should contain square brackets [] around _only the column names where needed_, likely those names that are keywords, or contain spaces, or other syntax anomalies that require the brackets. The list should contain a line break after each column name, not spew out in one long line of code. The editor should provide a preference as to whether the comma separating each name is automatically placed after each item or before.

I know the code exists to do this because SSDT does this star expansion already, as do many third party tools. SSMS allows you to drag a column folder out of the object explorer, and thought the quality of that implementation is very poor (square brackets all the time for tables but never for views, for example) it does yield a list of columns. Hovering over the "*" also produces a tooltip with the list of columns.

All 12 comments

"Star expanstion" should work for SQL in Azure Data Studio and SQL Server Management Studio and Visual Studio, out of the box. The implementation should be:

  • When you press TAB (or whatever the autocomplete key is) after the asterisk character the editor should insert a formatted list of all the columns implied by the corresponding "from" clause and query context.
  • If the asterisk stands alone the resulting list should contain all columns from all tables/views/etc. implied by "from." In other words, all the columns that server would use in the execution of the query with the *.
  • If the asterisk is qualified by a table alias ( a.* ) then the list should contain all columns from the table that uses that alias ( sometable as a ). As above, this means the set of columns the server would use in the execution of the query.
  • The list should resolve and insert correct aliases as given by the context (ie. if columns come from "sometable as a" then the generated list should be like "a.col1, a.col2" etc.)
  • The list should be formatted. That means it should contain square brackets [] around _only the column names where needed_, likely those names that are keywords, or contain spaces, or other syntax anomalies that require the brackets. The list should contain a line break after each column name, not spew out in one long line of code. The editor should provide a preference as to whether the comma separating each name is automatically placed after each item or before.

I know the code exists to do this because SSDT does this star expansion already, as do many third party tools. SSMS allows you to drag a column folder out of the object explorer, and thought the quality of that implementation is very poor (square brackets all the time for tables but never for views, for example) it does yield a list of columns. Hovering over the "*" also produces a tooltip with the list of columns.

Any news here? This is a MAJOR adoption blocker...

Bumping this, Azure Data Studio is unusable without this feature.

Any news here ?

Asking for the same feature, could be awesome to implement!

Bumping to keep this alive... please implement!!!

I too will bump this to ask you to implement. It feels like it should be quite easy, if you hover over the * right now it lists the columns there in a popup, surely making it type this out for you is possible?

While I am using ADS I feel like I shouldn't simply because star expansion is missing. Please, implement this.

Bump.

Bumping, this feature would be insane.

Please add this. The lack of this feature slows me down a lot. It is biggest reason why I'm not moving over to ADS.

Thank you.

To all who have been holding your breath. This feature as well as many many others that Azure Data Studio are lacking are available in IntelliJ IDEA / Datagrip.

I did not make the transition earlier because I needed to log into my MSSQL DB on my Mac through Kerberos and I thought ADS was the only way to do it. I figured it out with IntelliJ and now I am permanently getting rid of ADS.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kburtram picture kburtram  路  3Comments

Ungerfall picture Ungerfall  路  3Comments

blackTay picture blackTay  路  3Comments

squillace picture squillace  路  3Comments

jacobzed picture jacobzed  路  3Comments