Getting connection information in query
Options
I'm using ToDump(...) in MyExtensons to change Dump() display of certain type. I'm trying to replace it with url. The host address i'd like to use is entered as one of configuration parameters in context driver setup (custom driver).
I'm struggling to get IDatabaseInfo or IConnectionInfo information stored in driver configuration, either from MyExtensions or UserQuery context - is this possible at all?
I'm struggling to get IDatabaseInfo or IConnectionInfo information stored in driver configuration, either from MyExtensions or UserQuery context - is this possible at all?
Comments
-
No, it's not possible (but perhaps it should be). I'll think this over and consider adding a static property to the next build to expose this.
-
That would be really helpful, thanks for considering this!
-
I've just uploaded a new beta with a static property that will return the current data context driver (DataContextDriver.Current). You can use the Name property of the data context driver to determine whether your custom driver is active.
To obtain the current IConnectionInfo, use Util.CurrentQuery.GetConnectionInfo().