Skip to content

How to insert an ARRAY type? #106

@eldilibra

Description

@eldilibra

I've a struct like:

type Foo struct {
  //some other fields here
  Things []string `db:"things"`
}

When I run something like this through NamedQuery:

INSERT INTO foos (things) VALUES (:things)

I get the following error message:
"sql: converting Exec argument #3's type: unsupported type []string, a slice"

My PostgreSQL db has that field set to an ARRAY (of type uuid, but that is besides the point)

Are we just not allowed to use ARRAYs under the hood with sqlx?

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