Skip to content

Commit 13932ab

Browse files
Update README.md
1 parent 4a37a36 commit 13932ab

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22

33
This library exposes SQL Server Database objects in a type safe manner to F# code, by the mean of [Type Providers](https://docs.microsoft.com/en-us/dotnet/fsharp/tutorials/type-providers/)
44

5+
You can reference it in F# Interactive that ships with Visual Studio
6+
```fsharp
7+
#r "nuget: FSharp.Data.SqlClient"
8+
open FSharp.Data
9+
open FSharp.Data.SqlClient
10+
let [<Literal>] connectionString = "Server=.;Database=AdventureWorks2012;Trusted_Connection=True;"
11+
type MyCommand = SqlCommandProvider<"""
12+
select
13+
data.a
14+
from
15+
(select 1 a union all select 2 union all select 3) data
16+
where
17+
data.a > @data
18+
""", connectionString>;;
19+
20+
(new MyCommand(connectionString)).Execute(data=1)
21+
|> Seq.toArray
22+
|> printfn "%A"
23+
```
24+
25+
`dotnet fsi` is not supported yet.
26+
527
## Quick Links
628
* [Documentation](http://fsprojects.github.io/FSharp.Data.SqlClient/)
729
* [Release Notes](RELEASE_NOTES.md)

0 commit comments

Comments
 (0)