Generating dynamic raw query help
Hello, we are trying to create a function utility to call RPCs, we want to dynamically generate the following SQL query:
We are trying the following
But the outputs have been things like:
SELECT my_function($1, $2)
SELECT my_function([object Object],[object Object])
Is there a Kysely helper function to generate the arg1 => 'some_value', arg2 => 123
section of my query, or how should I go about it? Thanks for any help!2 Replies
I think the issue is in using multiple
sql
instances, but om not sure how to then to insert the dynamic section that depends on the payload valuesYou're joining a bunch of objects into a string here.
Try this instead