Typescript return type for Functions
I really appreciate the
supabase gen types typescript
utility in the CLI tool. One thing I can't get to work is when I define Postgres Functions, it won't determine the return type based on the the function. For example, given this function
Where I'm specifying the return is setof shifts
which is a table in my schema. The generated type for this is
I can manually update the file, sure, but it is auto-generated, so I'd rather not. And yes, I could also build a bash script that will generate the types and then mutate them at the end, but I'd rather not.1 Reply
I can also see that it's not using the correct types as well. I'm assuming the Functions ability with this feature is limited.