Skip to content

.Query method with array of primitive types gives cryptic error #1

@daz10000

Description

@daz10000

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`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions