-
Notifications
You must be signed in to change notification settings - Fork 71
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
Generated types #11
Comments
@rojepp While thinking about implementation for this feature I realized that to be usable from C# Task<'T> should be return for async ops instead of Async<'T>, right? |
Having Generated types would make it usable from C#, but you are right, the Async would not be comfortable. :) I've been thinking that Execute/AsyncExecute do too much, in that they manage the connection. This means that Execute/AsyncExecute can not be part of a transaction. Can you think of a nice design around this, while still keeping comfortable Execute/AsyncExecute? |
@rojepp In current implementation command can be part of transaction via auto-enlist feature http://stackoverflow.com/questions/2884863/under-what-circumstances-is-an-sqlconnection-automatically-enlisted-in-an-ambien |
Enlisting/Opting out via Transaction scopes is fine by me. I just didn't realize it would work when closing the connection explicitly. Thanks. |
Transaction support something that might be necessary. Let's keep it open . |
I agree. But I also think most modern code (the kind of code that would consider using this TP) would probably use TransactionScopes, so it's not a priority to me. |
Small update: I've been able to remove a few obstacles here, but I'm stumbling upon this: |
At this point I'm convinced that C# friendly provider should be separated type. Differences are too many to have it in same type. We'll probably can archive some code reuse with erased types version. |
Having a generated type is still useful even in F#, if it can be done without complicating things too much:
I'd like to leave this open until we know more. |
@rojepp I know you're working on generated types version. As far as understand driving force is make usable from C#. I'm not sure what you meant by "Should be less time to get the first result" because in general erased types TPs are faster at run-time than generated types TP.
Unless all above done it cannot be presented to c# community because it will cause negative reaction. |
I agree on all of these points. Getting it running at all (while avoiding a |
IMHO it's a mistake to work on making SqlCommandTypeProvider C# friendly, or even C# usable. Concentrate instead on making it the best possible tool for F#. Making it C# usable will do nothing to encourage C# programmers to learn F#. Seeing how well this works in F# will do more to encourage F# adoption. The SQL tools available in C# are too evolved and too entrenched. |
That's why I would to hear some guidelines from gurus like Don Syme and Tomas Petricek.
|
I am a couple of minor releases behind, but I applied SqlCommandTypeProvider to a real world problem on a real world legacy production SQL DB, and it my opinion it is by far the best solution for reading SQL Server in the F# world (haven't tried writing yet, but that is next). I recognize some minor limitations, and in the unlikely event I ran into them I could always fall back on @mausch's very usable solution. I am very interested in seeing this project progress for the F# community. C# compatibility is attempting too much for no good purpose. |
I'm thinking it's a way to get people to hit that 'New F# project' button, |
It is, but you could do a C#-compatible fork, couldn't you? Using generated types has advantages but might prevent the TP becoming stable quickly and addressing other usability concerns. BTW I love how simple this TP is! Just my 2c worth, I haven't thought about this much or used the TP. Don't take my comments too seriously :) |
@rojepp I will take the liberty to interpret @dsyme's comment. Instead the separate fork I would rather have separate type provider. Some code reuse can be archived internally. Deep down I think @jackfoxy is right - we won't be able to convert C# dev to F# by providing gen types versions of TPs. That said, I'm still willing to give it a shot. But i suggest first to stabilize API and release erased types version 1.0. Once we're satisfied with design and quality we'll work on gen. types version. |
Well some TPs would prove useful to C# devs, I think not one for SQL Server, however. |
@jackfoxy Where do you get that idea from? I've shown this TP to a few C#-minded colleagues, and all were amazed, and the first question was, 'Can this be used from C#'? Perfect for LOB apps. |
I had the opposite reaction, “if it’s not entity framework, I’m not interested”. Anyway,from my perspective it’s better to get the project rock-solid in F# and documented first before worrying about C# interop. Sent from Surface From: Robert Jeppesen @jackfoxy Where do you get that idea from? I've shown this TP to a few C#-minded colleagues, and all were amazed, and the first question was, 'Can this be used from C#'? Perfect for LOB apps. — |
There are lots of devs who wouldn't touch EF with a ten foot pole. Myself included. ;) |
Just to get a conversation started..
It would be nice if types could be generated instead of erased. This would enable use from C#. I have never made a generated type, so I have no idea how much work would be involved.
The text was updated successfully, but these errors were encountered: