thomaslevesque / CosmosDBStudio

A tool to browse and query Azure Cosmos DB databases
MIT License
54 stars 12 forks source link

Cache trees and remember position in "pick a container" #45

Open Arithmomaniac opened 3 years ago

Arithmomaniac commented 3 years ago

Switching containers via "pick a container" is slower than it should be, because you have to drill down through the accounts and databases to find your container, but there are usually (often?) loaded on-demand.

It seems that the app would be faster if all "pick a container" trees and the tree on the left-hand side of the program shared a common state, so that if a node is loaded in one it does not need to be reloaded in the other. Like in SSMS, a "refresh" option would be available on each node for if/when needed.

Once this is available, the "pick a container" tree could be unfolded on opening to the current location.

thomaslevesque commented 3 years ago

Hi @Arithmomaniac,

The app maintains one connection for each Cosmos DB account, so once you're connected to an account, loading the databases/containers/etc. should be pretty fast, unless the network is really bad.

That being said, sharing state between the " account explorer" tree view on the left and the "pick a container" tree view would certainly be useful, as it would avoid having to navigate to the container again. I'll keep this in mind.

BTW, I'm not sure if you've noticed, but you can also choose a container for a query sheet without using the "Pick a container" dialog: just select the container node in the "account explorer" on the left, and a "Use \<container>" link will appear at the top of the query sheet (I stole this idea from LinqPad!). I improved this a little just yesterday, but the change isn't released yet.

https://user-images.githubusercontent.com/1864281/96516107-d0901600-1266-11eb-9b5b-94b344fd640c.png