Nikola
Dynamic return type based on provided select array
So I have this function:
And when I call it I want the return type to contain only the fields that were provided in the
select
parameter.
In the result above, billableUsers
contains all user_data
column values, how can I narrow it down? I tried a lot of things but I keep getting type errors.
I am using the kysely-codegen
library for the types.
Thanks for the help!3 replies