mausch / FsSql

Functional wrapper around ADO.NET for F#
https://www.openhub.net/p/FsSql
Apache License 2.0
67 stars 15 forks source link

SQL type provider #12

Closed mausch closed 11 years ago

mausch commented 13 years ago

Statically check SQL strings using a type provider, like Nemerle's SQL macro: http://nemerle.org/wiki/index.php?title=SQL_macros

panesofglass commented 12 years ago

I wish there were a way to vote for issues. :) This is awesome. Would it be a better fit for FSharpx?

mausch commented 12 years ago

Well, leaving a comment counts as a vote :) With the SqlDataConnection type provider and enhanced computation expressions in F# 3.0 this isn't so relevant...there will always be some scenarios that require dropping to raw SQL though. FSharpx could include a basic type provider that returns just the SQL string (validating at compile-time of course), but more generally this would involve actually running the query and returning the results, which involves connection life management, etc.

panesofglass commented 12 years ago

Given the syntax in the FSharpx list, I would think we could add overloads that took an existing connection or created a new one should no connection be provided. I haven't played with Type Providers yet -- bad me -- but I would think that would be doable.

mausch commented 11 years ago

https://github.com/dmitry-a-morozov/FSharp.Data.SqlCommandTypeProvider implements this