I am using https://node-postgres.com/ to write a fairly simple application, but I do have a complex constraint that has caused me issues. Namely, I need my SQL statement to select a schema based on user input
SELECT * FROM {some user value}.tableName
but when I attempt to parametrize this normally, I get a syntax error
{"errorType":"error","errorMessage":"syntax error at or near \"$1\""
Which seems to indicate that the value wasnt replaced as expected.
Is there a way to sanitize the incoming value without executing it in a query? or is there a proper way to parametrize this value in the query in a way that will execute properly?
(I would like to avoid a big library change to something like sequilize just to meet my basic needs)