Hi there - I'm trying to do a bulk upsert on a postgres DB, which then returns various rows from the upserted data.
The following query in Retool is throwing an error when run; however, when I execute the query.evaluatedExpression inside the DB itself, it performs the operation correctly.
I have a feeling it's related to the way I'm inserting code2.data any maybe needing to use the formatDataAsArray method, but I've tried a few variations of that to no avail.
I adjusted my approach to side-step prepared statements, and also disabled prepared statements on the Resource itself. However, after running the query, the resource is still indicating that prepared statements are being used, even though I disabled the checkbox...?
Seems like there may be a bug or larger issue happening with the prepared statement functionality?
Error in converting query to prepared statement. You can disable this feature by checking the 'Disable converting queries to prepared statements' checkbox on the resource configuration page
Yes, @bryantaxs you're correct that passing in a query from Javascript is prevented with prepared statements enabled. Generally, you want to limit the amount of sql wrapped in double curly brackets if you want to use prepared statements, and you cannot have dynamic names or actions (e.g., a column name, a table name, or SELECT ).