title: Grouping multiple LinqPad data context connections
body: <p>I have a data source for which I would like to build a LinqPad data context driver. The structure of the data source is fairly simple to that of relational database servers: I too have a "server", which can manage multiple "databases", which can include "tables".</p>
  
  <p>I have read the available documentation and checked out the sample <a href="https://www.linqpad.net/extensibility.aspx" rel="nofollow noreferrer">here</a>, and I have been able to create the driver. </p>
  
  <p>However, when I connect more time to different "databases" on the same "server", they show up under a new item in the tree, like this:</p>
  
  <p><img src="https://i.stack.imgur.com/ZlJsr.png" alt=""></p>
  
  <p>I would like to mimic the way the Default (LINQ to SQL) built-in provider works, which has an option to create multiple connections, using the "Display all in a Treeview" option:</p>
  
  <p><img src="https://i.stack.imgur.com/EPG2Q.png" alt=""></p>
  
  <p>Which results in one treenode for the server, and if I expand the treenode, I have all the databases:</p>
  
  <p><img src="https://i.stack.imgur.com/EOu9y.png" alt=""></p>
  
  <p>I do believe that these are actually different connections, because they show up in the connection selection drop-down as different items.</p>
  
  <p>I tried to point the connection to the "server" instead of the "database", querying all the "databases". The problem with this approach is that in this case only one typed datacontext is created, but I need one for each of my "databases", because the actual name of the "database" is an argument that my context needs, so that it can access the data (and since EF DbContexts also need the database name in the connection string, I'm pretty sure that the connections in my last picture each have a different context just for themselves with their specific connection string also).</p>
  
  <p>I also looked through the API as much as I could just to see if I can "attach" the new node to an existing node in the tree, but I don't see any API for querying the existing items.</p>
  
  <p>Is there any way to do this, or this requires some internal APIs?</p>