Skip to content Skip to sidebar Skip to footer

Node-postgres $1 Is Null Error

I am using node-postgres to write a web app backend, and I am running into this error: error: could not determine data type of parameter $1 at Connection.parseE (/home/***/nic

Solution 1:

The problem is in $1 IS NULL, where $1 is treated as a dynamic column name, which is not allowed in prepared statements, due to the protections against SQL injection implemented by the database server.

UPDATE

If you want to format your queries freely, while also without the risk of an SQL injection, check out pg-promise. And to properly format names for schema, table or column see SQL Names.

Post a Comment for "Node-postgres $1 Is Null Error"