Skip to content

Commit 3833cd1

Browse files
Merge pull request #353 from smoothdeveloper/minor-cleanups
Minor cleanups (readme, links to gitter and nuget, sample in FSI)
2 parents d4f53d3 + c6afea4 commit 3833cd1

File tree

2 files changed

+54
-7
lines changed

2 files changed

+54
-7
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Contribution guidelines
2+
3+
Contributions to this repository are welcome, you can engage with users and contributors [on Gitter https://gitter.im/fsprojects/FSharp.Data.SqlClient](https://gitter.im/fsprojects/FSharp.Data.SqlClient) chat room.
4+
5+
## Code and documentation contributions:
6+
7+
There is very low bar for submitting a PR for review and discussion, changes to code that will get merged will generally requires a bit of back and forth beyond simplest fixes.
8+
9+
### Contributing to the docs
10+
11+
The best way is to pull the repository and build it, then you can use those FAKE build targets (run a single target with `build.cmd TargetName -st` if you don't want to start from a clean build):
12+
13+
* **GenerateDocs** : Will run FSharp.Formatting over the ./docs/contents folder.
14+
* **ServeDocs** : Will run IIS Express to serve the docs, and then show the home URL with your default browser.
15+

README.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
1-
# SqlClient providers
1+
# FSharp.Data.SqlClient - Type providers for Microsoft SQL Server
22

3-
## SqlCommandProvider
3+
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-
Provides statically typed access to input parameters and result set of T-SQL command in idiomatic F# way.
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+
27+
## Quick Links
28+
* [Documentation](http://fsprojects.github.io/FSharp.Data.SqlClient/)
29+
* [Release Notes](RELEASE_NOTES.md)
30+
* [Contribution Guide Lines](CONTRIBUTING.md)
31+
* [Gitter Chat Room](https://gitter.im/fsprojects/FSharp.Data.SqlClient)
32+
* [FSharp.Data.SqlClient on nuget.org](https://www.nuget.org/packages/FSharp.Data.SqlClient/)
33+
## Type Providers
34+
35+
### SqlCommandProvider
36+
37+
Provides statically typed access to the parameters and result set of T-SQL command in idiomatic F# way <sup>(*)</sup>.
638

739
```fsharp
840
open FSharp.Data
@@ -30,7 +62,7 @@ seq
3062
("Tete", "Mensa-Annan", 1576562.1966M)]
3163
```
3264

33-
## SqlProgrammabilityProvider
65+
### SqlProgrammabilityProvider
3466

3567
Exposes Tables, Stored Procedures, User-Defined Types and User-Defined Functions in F# code.
3668

@@ -52,7 +84,7 @@ ProductAssemblyID: 750, StandardCost: 2171.2942, TotalQuantity: 1.00
5284
ProductAssemblyID: 751, StandardCost: 2171.2942, TotalQuantity: 1.00
5385
```
5486

55-
## SqlEnumProvider
87+
### SqlEnumProvider
5688

5789
Let's say we need to retrieve number of orders shipped by a certain shipping method since specific date.
5890

@@ -76,7 +108,7 @@ output
76108
Some (Some 1085)
77109
```
78110

79-
## SqlFileProvider
111+
### SqlFileProvider
80112

81113
```fsharp
82114
type SampleCommand = SqlFile<"sampleCommand.sql">
@@ -103,4 +135,4 @@ More information can be found in the [documentation](http://fsprojects.github.io
103135

104136
The default maintainer account for projects under "fsprojects" is [@fsprojectsgit](https://github.com/fsprojectsgit) - F# Community Project Incubation Space (repo management)
105137

106-
Thanks Jetbrains for their open source license program and providing their tool.
138+
Thanks Jetbrains for their open source license program and providing their tool.

0 commit comments

Comments
 (0)