我想用sequelize.query插入多行数据,但它只插入第一行。代码:
sequelize.query
connection.query( 'INSERT INTO product (a, b) VALUES (?);', [['a', 'b'], ['c', 'd']], (...args) => console.log(args) );
有什么问题吗?
mrfwxfqh1#
在github上找到了解决方案:https://github.com/sequelize/sequelize/issues/9050#issuecomment-365855299我应该把密码改成这样的:
connection.query( 'INSERT INTO product (a, b) VALUES ?;', [[['a', 'b'], ['c', 'd']]], (...args) => console.log(args) );
1条答案
按热度按时间mrfwxfqh1#
在github上找到了解决方案:
https://github.com/sequelize/sequelize/issues/9050#issuecomment-365855299
我应该把密码改成这样的: