Conversation
|
Hi @efung ! Thanks for this. I am off for a bit but will have a look in the next couple of weeks |
|
I have done a couple of tests but will need to do more and most likely modify slightly this PR. It might take a few days. The first issue I see is that I also want to test the performance a bit. The first tests I did on my machine were quite slow (~1 sec to return completion results), whereas the (incomplete) current version returns results immediately. |
|
I just raised an issue in dbt-core about the performance hit of this approach and whether it can be fixed on the Core side |
What
Integrate the output of the Click shell completion script into this one. This gives this script completion for commands and parameters, while preserving the previous functionality.
Resolves #20
How
I ran
_DBT_COMPLETE=bash_source dbtand then added it to anelseblock in the check that looks for the selector flag. In addition, since this introduces a dependency ondbton this script, I added a check for dbt to bail out early if it's not actually installed or available.Sample shell transcript
Testing
I'm using dbt 1.5.2 on macOS 14.3. The dbt version shouldn't matter, as the completion uses the current dbt.