Skip to content

Commit 93835cc

Browse files
committed
Adjust parameter count down since SqlConnection uses a couple.
1 parent cbd096d commit 93835cc

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/Rezoom.SQL.Mapping/CommandBatch.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ type private CommandBatchRuntimeBackend =
2929
| _ -> Other
3030
member this.MaxParameters() =
3131
match this with
32-
| SQLServer -> 2100
33-
| Oracle -> 2000
32+
| SQLServer -> 2098 // actual is 2100 but SqlCommand implementation takes 2 for itself
33+
| Oracle -> 1900 // actual is 2000 but leave plenty of breathing room since it's untested
3434
| Postgres
3535
| MySQL -> 10_000
3636
| SQLite

src/TypeProviderUsers/TypeProviderUser.SQLite/TestSelects.fs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ open Rezoom
88
open Rezoom.SQL
99
open Rezoom.SQL.Plans
1010
open MBrace.FsPickler
11+
open Rezoom
1112

1213
type TestEqualInteger = SQL<"""
1314
select * from Users where Id = @userId
@@ -141,6 +142,18 @@ let ``replay works`` () =
141142
()
142143
else failwith "not equal"
143144

145+
type InsertPicture = SQL<"insert into Pictures row SHA256 = @sha, PNGData = @png">
146+
147+
[<Test>]
148+
let ``lotsa parameters`` () =
149+
let task =
150+
plan {
151+
let g() = Guid.NewGuid().ToByteArray()
152+
for i in batch [0..2000] do
153+
do! InsertPicture.Command(g(), g()).Plan()
154+
} |> Execution.execute Execution.ExecutionConfig.Default
155+
task.Wait()
156+
144157
open Rezoom.SQL.Raw
145158
open System.Data
146159

0 commit comments

Comments
 (0)