FSharp.Data.SqlClient icon indicating copy to clipboard operation
FSharp.Data.SqlClient copied to clipboard

Generated types SqlCommand type provider. Records only.

Open dmitry-a-morozov opened this issue 9 years ago • 1 comments

With introduction of Execute method SqlClient (former SqlProgrammability) type provider covers a lot of same uses cases as SqlCommand type provider. It will create confusion among users and lead to code duplication in the implementation. I would like to use major version V2 with breaking changes (see issues #159 and #161) as an opportunity to optimize SqlClient and SqlCommand type providers for different scenarios. By making SqlCommand type provider "generated types" kind we can address following:

  • Interop with C#.
  • I believe issue #123 will be also fixed

Restricting item type to Records makes implementation simpler and provides better performance at design time. Additional types (Tuples, DataTable and DataReader) will be supported by Executeon SqlClient type provider (former SqlProgrammability)

SqlCommand type provider lands itself as good candidate for generated types because of very small type surface (only 2: command + record). Presence of TVP might cause extra type generation but it won't impact performance or implementation complexity much .

dmitry-a-morozov avatar Sep 21 '15 03:09 dmitry-a-morozov

What are the implications if we were to support typed DataTable with generated types?

I'm now using those in favor of records because it is suitable for binding / processing with many tools in .net eco-system, change detection & all.

smoothdeveloper avatar May 19 '16 20:05 smoothdeveloper