Skip to content

Sequelize 7 alpha 29: mapping of (?) placeholder has changed #16821

Discussion options

You must be logged in to vote

Hi!
The serialization of values changed between v6 and v7, if you need an SQL list instead of an SQL array, you need to use this: https://sequelize.org/docs/v7/querying/raw-queries/#sqllist

I think you can do the following as well:

const query = `
  INSERT INTO mytable (created_at,num_block,num_found)
  VALUES ?
`;

const data = [
  sql.list([new Date(), '12896912', '0'])
];

return db.query(query, {
  replacements: data,
  type: db.QueryTypes.INSERT
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bot-nftmagicians
Comment options

Answer selected by bot-nftmagicians
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants