The code in knexjs like below
knexjs
.select("resources.id")
will be translated to below SQL
SELECT "RESOURCES"."ID"
But PostgreSQL only recognized RESOURCES.ID , not"RESOURCES"."ID" as valid column
RESOURCES.ID
"RESOURCES"."ID"
Is this a known issue? Is there any suggestion apart from using SQL raw?
You need to use the wrapIdentifier to remove the quotes
const knex = require('knex')({ client: 'pg', wrapIdentifier: (value, origImpl, queryContext) => value});
http://knexjs.org/#Installation-wrap-identifier
2.1m questions
2.1m answers
60 comments
57.0k users