Refresh Schema Explorer programmatically from dynamic driver
I'm creating a dynamic driver. I would like to allow the users of the driver to configure the driver via an API embedded in the driver and when they have, I want to programmatically kick off a schema explorer refresh.
I've read about overriding GetLastSchemaUpdate
which will react to "old fashioned" SQL statements, but this doesn't suit my needs.
Is there a way?
Comments
There's no way to do this, and it's a reasonable request.
Would it help if I added the following method to IConnectionInfo?
The obvious place to call this would be in the OnQueryFinishing method of your DataContextDriver. However, you could call it earlier if you cached the IConnectionInfo:
Would this work for you?
I believe that would do the trick. Thanks!
This feature is now supported in the latest beta (6.9.2). Note that for now, you will need to reference the latest preview package of LINQPad.Reference (1.2.0-beta) in your driver project.
Let me know how you get along.
Thanks, joe. I'll test shortly.
This works well for me:
I noticed that the reference assembly for LINQPad 5 did not include the new method. Will
cxInfo.ForceRefresh()
be available in v5?I wanted to handle the absence of
ForceRefresh()
gracefully, like this:This won't work because
ForceRefresh()
is a default interface implementation. Apparently the DLR cannot dispatch to those.Looks like reflection will work for me.
You could do this: