AltimateAI / vscode-dbt-power-user

This extension makes vscode seamlessly work with dbt™: Auto-complete, preview, column lineage, AI docs generation, health checks, cost estimation etc
https://www.altimate.ai
MIT License
452 stars 86 forks source link

Expand `SELECT *` into explicit list of columns #1229

Open bdtoole opened 3 months ago

bdtoole commented 3 months ago

Describe the feature

It would be great to be able to type expand out any SELECT * statements to be a select statements with the columns explicitly listed. Preferably, you could also specify if you wanted leading or trailing commas (perhaps via a configuration setting). The ultimate goal would be to be able to quickly replace

SELECT *
  FROM table

with something similar to

SELECT column_1
     , column_2
     , column_3
     ...
     , column_n
  FROM table

or

SELECT column_1,
       column_2,
       column_3,
     ...
       column_n
  FROM table

I realize the formatting and alignment nature might be tricky, so even if it was something like this, it would be a win, given how easy it is to select multiple lines and tab/space over the indentation.

SELECT
column_1
,column_2
,column_3
...
,column_n
  FROM table

Describe alternatives you've considered

Functionality like this exists in multiple IDEs already, such as Deep Channel and Y42.

Who will benefit?

Anyone that wants to easily replace * with a list of columns.

Are you willing to submit PR?

sweep-ai[bot] commented 2 months ago
Sweeping

0%
💎 Sweep Pro: You have unlimited Sweep issues

Actions


[!TIP] To recreate the pull request, edit the issue title or description.