What's the correct way to to include an Args in Direct Database Query?

Options

Look at the example below, the idea is to find lease_id IN a lease_ids array, in the first case below I tried to format the lease_ids array into (39,38,137,84,144,185,187,189,191,66,146), which is the correct way to query in posgresql, result in an error:

But when I directly type them in, no error occur:

How can I include the lease_ids array in this raw query?

Tagged:

Answers

  • Sam
    Sam Member
    Options

    Found the solution, convert the array from Xano (recognize by Posgresql as a String) to individual values first using:
    IN (  SELECT value::bigint     FROM json_array_elements_text(?) AS arr(value))