diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 931f1eb7..3d9abb1e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,10 +3,11 @@ "isRoot": true, "tools": { "paket": { - "version": "8.0.0", + "version": "9.0.2", "commands": [ "paket" - ] + ], + "rollForward": false } } } \ No newline at end of file diff --git a/README.md b/README.md index c1684933..37f84de0 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Provides statically typed access to the parameters and result set of T-SQL comma open FSharp.Data [] -let connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" // The query below retrieves top 3 sales representatives from North American region with YTD sales of more than one million. diff --git a/build/build.fs b/build/build.fs index a12334f4..4d6455a6 100644 --- a/build/build.fs +++ b/build/build.fs @@ -278,6 +278,7 @@ Target.create "RunTests" (fun _ -> try DotNet.test (dnTestOptions "net462") testSlnPath DotNet.test (dnTestOptions "netcoreapp3.1") testProjectPath + DotNet.test (dnTestOptions "net8.0") testProjectPath with | ex -> Trace.log (sprintf "Test exception: %A" ex) diff --git a/docs/content/SqlClientComparison.md b/docs/content/SqlClientComparison.md index ca1725e2..de4acc09 100644 --- a/docs/content/SqlClientComparison.md +++ b/docs/content/SqlClientComparison.md @@ -38,7 +38,7 @@ Here is a typical snippet of SqlCommandProvider-enabled code: open FSharp.Data [] - let connectionString = @"Data Source=(LocalDb)\v11.0;Initial Catalog=AdventureWorks2012;Integrated Security=True" + let connectionString = @"Data Source=(LocalDb)\v11.0;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" [] let query = " diff --git a/docs/content/app.config b/docs/content/app.config index 034e7a43..2e338c00 100644 --- a/docs/content/app.config +++ b/docs/content/app.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/docs/content/bulk load.fsx b/docs/content/bulk load.fsx index a9d3ee66..a22075cb 100644 --- a/docs/content/bulk load.fsx +++ b/docs/content/bulk load.fsx @@ -1,11 +1,11 @@ (*** hide ***) -#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll" #r "System.Transactions" open FSharp.Data open System [] -let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2014;Integrated Security=True" +let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2014;Integrated Security=True;TrustServerCertificate=true" (** diff --git a/docs/content/configuration and Input.fsx b/docs/content/configuration and Input.fsx index f5a8be4e..e621636a 100644 --- a/docs/content/configuration and Input.fsx +++ b/docs/content/configuration and Input.fsx @@ -1,5 +1,5 @@ (*** hide ***) -#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll" #r "Microsoft.SqlServer.Types.dll" (** @@ -46,7 +46,7 @@ CommandText open FSharp.Data [] -let connStr = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connStr = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" //Inline T-SQL text convinient for short queries type GetDate = SqlCommandProvider<"SELECT GETDATE() AS Now", connStr> @@ -166,7 +166,7 @@ Connection string can be provided either via literal (all examples above) or inl //Inline type Get42 = - SqlCommandProvider<"SELECT 42", @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True"> + SqlCommandProvider<"SELECT 42", @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true"> (** @@ -225,7 +225,7 @@ let get42 = new Get42(runTimeConnStr) //Factory or IOC of choice to avoid logic duplication. Use F# ctor static constraints. module DB = [] - let connStr = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" + let connStr = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" open System.Data.SqlClient @@ -247,9 +247,9 @@ let dbCmd2: DB.MyCmd2 = DB.createCommand() //Static type property ConnectionStringOrName that has exactly same value as passed into SqlCommandProvider helps. module DataAccess = [] - let adventureWorks = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" + let adventureWorks = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" [] - let master = @"Data Source=.;Initial Catalog=master;Integrated Security=True" + let master = @"Data Source=.;Initial Catalog=master;Integrated Security=True;TrustServerCertificate=true" type MyCmd1 = SqlCommandProvider<"SELECT 42", adventureWorks> type MyCmd2 = SqlCommandProvider<"SELECT 42", master> diff --git a/docs/content/data modification.fsx b/docs/content/data modification.fsx index 5914be03..8f07f854 100644 --- a/docs/content/data modification.fsx +++ b/docs/content/data modification.fsx @@ -1,11 +1,11 @@ (*** hide ***) -#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll" #r "System.Transactions" open FSharp.Data open System [] -let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" (** diff --git a/docs/content/debugging.fsx b/docs/content/debugging.fsx index 8feed77f..a67f106d 100644 --- a/docs/content/debugging.fsx +++ b/docs/content/debugging.fsx @@ -1,11 +1,11 @@ (*** hide ***) -#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll" #r "System.Transactions" open FSharp.Data open System [] -let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" (** diff --git a/docs/content/dynamic local db.fsx b/docs/content/dynamic local db.fsx index ad1dcbc8..24e3bfc4 100644 --- a/docs/content/dynamic local db.fsx +++ b/docs/content/dynamic local db.fsx @@ -19,7 +19,7 @@ open FSharp.Data [] let compileConnectionString = - @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\git\Project1\Database1.mdf;Integrated Security=True" + @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\git\Project1\Database1.mdf;Integrated Security=True;TrustServerCertificate=true" (** However, binary files like this are difficult to diff/merge when working with diff --git a/docs/content/faq.fsx b/docs/content/faq.fsx index 5b393cc1..4e2bbdb9 100644 --- a/docs/content/faq.fsx +++ b/docs/content/faq.fsx @@ -1,10 +1,10 @@ (*** hide ***) -#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll" #r "System.Transactions" open FSharp.Data [] -let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" (** FAQ diff --git a/docs/content/index.fsx b/docs/content/index.fsx index aef8681b..3a2957c2 100644 --- a/docs/content/index.fsx +++ b/docs/content/index.fsx @@ -1,6 +1,6 @@ (*** hide ***) #r "Microsoft.SqlServer.Types.dll" -#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll" (** Not your grandfather's ORM @@ -33,7 +33,7 @@ open FSharp.Data [] let connectionString = - @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" + @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" (** diff --git a/docs/content/output.fsx b/docs/content/output.fsx index dfb57761..86c4dee8 100644 --- a/docs/content/output.fsx +++ b/docs/content/output.fsx @@ -1,9 +1,9 @@ (*** hide ***) -#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll" #r "Microsoft.SqlServer.Types.dll" open FSharp.Data [] -let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" (** diff --git a/docs/content/reference architecture.fsx b/docs/content/reference architecture.fsx index 4ff5f828..223f1ecd 100644 --- a/docs/content/reference architecture.fsx +++ b/docs/content/reference architecture.fsx @@ -103,7 +103,7 @@ END open FSharp.Data [] -let adventureWorks = @"Data Source=(LocalDb)\v12.0;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let adventureWorks = @"Data Source=(LocalDb)\v12.0;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" [] let euler17 = " diff --git a/docs/content/setup.fsx b/docs/content/setup.fsx index 21c1a751..8a2ecb67 100644 --- a/docs/content/setup.fsx +++ b/docs/content/setup.fsx @@ -1,8 +1,8 @@ #nowarn "211" -#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll" #r "System.Transactions" open FSharp.Data [] -let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" diff --git a/docs/content/sqlenumprovider.quickstart.fsx b/docs/content/sqlenumprovider.quickstart.fsx index ff6b9109..2a01d7fa 100644 --- a/docs/content/sqlenumprovider.quickstart.fsx +++ b/docs/content/sqlenumprovider.quickstart.fsx @@ -37,7 +37,7 @@ A typical implementation for overnight orders shipped since Jan 1, 2008 is follo *) [] -let connStr = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connStr = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" open System open System.Data.SqlClient @@ -194,7 +194,7 @@ type Roles = SqlEnumProvider<" SELECT * FROM (VALUES(('Read'), 1), ('Write', 2), ('Admin', 4)) AS T(Name, Value) - ", @"Data Source=(LocalDb)\v12.0;Integrated Security=True", Kind = SqlEnumKind.CLI> + ", @"Data Source=(LocalDb)\v12.0;Integrated Security=True;TrustServerCertificate=true", Kind = SqlEnumKind.CLI> type CustomAuthorizeAttribute(roles: Roles) = inherit AuthorizeAttribute() diff --git a/docs/content/transactions.fsx b/docs/content/transactions.fsx index bda6224b..64638d96 100644 --- a/docs/content/transactions.fsx +++ b/docs/content/transactions.fsx @@ -4,7 +4,7 @@ open FSharp.Data [] -let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" (** Transactions diff --git a/docs/content/unit-testing.fsx b/docs/content/unit-testing.fsx index 2e553b1f..e676c1cb 100644 --- a/docs/content/unit-testing.fsx +++ b/docs/content/unit-testing.fsx @@ -1,12 +1,12 @@ (*** hide ***) -#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll" #r @"..\..\packages\Test\xunit\lib\net20\xunit.dll" #r "System.Transactions" open FSharp.Data open System [] -let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connectionString = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" (** diff --git a/docs/content/user.config b/docs/content/user.config index 034e7a43..2e338c00 100644 --- a/docs/content/user.config +++ b/docs/content/user.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/docs/content/whatsnew.fsx b/docs/content/whatsnew.fsx index f3c401ff..0c19b108 100644 --- a/docs/content/whatsnew.fsx +++ b/docs/content/whatsnew.fsx @@ -1,12 +1,12 @@ (*** hide ***) #r "Microsoft.SqlServer.Types.dll" -#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll" open FSharp.Data [] let connectionString = - @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" + @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" type DB = SqlProgrammabilityProvider diff --git a/netfx.props b/netfx.props index 1f542a42..cefd35f7 100644 --- a/netfx.props +++ b/netfx.props @@ -36,7 +36,7 @@ - + + - - + @@ -77,19 +79,6 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SqlClient.DesignTime/SqlClientProvider.fs b/src/SqlClient.DesignTime/SqlClientProvider.fs index 66e87c32..50044859 100644 --- a/src/SqlClient.DesignTime/SqlClientProvider.fs +++ b/src/SqlClient.DesignTime/SqlClientProvider.fs @@ -416,7 +416,7 @@ type SqlProgrammabilityProvider(config : TypeProviderConfig) as this = Debug.Assert(values.Length = optionalParams.Length, "values.Length = optionalParams.Length") for name, value, optional in Array.zip3 namesOfUpdateableColumns values optionalParams do - row.[name] <- if value = null && optional then box DbNull else value + row.[name] <- if isNull value && optional then box DbNull else value row @@> diff --git a/src/SqlClient.DesignTime/SqlCommandProvider.fs b/src/SqlClient.DesignTime/SqlCommandProvider.fs index 8cbfea98..1379873b 100644 --- a/src/SqlClient.DesignTime/SqlCommandProvider.fs +++ b/src/SqlClient.DesignTime/SqlCommandProvider.fs @@ -111,8 +111,7 @@ type SqlCommandProvider(config : TypeProviderConfig) as this = let schemas = sqlDataTypes - |> Seq.map (fun i -> i.RetrieveSchemas()) - |> Seq.concat + |> Seq.collect (fun i -> i.RetrieveSchemas()) |> Seq.distinct |> Seq.toArray diff --git a/src/SqlClient.DesignTime/SqlEnumProvider.fs b/src/SqlClient.DesignTime/SqlEnumProvider.fs index 8514de78..500e9768 100644 --- a/src/SqlClient.DesignTime/SqlEnumProvider.fs +++ b/src/SqlClient.DesignTime/SqlEnumProvider.fs @@ -94,7 +94,7 @@ type SqlEnumProvider(config : TypeProviderConfig) as this = let getValueType(row: DataRow) = let t = Type.GetType( typeName = string row.["DataType"], throwOnError = true) - if not( t.IsValueType || t = typeof) + if not( t.IsValueType || Type.(=)(t, typeof)) then failwithf "Invalid type %s of column %O for value part. Only .NET value types and strings supported as value." t.FullName row.["ColumnName"] t diff --git a/src/SqlClient.Samples/WebApi.Controllers/App.config b/src/SqlClient.Samples/WebApi.Controllers/App.config index d3e16551..9ff0f1c3 100644 --- a/src/SqlClient.Samples/WebApi.Controllers/App.config +++ b/src/SqlClient.Samples/WebApi.Controllers/App.config @@ -1,11 +1,17 @@  - - + + - \ No newline at end of file + + + True + + + + diff --git a/src/SqlClient.Samples/WebApi.Controllers/WebApi.Controllers.fsproj b/src/SqlClient.Samples/WebApi.Controllers/WebApi.Controllers.fsproj index 811837d0..8ccf840f 100644 --- a/src/SqlClient.Samples/WebApi.Controllers/WebApi.Controllers.fsproj +++ b/src/SqlClient.Samples/WebApi.Controllers/WebApi.Controllers.fsproj @@ -9,7 +9,7 @@ Library WebApi.Controllers WebApi.Controllers - v4.5.2 + v4.6.2 4.4.0.0 WebApi.Controllers ..\..\..\ @@ -79,10 +79,19 @@ --> - + - ..\..\..\packages\samples\FSharp.Core\lib\net45\FSharp.Core.dll + ..\..\..\packages\samples\FSharp.Core\lib\netstandard2.0\FSharp.Core.dll + True + True + + + + + + + ..\..\..\packages\samples\FSharp.Core\lib\netstandard2.1\FSharp.Core.dll True True @@ -90,10 +99,19 @@ - + - ..\..\..\packages\samples\FSharp.Data.SqlClient\lib\net40\FSharp.Data.SqlClient.dll + ..\..\..\bin\net462\FSharp.Data.SqlClient.dll + True + True + + + + + + + ..\..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll True True @@ -101,7 +119,7 @@ - + ..\..\..\packages\samples\Microsoft.AspNet.WebApi.Client\lib\net45\System.Net.Http.Formatting.dll @@ -110,9 +128,18 @@ + + + + ..\..\..\packages\samples\Microsoft.AspNet.WebApi.Client\lib\netstandard2.0\System.Net.Http.Formatting.dll + True + True + + + - + ..\..\..\packages\samples\Microsoft.AspNet.WebApi.Core\lib\net45\System.Web.Http.dll @@ -123,19 +150,244 @@ - + - ..\..\..\packages\samples\Newtonsoft.Json\lib\net40\Newtonsoft.Json.dll + ..\..\..\packages\samples\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll True True - + - ..\..\..\packages\samples\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\samples\Newtonsoft.Json\lib\net6.0\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\..\packages\samples\Newtonsoft.Json\lib\netstandard1.3\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\..\packages\samples\Newtonsoft.Json\lib\netstandard2.0\Newtonsoft.Json.dll + True + True + + + + + + + + + ..\..\..\packages\samples\Newtonsoft.Json.Bson\lib\netstandard1.3\Newtonsoft.Json.Bson.dll + True + True + + + + + + + ..\..\..\packages\samples\Newtonsoft.Json.Bson\lib\netstandard2.0\Newtonsoft.Json.Bson.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Buffers\lib\netstandard1.1\System.Buffers.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Buffers\lib\netstandard2.0\System.Buffers.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Buffers\ref\netstandard2.0\System.Buffers.dll + False + True + + + + + + + + + ..\..\..\packages\samples\System.Configuration.ConfigurationManager\lib\net8.0\System.Configuration.ConfigurationManager.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Configuration.ConfigurationManager\lib\net9.0\System.Configuration.ConfigurationManager.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Configuration.ConfigurationManager\lib\netstandard2.0\System.Configuration.ConfigurationManager.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Data.SqlClient\lib\net6.0\System.Data.SqlClient.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Data.SqlClient\lib\net8.0\System.Data.SqlClient.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Data.SqlClient\lib\netstandard2.0\System.Data.SqlClient.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Diagnostics.EventLog\lib\net8.0\System.Diagnostics.EventLog.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Diagnostics.EventLog\lib\net9.0\System.Diagnostics.EventLog.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Memory\lib\netstandard2.0\System.Memory.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Numerics.Vectors\lib\netstandard2.0\System.Numerics.Vectors.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Numerics.Vectors\ref\netstandard2.0\System.Numerics.Vectors.dll + False + True + + + + + + + + + ..\..\..\packages\samples\System.Runtime.CompilerServices.Unsafe\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Runtime.CompilerServices.Unsafe\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Security.Cryptography.ProtectedData\lib\net8.0\System.Security.Cryptography.ProtectedData.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Security.Cryptography.ProtectedData\lib\net9.0\System.Security.Cryptography.ProtectedData.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Security.Cryptography.ProtectedData\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll True True diff --git a/src/SqlClient.Samples/WebApi/Web.Debug.config b/src/SqlClient.Samples/WebApi/Web.Debug.config index 2e302f9f..15cb9de9 100644 --- a/src/SqlClient.Samples/WebApi/Web.Debug.config +++ b/src/SqlClient.Samples/WebApi/Web.Debug.config @@ -10,7 +10,7 @@ --> diff --git a/src/SqlClient.Samples/WebApi/Web.Release.config b/src/SqlClient.Samples/WebApi/Web.Release.config index c3584446..c8e242dc 100644 --- a/src/SqlClient.Samples/WebApi/Web.Release.config +++ b/src/SqlClient.Samples/WebApi/Web.Release.config @@ -10,7 +10,7 @@ --> diff --git a/src/SqlClient.Samples/WebApi/WebApi.csproj b/src/SqlClient.Samples/WebApi/WebApi.csproj index 0fd980b2..c6923d47 100644 --- a/src/SqlClient.Samples/WebApi/WebApi.csproj +++ b/src/SqlClient.Samples/WebApi/WebApi.csproj @@ -13,7 +13,7 @@ Properties WebApi WebApi - v4.5.2 + v4.8 true @@ -23,6 +23,7 @@ true + true @@ -114,10 +115,19 @@ --> - + - ..\..\..\packages\samples\FSharp.Core\lib\net45\FSharp.Core.dll + ..\..\..\packages\samples\FSharp.Core\lib\netstandard2.0\FSharp.Core.dll + True + True + + + + + + + ..\..\..\packages\samples\FSharp.Core\lib\netstandard2.1\FSharp.Core.dll True True @@ -125,10 +135,19 @@ - + - ..\..\..\packages\samples\FSharp.Data.SqlClient\lib\net40\FSharp.Data.SqlClient.dll + ..\..\..\bin\net462\FSharp.Data.SqlClient.dll + True + True + + + + + + + ..\..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll True True @@ -136,7 +155,7 @@ - + ..\..\..\packages\samples\Microsoft.AspNet.WebApi.Client\lib\net45\System.Net.Http.Formatting.dll @@ -145,9 +164,18 @@ + + + + ..\..\..\packages\samples\Microsoft.AspNet.WebApi.Client\lib\netstandard2.0\System.Net.Http.Formatting.dll + True + True + + + - + ..\..\..\packages\samples\Microsoft.AspNet.WebApi.Core\lib\net45\System.Web.Http.dll @@ -158,7 +186,7 @@ - + ..\..\..\packages\samples\Microsoft.AspNet.WebApi.WebHost\lib\net45\System.Web.Http.WebHost.dll @@ -169,19 +197,247 @@ - + - ..\..\..\packages\samples\Newtonsoft.Json\lib\net40\Newtonsoft.Json.dll + ..\..\..\packages\samples\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll True True - + - ..\..\..\packages\samples\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\samples\Newtonsoft.Json\lib\net6.0\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\..\packages\samples\Newtonsoft.Json\lib\netstandard1.3\Newtonsoft.Json.dll + True + True + + + + + + + ..\..\..\packages\samples\Newtonsoft.Json\lib\netstandard2.0\Newtonsoft.Json.dll + True + True + + + + + + + + + ..\..\..\packages\samples\Newtonsoft.Json.Bson\lib\netstandard1.3\Newtonsoft.Json.Bson.dll + True + True + + + + + + + ..\..\..\packages\samples\Newtonsoft.Json.Bson\lib\netstandard2.0\Newtonsoft.Json.Bson.dll + True + True + + + + + + + + + True + + + ..\..\..\packages\samples\System.Buffers\lib\netstandard1.1\System.Buffers.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Buffers\lib\netstandard2.0\System.Buffers.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Buffers\ref\netstandard2.0\System.Buffers.dll + False + True + + + + + + + + + ..\..\..\packages\samples\System.Configuration.ConfigurationManager\lib\net8.0\System.Configuration.ConfigurationManager.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Configuration.ConfigurationManager\lib\net9.0\System.Configuration.ConfigurationManager.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Configuration.ConfigurationManager\lib\netstandard2.0\System.Configuration.ConfigurationManager.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Data.SqlClient\lib\net6.0\System.Data.SqlClient.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Data.SqlClient\lib\net8.0\System.Data.SqlClient.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Data.SqlClient\lib\netstandard2.0\System.Data.SqlClient.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Diagnostics.EventLog\lib\net8.0\System.Diagnostics.EventLog.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Diagnostics.EventLog\lib\net9.0\System.Diagnostics.EventLog.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Memory\lib\netstandard2.0\System.Memory.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Numerics.Vectors\lib\netstandard2.0\System.Numerics.Vectors.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Numerics.Vectors\ref\netstandard2.0\System.Numerics.Vectors.dll + False + True + + + + + + + + + ..\..\..\packages\samples\System.Runtime.CompilerServices.Unsafe\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Runtime.CompilerServices.Unsafe\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Security.Cryptography.ProtectedData\lib\net8.0\System.Security.Cryptography.ProtectedData.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Security.Cryptography.ProtectedData\lib\net9.0\System.Security.Cryptography.ProtectedData.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Security.Cryptography.ProtectedData\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll True True diff --git a/src/SqlClient.Samples/WebApi/web.config b/src/SqlClient.Samples/WebApi/web.config index 6d09952d..6a05fd72 100644 --- a/src/SqlClient.Samples/WebApi/web.config +++ b/src/SqlClient.Samples/WebApi/web.config @@ -1,7 +1,7 @@  - + - + - @@ -24,15 +23,16 @@ + True - + True - + \ No newline at end of file diff --git a/src/SqlClient.Samples/WpfDataBinding/App.config b/src/SqlClient.Samples/WpfDataBinding/App.config index 1cc96036..bbdeeccc 100644 --- a/src/SqlClient.Samples/WpfDataBinding/App.config +++ b/src/SqlClient.Samples/WpfDataBinding/App.config @@ -1,21 +1,16 @@  - + - - True - - - True - + \ No newline at end of file diff --git a/src/SqlClient.Samples/WpfDataBinding/Program.fs b/src/SqlClient.Samples/WpfDataBinding/Program.fs index 453a3cf4..a0079e1c 100644 --- a/src/SqlClient.Samples/WpfDataBinding/Program.fs +++ b/src/SqlClient.Samples/WpfDataBinding/Program.fs @@ -1,5 +1,5 @@ module FSharp.Data.Application - +#nowarn "101" //open WebApi //let testExternalQuery = new DataAccess.QueryProducts() diff --git a/src/SqlClient.Samples/WpfDataBinding/WpfDataBinding.fsproj b/src/SqlClient.Samples/WpfDataBinding/WpfDataBinding.fsproj index 06df8602..2a03f1a9 100644 --- a/src/SqlClient.Samples/WpfDataBinding/WpfDataBinding.fsproj +++ b/src/SqlClient.Samples/WpfDataBinding/WpfDataBinding.fsproj @@ -9,7 +9,7 @@ WinExe DataBinding DataBinding - v4.5.2 + v4.6.2 WpfDataBinding @@ -55,13 +55,15 @@ + + + + <__paket__Microsoft_SqlServer_Types_props>net462\Microsoft.SqlServer.Types + + + + - - True - - - True - MSBuild:Compile Designer @@ -102,10 +104,19 @@ --> - + - ..\..\..\packages\samples\FSharp.Core\lib\net45\FSharp.Core.dll + ..\..\..\packages\samples\FSharp.Core\lib\netstandard2.0\FSharp.Core.dll + True + True + + + + + + + ..\..\..\packages\samples\FSharp.Core\lib\netstandard2.1\FSharp.Core.dll True True @@ -113,10 +124,19 @@ - + + + + ..\..\..\bin\net462\FSharp.Data.SqlClient.dll + True + True + + + + - ..\..\..\packages\samples\FSharp.Data.SqlClient\lib\net40\FSharp.Data.SqlClient.dll + ..\..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll True True @@ -124,10 +144,217 @@ - + + + + ..\..\..\packages\samples\Microsoft.SqlServer.Server\lib\netstandard2.0\Microsoft.SqlServer.Server.dll + True + True + + + + + + + + + ..\..\..\packages\samples\Microsoft.SqlServer.Types\lib\net462\Microsoft.SqlServer.Types.dll + True + True + + + + - ..\..\..\packages\samples\Microsoft.SqlServer.Types\lib\net40\Microsoft.SqlServer.Types.dll + ..\..\..\packages\samples\Microsoft.SqlServer.Types\lib\netstandard2.1\Microsoft.SqlServer.Types.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Buffers\lib\netstandard1.1\System.Buffers.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Buffers\lib\netstandard2.0\System.Buffers.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Buffers\ref\netstandard2.0\System.Buffers.dll + False + True + + + + + + + + + ..\..\..\packages\samples\System.Configuration.ConfigurationManager\lib\net8.0\System.Configuration.ConfigurationManager.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Configuration.ConfigurationManager\lib\net9.0\System.Configuration.ConfigurationManager.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Configuration.ConfigurationManager\lib\netstandard2.0\System.Configuration.ConfigurationManager.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Data.SqlClient\lib\net6.0\System.Data.SqlClient.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Data.SqlClient\lib\net8.0\System.Data.SqlClient.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Data.SqlClient\lib\netstandard2.0\System.Data.SqlClient.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Diagnostics.EventLog\lib\net8.0\System.Diagnostics.EventLog.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Diagnostics.EventLog\lib\net9.0\System.Diagnostics.EventLog.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Memory\lib\netstandard2.0\System.Memory.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Numerics.Vectors\lib\netstandard2.0\System.Numerics.Vectors.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Numerics.Vectors\ref\netstandard2.0\System.Numerics.Vectors.dll + False + True + + + + + + + + + ..\..\..\packages\samples\System.Runtime.CompilerServices.Unsafe\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Runtime.CompilerServices.Unsafe\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + True + True + + + + + + + + + ..\..\..\packages\samples\System.Security.Cryptography.ProtectedData\lib\net8.0\System.Security.Cryptography.ProtectedData.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Security.Cryptography.ProtectedData\lib\net9.0\System.Security.Cryptography.ProtectedData.dll + True + True + + + + + + + ..\..\..\packages\samples\System.Security.Cryptography.ProtectedData\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll True True diff --git a/src/SqlClient.TestProjects/Lib/App.config b/src/SqlClient.TestProjects/Lib/App.config index 1f37146e..730c3884 100644 --- a/src/SqlClient.TestProjects/Lib/App.config +++ b/src/SqlClient.TestProjects/Lib/App.config @@ -1,6 +1,6 @@  - + diff --git a/src/SqlClient.TestProjects/Lib/Lib.fsproj b/src/SqlClient.TestProjects/Lib/Lib.fsproj index 3e515f97..dc8a1992 100644 --- a/src/SqlClient.TestProjects/Lib/Lib.fsproj +++ b/src/SqlClient.TestProjects/Lib/Lib.fsproj @@ -3,7 +3,7 @@ - net471;netstandard2.0 + net471;netstandard2.0;net8.0 Lib false true @@ -19,11 +19,14 @@ + + ..\..\..\bin\net8.0\FSharp.Data.SqlClient.dll + ..\..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll - ..\..\..\bin\net40\FSharp.Data.SqlClient.dll + ..\..\..\bin\net462\FSharp.Data.SqlClient.dll diff --git a/src/SqlClient.TestProjects/Lib/Script.fsx b/src/SqlClient.TestProjects/Lib/Script.fsx index cc634497..52be7623 100644 --- a/src/SqlClient.TestProjects/Lib/Script.fsx +++ b/src/SqlClient.TestProjects/Lib/Script.fsx @@ -1,4 +1,4 @@ -#r @"..\..\..\bin\net40\FSharp.Data.SqlClient.dll" +#r @"..\..\..\bin\net462\FSharp.Data.SqlClient.dll" #r @"bin\Debug\Lib.dll" #r @"System.Configuration" #r @"System.Transactions" diff --git a/src/SqlClient.TestProjects/SqlClient.Tests.NET40/Program.fs b/src/SqlClient.TestProjects/SqlClient.Tests.NET40/Program.fs index 8eed7ef5..28334eef 100644 --- a/src/SqlClient.TestProjects/SqlClient.Tests.NET40/Program.fs +++ b/src/SqlClient.TestProjects/SqlClient.Tests.NET40/Program.fs @@ -2,7 +2,7 @@ open FSharp.Data.SqlClient open FSharp.Data [] -let connectionString = "Data Source=localhost;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connectionString = "Data Source=localhost;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" type SingleColumnSelect = SqlEnumProvider<"SELECT Name FROM Purchasing.ShipMethod", connectionString> type TinyIntEnum = SqlEnumProvider<"SELECT * FROM (VALUES(('One'), CAST(1 AS tinyint)), ('Two', CAST(2 AS tinyint))) AS T(Tag, Value)", connectionString, Kind = SqlEnumKind.CLI> diff --git a/src/SqlClient.TestProjects/SqlClient.Tests.NET40/SqlClient.Tests.NET40.fsproj b/src/SqlClient.TestProjects/SqlClient.Tests.NET40/SqlClient.Tests.NET40.fsproj index d68dd166..d3dccc89 100644 --- a/src/SqlClient.TestProjects/SqlClient.Tests.NET40/SqlClient.Tests.NET40.fsproj +++ b/src/SqlClient.TestProjects/SqlClient.Tests.NET40/SqlClient.Tests.NET40.fsproj @@ -4,7 +4,7 @@ Exe - net40 + net462 SqlClient.Tests.NET40 false true @@ -23,7 +23,7 @@ - ..\..\..\bin\net40\FSharp.Data.SqlClient.dll + ..\..\..\bin\net462\FSharp.Data.SqlClient.dll diff --git a/src/SqlClient.TestProjects/SqlClient.Tests.NetCoreApp/Program.fs b/src/SqlClient.TestProjects/SqlClient.Tests.NetCoreApp/Program.fs index 9c94adc1..8c260db1 100644 --- a/src/SqlClient.TestProjects/SqlClient.Tests.NetCoreApp/Program.fs +++ b/src/SqlClient.TestProjects/SqlClient.Tests.NetCoreApp/Program.fs @@ -2,7 +2,7 @@ open FSharp.Data [] -let Cnx = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let Cnx = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" type SingleColumnSelect = SqlEnumProvider<"SELECT Name FROM Purchasing.ShipMethod", Cnx> type TinyIntEnum = SqlEnumProvider<"SELECT * FROM (VALUES(('One'), CAST(1 AS tinyint)), ('Two', CAST(2 AS tinyint))) AS T(Tag, Value)", Cnx, Kind = SqlEnumKind.CLI> diff --git a/src/SqlClient.TestProjects/SqlClient.Tests.NetCoreApp/SqlClient.Tests.NetCoreApp.fsproj b/src/SqlClient.TestProjects/SqlClient.Tests.NetCoreApp/SqlClient.Tests.NetCoreApp.fsproj index f5af292d..a71e257f 100644 --- a/src/SqlClient.TestProjects/SqlClient.Tests.NetCoreApp/SqlClient.Tests.NetCoreApp.fsproj +++ b/src/SqlClient.TestProjects/SqlClient.Tests.NetCoreApp/SqlClient.Tests.NetCoreApp.fsproj @@ -3,12 +3,12 @@ Exe - netcoreapp2.0 + net8.0 true - ..\..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll + ..\..\..\bin\net8.0\FSharp.Data.SqlClient.dll diff --git a/src/SqlClient/DataTable.fs b/src/SqlClient/DataTable.fs index dda3f49c..03a6a8da 100644 --- a/src/SqlClient/DataTable.fs +++ b/src/SqlClient/DataTable.fs @@ -8,6 +8,7 @@ open FSharp.Data.SqlClient.Internals [] [] +[] type DataTable<'T when 'T :> DataRow>(selectCommand: SqlCommand, ?connectionString: Lazy) = inherit DataTable() @@ -38,7 +39,7 @@ type DataTable<'T when 'T :> DataRow>(selectCommand: SqlCommand, ?connectionStri member __.NewRow(): 'T = downcast base.NewRow() - member private this.IsDirectTable = this.TableName <> null + member private this.IsDirectTable = not (isNull this.TableName) member this.Update(?connection, ?transaction, ?batchSize, ?continueUpdateOnError, ?timeout: TimeSpan) = // not supported on all DataTable instances @@ -49,7 +50,7 @@ type DataTable<'T when 'T :> DataRow>(selectCommand: SqlCommand, ?connectionStri connection |> Option.iter selectCommand.set_Connection transaction |> Option.iter selectCommand.set_Transaction - if selectCommand.Connection = null && this.IsDirectTable + if isNull selectCommand.Connection && this.IsDirectTable then assert(connectionString.IsSome) selectCommand.Connection <- new SqlConnection( connectionString.Value.Value) diff --git a/src/SqlClient/DynamicRecord.fs b/src/SqlClient/DynamicRecord.fs index 3e4ccb75..68bc3aac 100644 --- a/src/SqlClient/DynamicRecord.fs +++ b/src/SqlClient/DynamicRecord.fs @@ -10,7 +10,7 @@ type DynamicRecord(data: IDictionary) = inherit DynamicObject() do - assert(data <> null) + assert(not (isNull data)) member internal this.Data = data @@ -42,7 +42,7 @@ type DynamicRecord(data: IDictionary) = override this.ToString() = [| for KeyValue(key, value) in data -> - sprintf "%s = %s" key ( if value = null || Convert.IsDBNull( value) then "None" else sprintf "%A" value) + sprintf "%s = %s" key ( if isNull value || Convert.IsDBNull( value) then "None" else sprintf "%A" value) |] |> String.concat "; " |> sprintf "{ %s }" diff --git a/src/SqlClient/ISqlCommand.fs b/src/SqlClient/ISqlCommand.fs index 6c128269..ec6b76a7 100644 --- a/src/SqlClient/ISqlCommand.fs +++ b/src/SqlClient/ISqlCommand.fs @@ -107,7 +107,7 @@ type ``ISqlCommand Implementation``(cfg: DesignTimeConfig, connection: Connectio notImplemented, notImplemented | rowMapping, itemTypeName -> - assert (rowMapping <> null && itemTypeName <> null) + assert ((not(isNull rowMapping)) && (not (isNull itemTypeName))) let itemType = Type.GetType( itemTypeName, throwOnError = true) let executeHandle = @@ -237,10 +237,13 @@ type ``ISqlCommand Implementation``(cfg: DesignTimeConfig, connection: Connectio let sqlDataRecordType = typeof.Assembly.GetType("Microsoft.SqlServer.Server.SqlDataRecord", throwOnError = true) let records = typeof.GetMethod("Cast").MakeGenericMethod(sqlDataRecordType).Invoke(null, [| value |]) let hasAny = - typeof - .GetMethods(BindingFlags.Static ||| BindingFlags.Public) - .First(fun m -> m.Name = "Any" && m.GetParameters().Count() = 1) - .MakeGenericMethod(sqlDataRecordType).Invoke(null, [| records |]) :?> bool + let anyMeth = + typeof.GetMethods(BindingFlags.Static ||| BindingFlags.Public) + |> Array.tryFind(fun m -> m.Name = "Any" && m.GetParameters().Length = 1) + + match anyMeth with + | Some x -> x.MakeGenericMethod(sqlDataRecordType).Invoke(null, [| records |]) :?> bool + | None -> false p.Value <- if not hasAny then null else records | _ -> p.Value <- value diff --git a/src/SqlClient/SqlClient.fsproj b/src/SqlClient/SqlClient.fsproj index 3e18c9a0..64ec69aa 100644 --- a/src/SqlClient/SqlClient.fsproj +++ b/src/SqlClient/SqlClient.fsproj @@ -2,7 +2,7 @@ - net40;netstandard2.0 + net462;netstandard2.0;net8.0 FSharp.Data.SqlClient false true @@ -17,12 +17,11 @@ $(DefineConstants);DEBUG;TRACE - ..\..\bin\net40\FSharp.Data.SqlClient.XML + ..\..\bin\net462\FSharp.Data.SqlClient.XML - - - + + diff --git a/tests/SqlClient.DesignTime.Tests/SqlClient.DesignTime.Tests.fsproj b/tests/SqlClient.DesignTime.Tests/SqlClient.DesignTime.Tests.fsproj index 5fa7a209..e139eb12 100644 --- a/tests/SqlClient.DesignTime.Tests/SqlClient.DesignTime.Tests.fsproj +++ b/tests/SqlClient.DesignTime.Tests/SqlClient.DesignTime.Tests.fsproj @@ -15,8 +15,11 @@ - - ..\..\bin\typeproviders\fsharp41\net461\FSharp.Data.SqlClient.DesignTime.dll + + ..\..\bin\typeproviders\fsharp41\net462\FSharp.Data.SqlClient.DesignTime.dll + + + ..\..\bin\typeproviders\fsharp41\net8.0\FSharp.Data.SqlClient.DesignTime.dll diff --git a/tests/SqlClient.DesignTime.Tests/app.config b/tests/SqlClient.DesignTime.Tests/app.config index deb6c2c0..3e34c35f 100644 --- a/tests/SqlClient.DesignTime.Tests/app.config +++ b/tests/SqlClient.DesignTime.Tests/app.config @@ -19,8 +19,8 @@ - - + + diff --git a/tests/SqlClient.SqlServerTypes.Tests/App.config b/tests/SqlClient.SqlServerTypes.Tests/App.config index ffc7ce43..9ba1f0ef 100644 --- a/tests/SqlClient.SqlServerTypes.Tests/App.config +++ b/tests/SqlClient.SqlServerTypes.Tests/App.config @@ -1,7 +1,7 @@  - + @@ -10,6 +10,10 @@ + + + + True diff --git a/tests/SqlClient.SqlServerTypes.Tests/SqlClient.SqlServerTypes.Tests.fsproj b/tests/SqlClient.SqlServerTypes.Tests/SqlClient.SqlServerTypes.Tests.fsproj index c3c331fd..2f7eacbc 100644 --- a/tests/SqlClient.SqlServerTypes.Tests/SqlClient.SqlServerTypes.Tests.fsproj +++ b/tests/SqlClient.SqlServerTypes.Tests/SqlClient.SqlServerTypes.Tests.fsproj @@ -16,9 +16,16 @@ - + ..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll + + ..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll + + + ..\..\bin\net462\FSharp.Data.SqlClient.dll + + \ No newline at end of file diff --git a/tests/SqlClient.Tests/ConnectionStrings.fs b/tests/SqlClient.Tests/ConnectionStrings.fs index e8129a1b..08e3a77c 100644 --- a/tests/SqlClient.Tests/ConnectionStrings.fs +++ b/tests/SqlClient.Tests/ConnectionStrings.fs @@ -4,7 +4,7 @@ let server = @"." [] -let AdventureWorksLiteral = @"Data Source=" + server + ";Initial Catalog=AdventureWorks2012;Integrated Security=True" +let AdventureWorksLiteral = @"Data Source=" + server + ";Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" [] let AdventureWorksDesignOnly = @"name=AdventureWorksDesignOnly" [] @@ -14,7 +14,7 @@ let AdventureWorksNamed = @"name=AdventureWorks" [] let MasterDb = @"name=MasterDb" [] -let LocalHost = @"Data Source=" + server + ";Integrated Security=True" +let LocalHost = @"Data Source=" + server + ";Integrated Security=True;TrustServerCertificate=true" [] let AdventureWorksAzureRedGate = @"Data Source=mhknbn2kdz.database.windows.net;Initial Catalog=AdventureWorks2012;User ID=sqlfamily;Pwd=sqlf@m1ly" diff --git a/tests/SqlClient.Tests/Scripts/CreateCommand.fsx b/tests/SqlClient.Tests/Scripts/CreateCommand.fsx index 3bdf619c..5e1c7b71 100644 --- a/tests/SqlClient.Tests/Scripts/CreateCommand.fsx +++ b/tests/SqlClient.Tests/Scripts/CreateCommand.fsx @@ -6,7 +6,7 @@ open FSharp.Data open System.Data.SqlClient [] -let connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" +let connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true" type DB = SqlProgrammabilityProvider type dbo = DB.dbo diff --git a/tests/SqlClient.Tests/Scripts/SqlProgrammability.fsx b/tests/SqlClient.Tests/Scripts/SqlProgrammability.fsx index 53138aec..95f9d4c1 100644 --- a/tests/SqlClient.Tests/Scripts/SqlProgrammability.fsx +++ b/tests/SqlClient.Tests/Scripts/SqlProgrammability.fsx @@ -14,7 +14,7 @@ open FSharp.Data //[] //let prodConnectionString = ConnectionStrings.MasterDb -type AdventureWorks = SqlProgrammabilityProvider<"Data Source=.;Initial Catalog = AdventureWorks2012;Integrated Security=True"> +type AdventureWorks = SqlProgrammabilityProvider<"Data Source=.;Initial Catalog = AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true"> type dbo = AdventureWorks.dbo let x = 42. let y = 12. @@ -28,7 +28,7 @@ x.GetType().AssemblyQualifiedName // AND Y.ProductID = @salesOrderDetailProductid // AND (X.SpecialOfferID IS NOT NULL // OR Y.SpecialOfferID IS NOT NULL) -// ", "Data Source=.;Initial Catalog = AdventureWorks2012;Integrated Security=True">() +// ", "Data Source=.;Initial Catalog = AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true">() //#r @"Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll" // @@ -57,6 +57,6 @@ x.GetType().AssemblyQualifiedName //[ for c in dt2.Columns -> c.ColumnName, c.DataType.FullName ] = [ for c in dt.Columns -> c.ColumnName, c.DataType.FullName ] -type Thermion = SqlProgrammabilityProvider<"Data Source=.;Initial Catalog = Thermion;Integrated Security=True"> +type Thermion = SqlProgrammabilityProvider<"Data Source=.;Initial Catalog = Thermion;Integrated Security=True;TrustServerCertificate=true"> diff --git a/tests/SqlClient.Tests/SqlClient.Tests.fsproj b/tests/SqlClient.Tests/SqlClient.Tests.fsproj index df53cc0b..bcef51d6 100644 --- a/tests/SqlClient.Tests/SqlClient.Tests.fsproj +++ b/tests/SqlClient.Tests/SqlClient.Tests.fsproj @@ -3,7 +3,7 @@ - net462;netcoreapp3.1 + net8.0;net462 SqlClient.Tests false true @@ -52,8 +52,11 @@ - - ..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll + + ..\..\bin\net462\FSharp.Data.SqlClient.dll + + + ..\..\bin\net8.0\FSharp.Data.SqlClient.dll diff --git a/tests/SqlClient.Tests/app.config b/tests/SqlClient.Tests/app.config index ac20342e..7d34fb2f 100644 --- a/tests/SqlClient.Tests/app.config +++ b/tests/SqlClient.Tests/app.config @@ -5,13 +5,13 @@ - - + + True - + \ No newline at end of file diff --git a/tests/SqlClient.Tests/connectionStrings.Azure.config b/tests/SqlClient.Tests/connectionStrings.Azure.config index c71ad26b..03ac93d1 100644 --- a/tests/SqlClient.Tests/connectionStrings.Azure.config +++ b/tests/SqlClient.Tests/connectionStrings.Azure.config @@ -1,5 +1,5 @@  - - - + + + \ No newline at end of file diff --git a/tests/SqlClient.Tests/connectionStrings.config b/tests/SqlClient.Tests/connectionStrings.config index bf7df50c..55851742 100644 --- a/tests/SqlClient.Tests/connectionStrings.config +++ b/tests/SqlClient.Tests/connectionStrings.config @@ -1,5 +1,5 @@  - - - + + +