Skip to content

ResultRow.get() returns null for user-defined enum types #43

@asjustis

Description

@asjustis

Hi Guys,

So I have a few nums created (examples below), and a table that has fields with those enums as types. When I try to retrieve data using ResultRow.get() I get null values for these fields. Are these types supported at all, or should I get them in some specific way?

 create type my_type as enum (
 	'unknown',
 	'source',
 );
create type area as enum (
	'left',
        'right'
);

create table images (
	id		serial primary key,
	url		text,
	type		my_type,
	area		area
);

Here is my response for the database: (those null values are normal values in the database)

ResultRow {
    names: [ 'id', 'url', 'type', 'area' ],
    data: [
        34,
        'https://www.test.url/image.png',
        null,
        null
    ],
    length: 4
}

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthardNot easy to do

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions