#PGO Error on StringTuple of 1 elements

1 messages · Page 1 of 1 (latest)

unreal granite
#

I get this error:

UnexpectedResultType
StringTuple of 1 elements

When running this query:

select username
from tokens
where token = $1
limit 1;

username is a varchar(32)
token is a uuid

My input type is:

[pgo.bytea(token_binary)]

My return type is:

dynamic.string
rotund cosmos
#

databases always return rows, so if you return one string you get 1 tuple of 1 string element

#

Like #("sometoken")

#

You can use dynamic.element(0, dynamic.string)