Hi,
I think there is a bug with type generation. If you create a function in postgres with rows 1 instead of ommiting rows or having more than 1 row and you generate types it seems that the return type of that rpc doesnt get a [] at the end. Meaning that the type is incorrectly of a single object rather than a array of that object, which is wrong, since rows just tells postgres how many rows to expect, not how many it should max send, and postgrest doesn't even automatically send it as a single object, it still sends it as a array, causing runtime errors.
Also as a side effect when you use the single method on your rpc method you get a type that doesn't even make sense since it does [number] twice, once from rows 1 which is wrong and once because you do single which is correct, so now you do get a object instead of array of object, but the typing doesnt make sense.
Am I doing something wrong, or mismatching types and postgrest versions or is this a bug?
The user reports a potential bug in type generation when using 'rows 1' in a Postgres function. They describe an issue where the return type is incorrectly generated as a single object instead of an array, leading to runtime errors. The user is unsure if this is a bug or a misconfiguration on their part.