question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bugfix invalid query log not bind parameters in sequelize@5.9.0

See original GitHub issue

version: sequelize@5.9.0

Invalid query log not bind parameters in sequelize@5.9.0

What are you doing?

use query logging. execute update method.

What do you expect to happen?

output sql log

Executing (default): UPDATE users SET email = 'test@test.com', updated_at = '2019-01-01 10:00:00' WHERE id = 1;

What is actually happening?

query log not bind parameters

output sql log

Executing (default): UPDATE users SET email = ?, updated_at = ? WHERE id = ?;

Environment

Dialect:

  • mysql
  • postgres
  • sqlite
  • mssql
  • any Database version: 5.7 Sequelize version: 5.9.0

If TypeScript related: TypeScript version: XXX Tested with latest release:

  • No
  • Yes, specify that version:

How to modify

target file path: lib/dialects/mysql/query.js line: 37

    const complete = this._logQuery(parameters ? connection.format(sql, parameters) : sql, debug);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Nogias9xcommented, Jul 29, 2020

Hi @sushantdhiman ,

Can we somehow have it

UPDATE `users` SET `age`=10;

instead of

UPDATE `users` SET `name`=?; 10

I’ve having trailing params while using MySQL

0reactions
sushantdhimancommented, Sep 19, 2019

@soufian044 It will automatically update in 24 hours

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent Sequelize from outputting SQL to the console on ...
When you create your Sequelize object, pass false to the logging parameter: var sequelize = new Sequelize('database', 'username', ...
Read more >
Raw Queries - Sequelize
By default the function will return two arguments - a results array, and an object containing metadata (such as amount of affected rows,...
Read more >
Contrast Documentation 3.8.10.2
If you change the values of metadata in the Contrast configuration file for the agent, you can filter the vulnerability data based.
Read more >
SQL Queries Broken in 0.39.0.1 - Metabase Discussion
Previously working queries against MSSQL Server broken since update to 0.39.0.1 "Select statement did not produce a ResultSet for native ...
Read more >
Parameters not being replaced - Google Groups
var q = "SELECT * FROM users WHERE firstName = '?'" return models.sequelize.query(q, null, {. replacements: {firstName ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found