Skip to content

Using generic types as query arguments is not possible #162

@manadart

Description

@manadart

Using a generic struct in queries is not possible

Consider preparing this query:

INSERT INTO unit_state_relation(*) VALUES ($unitStateKeyVal.*)

And passing a materialised unitStateKeyVal[int] to the call. This results:

preparing relation state insert query: preparing:: cannot prepare statement: input expression: parameter with type "unitStateKeyVal" missing (have "unitStateKeyVal[int]"): (*) VALUES ($unitStateKeyVal.*)

Trying to include the type parameter does not help. Preparing this:

INSERT INTO unit_state_relation(*) VALUES ($unitStateKeyVal[int].*)

Results in:

preparing relation state insert query: preparing:: cannot parse expression: column 44: unqualified type, expected unitStateKeyVal.* or unitStateKeyVal.<db tag> or unitStateKeyVal[:]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions