Skip to content

Commit 94347f3

Browse files
committed
fix: use @p naming for RPC parameters to match tests and conventions
1 parent 2545bb1 commit 94347f3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Sources/CosmoMSSQL/TDS/TDSRPCRequest.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ struct TDSRPCRequest {
4747
// Option flags: none
4848
buf.writeInteger(UInt16(0), endianness: .little)
4949

50-
// Build the parameter declaration string: "@param1 INT, @param2 NVARCHAR(MAX), ..."
50+
// Build the parameter declaration string: "@p1 INT, @p2 NVARCHAR(MAX), ..."
5151
let decl = binds.enumerated().map { (i, v) in
52-
"@param\(i+1) \(v.tdsTypeName)"
52+
"@p\(i+1) \(v.tdsTypeName)"
5353
}.joined(separator: ", ")
5454

5555
// Param 1: @stmt — the SQL text (unnamed, NVARCHAR(MAX) PLP)
@@ -58,9 +58,9 @@ struct TDSRPCRequest {
5858
// Param 2: @params — declaration string (unnamed, NVARCHAR(MAX) PLP)
5959
writeNVarCharMaxParam(name: "", value: decl, into: &buf)
6060

61-
// Param 3+: @param1, @param2, ... with typed binary values
61+
// Param 3+: @p1, @p2, ... with typed binary values
6262
for (i, bind) in binds.enumerated() {
63-
writeParam(name: "@param\(i+1)", value: bind, into: &buf)
63+
writeParam(name: "@p\(i+1)", value: bind, into: &buf)
6464
}
6565

6666
return buf
@@ -137,8 +137,8 @@ struct TDSRPCRequest {
137137

138138
case .double(let v):
139139
buf.writeInteger(UInt8(0x6D))
140-
buf.writeInteger(UInt8(8))
141-
buf.writeInteger(UInt8(8))
140+
buf.writeInteger(UInt8(8)) // maxLen
141+
buf.writeInteger(UInt8(8)) // actual len
142142
buf.writeInteger(v.bitPattern, endianness: .little)
143143

144144
case .string(let v):

0 commit comments

Comments
 (0)