I want update my timestamp column on PostgreSQL with this :
function updateStatusCreated(request, response, next) {
const date_generation_file = new Date();
pool.query(
`UPDATE data
SET report_status = 'CREATED', date_generation = '${date_generation_file}'`
),
(error, results) => {
if (error) {
return next(error);
}
return response.status(200).json(results);
};
return next();
}
But i receive this error message :
UnhandledPromiseRejectionWarning: error: syntax error at or near "'Tue Oct 19 2021 14:19:29 GMT+0200 (GMT+02:00)'"
The parameters of the column are "timestamp with timezone"
The perfect choice is to use Sequelize ORM