Skip to content

Commit a5b454f

Browse files
committed
Merge remote-tracking branch 'remotes/upstream/master' into temp-tables
# Conflicts: # RELEASE_NOTES.md # src/SqlClient/DesignTime.fs
2 parents d60ead7 + 7c311d1 commit a5b454f

27 files changed

+237
-102
lines changed

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[![Issue Stats](http://issuestats.com/github/fsprojects/FSharp.Data.SqlClient/badge/issue)](http://issuestats.com/github/fsprojects/FSharp.Data.SqlClient)
2-
[![Issue Stats](http://issuestats.com/github/fsprojects/FSharp.Data.SqlClient/badge/pr)](http://issuestats.com/github/fsprojects/FSharp.Data.SqlClient)
3-
41
SqlClient providers [![NuGet Status](http://img.shields.io/nuget/v/FSharp.Data.SqlClient.svg?style=flat)](https://www.nuget.org/packages/FSharp.Data.SqlClient/)
52
==============================
63

@@ -10,9 +7,6 @@ SqlProgrammabilityProvider exposes Stored Procedures, User-Defined Types and Use
107

118
More information can be found in the [documentation](http://fsprojects.github.io/FSharp.Data.SqlClient/).
129

13-
14-
15-
1610
Build Status
1711
-----------
1812

@@ -23,6 +17,7 @@ Build Status
2317

2418
- [@dmitry-a-morozov](https://github.com/dmitry-a-morozov)
2519
- [@dsevastianov](https://github.com/dsevastianov)
20+
- [@vasily-kirichenko](https://github.com/vasily-kirichenko)
2621

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

RELEASE_NOTES.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
#### 1.8.3.1 - Nov 21, 2017
2-
* Temp Table
3-
4-
#### 1.8.3 - Aug 12, 2016
1+
#### 1.8.4 - May 12, 2018
2+
* Issue #221 - Expose custom getter/setter methods on provided DataColumn properties
53
* Issue #224 - TVP generated type implicitly from SqlDataRecord.
64
* Issue #232 - BREAKING CHANGE! SqlFile type provider is a new way to feed external sql files into SqlCommandProvider/CreateCommand
75
* Issue #233 - Optional continueUpdateOnError parameter added Update method on statically typed data tables
86
* Issue #234 - Design-time captured value of named connection string used at runtime if code runs under fsi.exe
7+
* Issue #252 - Add factory method to SqlProgrammabilityProvider-generated types
8+
* Issue #280 - Upgrade TSQL parser version
9+
* Issue #286 - SqlCommand disposes underlying connection in its Dispose method
10+
* Issue #289 - Pass `null` if table value argument has zero records
911

1012
#### 1.8.2 - May 16, 2016
1113
* Issue #192 - Invert order of release notes so most recent is on top

SqlClient.sln

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27004.2006
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.24720.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{7ECDF2A7-A71C-43B5-AFF2-64468098B7B6}"
77
ProjectSection(SolutionItems) = preProject
@@ -70,7 +70,4 @@ Global
7070
{573DBBFB-0F97-4327-8614-6A4151CD70BF} = {61AC061E-5824-41B7-8E09-8D3A73D564E5}
7171
{CB79269B-025B-4D6A-AF84-0AD821F6A602} = {573DBBFB-0F97-4327-8614-6A4151CD70BF}
7272
EndGlobalSection
73-
GlobalSection(ExtensibilityGlobals) = postSolution
74-
SolutionGuid = {8ADC7AFF-DF1C-4FAD-B3AD-63B3A8ED9F99}
75-
EndGlobalSection
7673
EndGlobal

build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
22
if not exist packages\FAKE\tools\Fake.exe (
3-
.nuget\nuget.exe install FAKE -OutputDirectory packages -Prerelease -ExcludeVersion
3+
.nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion -Version 4.1.2
44
)
55
packages\FAKE\tools\FAKE.exe build.fsx %*

build.fsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let release =
3535

3636
let version = release.AssemblyVersion
3737
let releaseNotes = release.Notes |> String.concat "\n"
38-
let testDir = "Build/Tests"
38+
let testDir = "bin"
3939

4040
// --------------------------------------------------------------------------------------
4141
// Generate assembly info files with the right version & up-to-date information
@@ -48,7 +48,8 @@ Target "AssemblyInfo" (fun _ ->
4848
Attribute.Product project
4949
Attribute.Description summary
5050
Attribute.Version version
51-
Attribute.FileVersion version] )
51+
Attribute.FileVersion version
52+
Attribute.InternalsVisibleTo "SqlClient.Tests" ] )
5253
)
5354

5455
// --------------------------------------------------------------------------------------

docs/content/comparison.fsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,18 @@ Not so good:
5858
- By default supports only Microsoft SQLServer and T-SQL
5959
- Code overhead if you have a large amount of different small operations
6060
- Doesn't generate domain model for work with C#
61+
- No support for .NET Standard / .NET Core
6162
6263
### SQLProvider
6364
6465
Good:
6566
66-
- Supports any database (MSSQL, MySQL, Postgre, Oracle, Odbc, ...)
67+
- Supports any database (MSSQL, MySQL, PostgreSQL, Oracle, Odbc, ...)
68+
- Supports .NET Standard and .NET Core
6769
- Changing the database is not actually huge work
6870
- Makes effective simple SQL
6971
- Supports async database operations
72+
- Used in production for enterprise development for years
7073
- Simplifies user code
7174
- Open source
7275
@@ -84,6 +87,7 @@ Good:
8487
8588
- You can use generated DB-model from C#-projects
8689
- Supports even complex LINQ-operations
90+
- Used in production for enterprise development for years
8791
8892
Not so good:
8993
@@ -93,6 +97,25 @@ Not so good:
9397
- FSharp/LINQ query-syntax is a learning curve
9498
- Closed source
9599
- Supports only Microsoft SQLServer
100+
- No support for .NET Standard / .NET Core
101+
102+
### Rezoom.SQL
103+
104+
Good:
105+
106+
- User has full control of SQL
107+
- Which allows full utilization of database indexes with complex queries
108+
- SQL syntax is already familiar for many
109+
- Supports SQLite, SQL Server, and PostgreSQL
110+
- Open source
111+
112+
Not so good:
113+
114+
- No support for .NET Standard / .NET Core
115+
- No support for MySQL, Oracle, ...
116+
- Code overhead if you have a large amount of different small operations
117+
- Doesn't generate domain model for work with C#
118+
96119
97120
[Dapper](https://code.google.com/p/dapper-dot-net/)
98121
-----------------------------------------

docs/content/faq.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Following command allows to filter dynamically information on sales people based
7171
(**
7272
### 4. Why do I get compile time error " ... The undeclared parameter '@p1' is used more than once in the batch being analyzed."?
7373
74-
This is a limitation of [sys.sp_describe_undeclared_parameters](https://msdn.microsoft.com/en-us/library/ff878260.aspx).
74+
This is a limitation of [sys.sp\_describe\_undeclared\_parameters](https://msdn.microsoft.com/en-us/library/ff878260.aspx).
7575
7676
To work around this limitation, you can declare another variable in your script:
7777
@@ -136,4 +136,4 @@ There are two cases when you would get those extra methods.
136136
* Referencing a Table Valued Function
137137
138138
In both cases the methods return `Option<'T>` (or `Async<Option<'T>>`) rather than `Seq<'T>` (or `Async<Seq<'T>>`)
139-
*)
139+
*)
-2.75 MB
Binary file not shown.

src/SqlClient.Tests/CreateCommand.fs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,17 @@ let CreareDynamicRecords() =
173173
|> Seq.toArray
174174
|> ignore
175175

176+
177+
[<Fact>]
178+
let ``connection is properly disposed`` () =
179+
180+
let mutable connection : SqlConnection = null
181+
let mutable isDisposed = false
182+
do
183+
use cmd = DB.CreateCommand<"exec dbo.[Get]", ResultType.DataReader>()
184+
connection <- (cmd :> ISqlCommand).Raw.Connection
185+
connection.Disposed.Add(fun _ -> isDisposed <- true)
186+
use reader = cmd.Execute()
187+
()
188+
189+
Assert.True isDisposed

src/SqlClient.Tests/DataTablesTests.fs

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,36 @@ type DataTablesTests() =
296296
// getting value same way as a plain datatable still yields DBNull
297297
Assert.Equal(DBNull.Value, r.[t.Columns.d] :?> DBNull)
298298

299+
[<Fact>]
300+
member __.``Can use datacolumns GetValue and SetValue methods`` () =
301+
let t = (new GetArbitraryDataAsDataTable()).Execute()
302+
let r = t.Rows.[0]
303+
let a, b, c, d =
304+
t.Columns.a.GetValue(r)
305+
, t.Columns.b.GetValue(r)
306+
, t.Columns.c.GetValue(r)
307+
, t.Columns.d.GetValue(r)
308+
309+
Assert.Equal(r.a, a)
310+
Assert.Equal(r.b, b)
311+
Assert.Equal(r.c, c)
312+
Assert.Equal(r.d, d)
313+
314+
// need to make column readonly = false in order to use SetValue from the DataColumn
315+
t.Columns.a.ReadOnly <- false
316+
t.Columns.b.ReadOnly <- false
317+
t.Columns.c.ReadOnly <- false
318+
t.Columns.d.ReadOnly <- false
319+
320+
t.Columns.a.SetValue(r, 108)
321+
t.Columns.b.SetValue(r, 108)
322+
t.Columns.c.SetValue(r, 108)
323+
t.Columns.d.SetValue(r, Some 108)
324+
325+
Assert.Equal(r.a, 108)
326+
Assert.Equal(r.b, 108)
327+
Assert.Equal(r.c, 108)
328+
Assert.Equal(r.d, Some 108)
299329

300330
[<Fact>]
301331
member __.``Can use DataColumnCollection`` () =
@@ -317,12 +347,21 @@ type DataTablesTests() =
317347
let products = new AdventureWorks.Production.Tables.Product()
318348

319349
let product = products.NewRow()
320-
product.Name <- "foo"
350+
351+
// can use SetValue
352+
let newName = "foo"
353+
products.Columns.Name.SetValue(product, newName)
354+
Assert.True(product.Name = newName)
321355

322356
// use as plain DataColumns
323357
let name = product.[products.Columns.Name] :?> string
324358
Assert.True(product.Name = name)
325-
359+
360+
// can use GetValue
361+
product.FinishedGoodsFlag <- true
362+
let finishedGoodsFlag = products.Columns.FinishedGoodsFlag.GetValue(product)
363+
Assert.Equal(product.FinishedGoodsFlag, finishedGoodsFlag)
364+
326365
[<Fact>]
327366
member __.``Can use Table property on SqlCommandProvider's rows`` () =
328367
use cmd = new GetArbitraryDataAsDataTable()

0 commit comments

Comments
 (0)