Skip to content

Improve support for arrays of composite types #33

Closed
@bobobo1618

Description

@bobobo1618

It's unclear at the moment how to pass composite type values (in my case, arrays of them) to asyncpg.

For example, if I want to do something like this:

CREATE TYPE keyvalue AS (key text, value text);
CREATE TABLE test (id int, data keyvalue);
INSERT INTO test (id, data) VALUES (1, ROW('stuff', 'things'));

How to do so with asyncpg isn't clear. I've tried tuples and received errors about integer types (one part of my composite type is an integer). The docs mention something about a Record type but not where to find it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions