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
456 stars 89 forks source link

Support Live-Share for collaborative editing #558

Open quimnuss opened 1 year ago

quimnuss commented 1 year ago

Describe the feature

Live share is essential to everybody doing pair-programming and according to vscode's live-share FAQ, extensions should work with minor changes.

Is it feasible?

Describe alternatives you've considered

Not using dbt power user

Who will benefit?

Everybody doing pair-programming in dbt

Are you willing to submit PR?

anandgupta42 commented 1 year ago

@quimnuss This seems like an excellent idea. Also, Thank you for volunteering to build out the feature. Looking forward to the PR. Check out the contribution guideline also. Let us know if you need any help.

polmonso commented 1 year ago

If dbt power user absolutely requires reading files under /target it might not be possible since guests do not have local access to files outside the workspace. I'm unsure if a degraded experience can be offered nonetheless, hopefully it could read the guest's dbt profiles instead of the host's.

How is the extension retrieving this info at the moment?

I'll try to dig a bit deeper... any help appreciated 😃

mdesmet commented 1 year ago

Could you elaborate on what operations you tried when doing a iive share session and what kind of result/errors you faced?

mdesmet commented 1 year ago

How is the extension retrieving this info at the moment?

The extension relies on the dbt profile information to connect to the database (typically stored in ~/.dbt/. it also uses node's fs library extensively to read files. Both of these are not supported.

It also launches a Python process to interact with dbt.

quimnuss commented 1 year ago

You asked about how does this degraded experience behave and what we tried to do. The guest can't Run model, preview compiled query nor see the nice-to-have lineage tab, the documentation helpers and so on. Naturally, none of these work, since they heavily rely on fs. It doesn't do anything when you press the buttons if you're the guest. I believe even traveling across models doesn't work either.

Some postgres extensions manage to pull a local config from the guest and run a query you're working together, but for dbt power user sounds complicated to achieve the same quality of life. I'll try to learn a bit more on how do other extensions deal with this, since we'd be fine creating a copy of target or using the guest's profiles. Sounds unpromising tho.

At the moment our workflow is the host previews the compiled query, then both participants can see it and the guest can run it using other postgres/sql extensions without leaving the editor.