fss icon indicating copy to clipboard operation
fss copied to clipboard

.Query method with array of primitive types gives cryptic error

Open daz10000 opened this issue 9 years ago • 0 comments

The .Query method expects a sequence of F# record types as its target. When the user does a simple query of say integers it fails saying that (int32) doesn't have that field name. Would be nice if it identified single value arrays of basic types and handled that gracefully.

` let getCycle rid = let sql = sprintf "SELECT run.customer_id FROM dtdqc.run as run WHERE id = %s" rid let cycle_id =
sql |> conn.Query |> Array.ofSeq cycle_id

And when I run it I get this error:

ERROR: name mapping, SQL name 'customer_id' not found in target Record`

daz10000 avatar Oct 26 '16 22:10 daz10000