Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Experimental] Compile against Microsoft.Data.SqlClient #375

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,5 @@ Paket.Restore.targets
/docs/output
docs/output/**/*.*
*.orig

tests/SqlClient.Tests/AdventureWorks2012_Data.mdf
10 changes: 2 additions & 8 deletions TestProjects.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2041
# Visual Studio Version 16
VisualStudioVersion = 16.0.31005.135
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{E35ED000-5A6C-49E1-82CF-55CB8C16C2AB}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -10,8 +10,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{E35ED0
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Lib", "src\SqlClient.TestProjects\Lib\Lib.fsproj", "{5DD83156-9416-439F-983A-8ED1A0F1F822}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "SqlClient.Tests.NET40", "src\SqlClient.TestProjects\SqlClient.Tests.NET40\SqlClient.Tests.NET40.fsproj", "{34413B8D-884B-4F4D-B6DC-637FAE859738}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "SqlClient.Tests.NetCoreApp", "src\SqlClient.TestProjects\SqlClient.Tests.NetCoreApp\SqlClient.Tests.NetCoreApp.fsproj", "{251C7367-0556-4831-BE20-CAF29989B833}"
EndProject
Global
Expand All @@ -24,10 +22,6 @@ Global
{5DD83156-9416-439F-983A-8ED1A0F1F822}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DD83156-9416-439F-983A-8ED1A0F1F822}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DD83156-9416-439F-983A-8ED1A0F1F822}.Release|Any CPU.Build.0 = Release|Any CPU
{34413B8D-884B-4F4D-B6DC-637FAE859738}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34413B8D-884B-4F4D-B6DC-637FAE859738}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34413B8D-884B-4F4D-B6DC-637FAE859738}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34413B8D-884B-4F4D-B6DC-637FAE859738}.Release|Any CPU.Build.0 = Release|Any CPU
{251C7367-0556-4831-BE20-CAF29989B833}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{251C7367-0556-4831-BE20-CAF29989B833}.Debug|Any CPU.Build.0 = Debug|Any CPU
{251C7367-0556-4831-BE20-CAF29989B833}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
10 changes: 2 additions & 8 deletions Tests.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2041
# Visual Studio Version 16
VisualStudioVersion = 16.0.31005.135
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{E35ED000-5A6C-49E1-82CF-55CB8C16C2AB}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -12,8 +12,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "SqlClient.Tests", "tests\Sq
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "SqlClient.DesignTime.Tests", "tests\SqlClient.DesignTime.Tests\SqlClient.DesignTime.Tests.fsproj", "{167862B2-5588-4DF8-A7D3-05C1A5A835CA}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "SqlClient.SqlServerTypes.Tests", "tests\SqlClient.SqlServerTypes.Tests\SqlClient.SqlServerTypes.Tests.fsproj", "{CF3D9433-B20A-4E5A-9401-F6518CBAD34E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -28,10 +26,6 @@ Global
{167862B2-5588-4DF8-A7D3-05C1A5A835CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{167862B2-5588-4DF8-A7D3-05C1A5A835CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{167862B2-5588-4DF8-A7D3-05C1A5A835CA}.Release|Any CPU.Build.0 = Release|Any CPU
{CF3D9433-B20A-4E5A-9401-F6518CBAD34E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF3D9433-B20A-4E5A-9401-F6518CBAD34E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF3D9433-B20A-4E5A-9401-F6518CBAD34E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF3D9433-B20A-4E5A-9401-F6518CBAD34E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
11 changes: 8 additions & 3 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,19 @@ Target.create "DeployTestDB" (fun _ ->

ZipFile.ExtractToDirectory(testsSourceRoot @@ (dataFileName + ".zip"), testsSourceRoot)

printfn "Copying file to docker: %s" sourceMdf

Shell.Exec("docker", "exec fsharpdatasqlclient_fsharp-tp-sql_1 mkdir -p /var/opt/mssql/attached") |> ignore
Shell.Exec("docker", (sprintf "cp %A %A" sourceMdf "fsharpdatasqlclient_fsharp-tp-sql_1:/var/opt/mssql/attached")) |> ignore

let dataPath =
use cmd = new SqlCommand("SELECT SERVERPROPERTY('InstanceDefaultDataPath')", conn)
cmd.ExecuteScalar() |> string
do
let destFileName = dataPath @@ Path.GetFileName(sourceMdf)
File.Copy(sourceMdf, destFileName, overwrite = true)
File.Delete( sourceMdf)
let parent (path: string) = path.Substring(0, path.LastIndexOf("/"))
let destFileName = sprintf "%s/attached/%s" (parent (parent dataPath)) (Path.GetFileName(sourceMdf))
//File.Copy(sourceMdf, destFileName, overwrite = true)
//File.Delete( sourceMdf)
use cmd = new SqlCommand(Connection = conn)
cmd.CommandText <- sprintf "CREATE DATABASE [%s] ON ( FILENAME = N'%s' ) FOR ATTACH" database destFileName
cmd.ExecuteNonQuery() |> ignore
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3"
services:
fsharp-tp-sql:
image: microsoft/mssql-server-linux:2017-latest
environment:
SA_PASSWORD: "type-providers-are-pretty-neat-N1#"
ACCEPT_EULA: "Y"
MSSQL_AGENT_ENABLED: "true"
ports:
- "5002:1433"
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "sdk": { "version": "2.1.402" } }
{ "sdk": { "version": "2.2.401" } }
56 changes: 28 additions & 28 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ github fsprojects/FSharp.TypeProviders.SDK:28a24a69ada68ebd1ad25226634f4608e4875

group Build
source https://www.nuget.org/api/v2/
framework: >= net451
framework: >= netstandard20
generate_load_scripts: on

nuget FAKE = 5.8.4
Expand All @@ -19,57 +19,57 @@ group Build

nuget NuGet.CommandLine

group Library
source https://www.nuget.org/api/v2/
framework: >= netstandard20
nuget FSharp.Core = 4.5.2
nuget Microsoft.Data.SqlClient

group DesignTime
source https://www.nuget.org/api/v2/
framework: >= net461, >= netstandard20
framework: >= netstandard20
storage: none

nuget System.Configuration.ConfigurationManager
nuget System.Data.Common
nuget System.Data.SqlClient
nuget System.Runtime.Caching
nuget FSharp.Core
nuget Microsoft.SqlServer.TransactSql.ScriptDom
nuget Microsoft.SqlServer.Types

nuget System.Runtime 4.3.1
nuget FSharp.Core = 4.5.2
nuget System.Configuration.ConfigurationManager 5.0.0
nuget System.Data.Common 4.3.0
nuget System.Runtime.Caching 5.0.0
nuget Microsoft.Data.SqlClient 2.1.2
nuget Microsoft.SqlServer.TransactSql.ScriptDom 150.4897.1
#nuget Microsoft.SqlServer.Types

group Test
source https://www.nuget.org/api/v2/
framework: >= net461, >= netcoreapp2.0
framework: netcoreapp2.2
storage: none

nuget FSharp.Core = 5.0.0 redirects:force
nuget System.Data.SqlClient
nuget System.Configuration.ConfigurationManager

nuget Microsoft.SqlServer.Types ~> 12
nuget Microsoft.Data.SqlClient
#nuget Microsoft.SqlServer.Types ~> 12
nuget Newtonsoft.Json
nuget xunit = 2.4.1
nuget xunit.runner.visualstudio = 2.4.1

group Net40
source https://www.nuget.org/api/v2/
framework: net40
storage: none

nuget FSharp.Core = 4.1.18

group TestProjects
source https://www.nuget.org/api/v2/
framework: >= net40, >= netcoreapp2.0, >= netstandard2.0
storage: none
framework: >= netcoreapp2.0
storage: none

nuget FSharp.Core = 4.3.4
nuget FSharp.Core = 4.5.2 redirects: force

nuget System.Data.SqlClient
nuget System.Configuration.ConfigurationManager
nuget Microsoft.Data.SqlClient

group Samples
source https://www.nuget.org/api/v2/
framework: >= net40, >= netcoreapp2.0, >= netstandard2.0
redirects: on
framework: >= netcoreapp2.2
storage: none

nuget FSharp.Core = 4.5.2 redirects: force

nuget Microsoft.AspNet.WebApi
nuget Microsoft.AspNet.WebApi.Client
nuget Microsoft.AspNet.WebApi.Core
Expand Down
Loading