Skip to content

Commit

Permalink
feat(refactor): add specific tc support
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry Perret committed Jan 23, 2021
1 parent 5949374 commit 51401de
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
10 changes: 2 additions & 8 deletions Vp.FSharp.Sql.SqlServer/SqlServerCommand.fs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[<RequireQualifiedAccess>]
module Vp.FSharp.Sql.SqlServer.SqlServerCommand

open System
open System.Data
open System.Threading.Tasks

open Microsoft.Data.SqlClient

open Vp.FSharp.Sql


Expand Down Expand Up @@ -79,15 +73,15 @@ let querySetList3 connection read1 read2 read3 (commandDefinition: SqlServerComm
/// - return the first cell value, if it is available and of the given type.
/// - throw an exception, otherwise.
let executeScalar<'Scalar> connection (commandDefinition: SqlServerCommandDefinition) =
SqlCommand.executeScalar<'Scalar, _, _, _, _, _, _, _, _, _>
SqlCommand.executeScalar<'Scalar, _, _, _, _, _, _, _, _>
connection (Constants.Deps) (SqlServerConfiguration.Snapshot) commandDefinition

/// Execute the command accordingly to its definition and,
/// - return Some, if the first cell is available and of the given type.
/// - return None, if first cell is DbNull.
/// - throw an exception, otherwise.
let executeScalarOrNone<'Scalar> connection (commandDefinition: SqlServerCommandDefinition) =
SqlCommand.executeScalarOrNone<'Scalar, _, _, _, _, _, _, _, _, _>
SqlCommand.executeScalarOrNone<'Scalar, _, _, _, _, _, _, _, _>
connection (Constants.Deps) (SqlServerConfiguration.Snapshot) commandDefinition

/// Execute the command accordingly to its definition and, return the number of rows affected.
Expand Down
2 changes: 1 addition & 1 deletion Vp.FSharp.Sql.SqlServer/SqlServerTransaction.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Vp.FSharp.Sql.SqlServer.SqlServerTransaction
open Vp.FSharp.Sql


let beginTransactionAsync = SqlServerCommand.deps.BeginTransactionAsync
let beginTransactionAsync = Constants.Deps.BeginTransactionAsync

let commit cancellationToken isolationLevel connection body =
Transaction.commit cancellationToken isolationLevel connection beginTransactionAsync body
Expand Down
1 change: 0 additions & 1 deletion Vp.FSharp.Sql.SqlServer/Types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ type SqlServerDependencies =
SqlParameter,
SqlDataReader,
SqlTransaction,
IsolationLevel,
SqlServerDbValue>

[<AbstractClass; Sealed>]
Expand Down
2 changes: 1 addition & 1 deletion Vp.FSharp.Sql.SqlServer/Vp.FSharp.Sql.SqlServer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.0.0" />
<PackageReference Include="Vp.FSharp.Sql" Version="1.0.38" />
<PackageReference Include="Vp.FSharp.Sql" Version="1.0.41" />
</ItemGroup>

</Project>

0 comments on commit 51401de

Please sign in to comment.