I suggest we ...

Allow static arguments to Type Provider methods eg M<"ABC">()

This in addition to static arguments to types.
Use case:
http://fsprojects.github.io/FSharp.Data.SqlClient/
SqlCommandProvider typical usage is

type MyCommand1 = SqlCommandProvider<"SELECT 42", connStr>
type MyCommand2 = SqlCommandProvider<"SELECT 43", connStr>

Some information as connection string and database-level info (user defined types for exaample) can be shared. Only query itself is different. It will look like:

type MyDb = SqlCommandProvider<connStr>

type MyCommand1 = MyDb.GetCommand<"SELECT 42">
type MyCommand2 = MyDb.GetCommand<"SELECT 43">

Shared db definition will bring performance benefits to this particular provider. Sharing types (especially user defined table types used for table-valued parameters) will allow to pipe output of one command into input param of another.

This change will enable to merge SqlCommandProvider and SqlProgrammability into single cohesive type provider

type AdventureWorks = SqlClient<connStr>

Triggered by dsyme tweet
https://twitter.com/dsyme/status/430094038771843072

17 votes
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
Dmitry Morozov shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...

F# Language

Feedback and Knowledge Base