I have looked through a number of Type Provider samples and videos and have always seen them to be read-only. My questions: Are Type providers always read-only or can they also provide write access? Is there an example for providing/using write access?
As mentioned by John, the standard SQL type provider allows you to create new entities and store them in the database and there are no theoretical reasons why this would not be possible (you can emit mutable properties).
The F# Data type providers are generally read only, but an older version of the document (JSON, XML, ...) used to emit mutable properties, so you could modify JSON and XML files. You can have a look at the samples in tests here. The same branch also includes source code for the provider implementation (if you wanted to have a look at that).
I think that the problem with write API is that it is quite difficult to design. For some of the discussions about this, see this discussion and the FSharpX issues linked from there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With