-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Schema not refreshed upon alteration of connected database. #12
Comments
Will this ever get fixed? It's been like this since at least 2011 according to an SO question I saw. |
I do not remember this problem when recompiling in Visual Studio 2015. Are you also referring to recompiling ? In visual studio 2017 when I recompile I do not see any changes reflected. |
Unload/Reload project seems to help in VS 2017 |
Problem seem to still exist in VS 2019, is there a way to force an update? |
Unload and reload appears to work in VS 2019 16.4.0 About the issue, I understand that it's probably difficult to receive push messages from the database about schema changes. However, the schema should at least be reloaded on (re)build, which is not the current behaviour. |
Note this is a very old collection of type providers that are Windows-specific and .NET Framework-specific. For up-to-date type providers see https://fsharp.org/guides/data-access/ For WSDL see https://github.com/fsprojects/FSharp.Data.WsdlProvider for a more recent provider, also https://github.com/fsprojects/SwaggerProvider |
@dsyme Where's the source for https://fsharp.org/guides/data-access? Could Facil be added to it? |
@cmeeren Click "edit this page" at the bottom of the page :)
Absolutely |
Would you like to move "Facil" to fsprojects? Open invitation. Policies are here: https://github.com/fsprojects/fsprojects-admin |
Thanks for the offer, but it's not a good fit for fsprojects the way I understand the policies. For one thing, it's been at 1.x and fairly stable for a good while now, so it's not really incubating. I therefore respectfully decline the invitation to move it to fsprojects. |
This is a re-post of an issue from the main VisualFSharp GitHub site upon recommendation from @dsyme. Original here: dotnet/fsharp#1301
Description
If the schema of a database to which there is a connection via type providers SqlDataConnection or SqlEntityConnection is altered, the changes are not accessible within Visual Studio and are not represented by IntelliSense.
However, changing the connection string in some "insignificant" way, such as adding white space, will force the refresh of the schema. Restarting Visual Studio will also refresh the schema.
This is okay when working with an established, production database, but when developing a database and making frequent changes to it, this becomes very annoying.
Repro steps
Connect to a database via an SQL type provider. Add and/or drop tables from database (other changes not tested). Try to refer to the new tables within code.
Expected behavior
That changes to database schema be immediately reflected in IntelliSense and usable in code.
Actual behavior
Old schema still present in IntelliSense, e.g., no newly added tables are accessible, and dropped tables are still listed. Even turning off "Statement Completion" doesn't help. Reference to a new table shows as an error.
There is no background process to detect changes to database structure and update the schema upon which F# is operating.
Known workarounds
Add white space to connection string which doesn't affect the functionality. Example:
"Data Source=(localdb)\ProjectsV13;Initial Catalog=db"
can be changed to"Data Source =(localdb)\ProjectsV13; Initial Catalog = db"
(spacing placed around equals and semicolon)Related information
All versions of F# and Visual Studio to-date.
Feature Request
Response from @dsyme: "Presumably that would work by a regular background task polling the database to look for schema changes."
I have no way of knowing if this is feasible, but it would be WONDERFUL if it were fixed. I assume that the issue revolves around the IDE.
The text was updated successfully, but these errors were encountered: