更新 netease_music 脚本
This commit is contained in:
40
netease_music/manual-script/打印SQL.js
Normal file
40
netease_music/manual-script/打印SQL.js
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
// const mysql = require('mysql');
|
||||
// await new Promise(function (resolve, reject) {
|
||||
// //通过MySQL中方法创建连接对象
|
||||
// var connection = mysql.createConnection({
|
||||
// "charset": "utf8mb4",
|
||||
// "host": "localhost",
|
||||
// "user": "root",
|
||||
// "password": "123456",
|
||||
// "port": 3306,
|
||||
// "database": ""
|
||||
// });
|
||||
// //开始连接
|
||||
// connection.connect();
|
||||
// var sql = `
|
||||
// INSERT INTO comment ( comment_id, parent_comment_id, user_id, song_id, content, time, like_count, comment_type ) VALUES ?
|
||||
// ON DUPLICATE KEY UPDATE content = VALUES(content), like_count = VALUES(like_count), comment_type = GREATEST(comment_type, VALUES(comment_type)), modify_time = CURRENT_TIMESTAMP
|
||||
// `;
|
||||
// var params = commentInfoList.map(commentInfo => [
|
||||
// commentInfo.comment_id,
|
||||
// commentInfo.parent_comment_id,
|
||||
// commentInfo.user_id,
|
||||
// commentInfo.song_id,
|
||||
// commentInfo.content,
|
||||
// commentInfo.time,
|
||||
// commentInfo.like_count,
|
||||
// commentInfo.comment_type
|
||||
// ]);
|
||||
// var formattedSql = connection.format(sql, [params]); // 返回一个格式化后的SQL字符串
|
||||
// console.log(params); // 打印原始SQL语句
|
||||
// console.log(formattedSql); // 打印原始SQL语句
|
||||
// //最后需要关闭连接
|
||||
// connection.end();
|
||||
// });
|
||||
// process.exit(0);
|
||||
|
||||
|
||||
// node index --utils comment --min 1935500000 --max 1935550000 --limit 10
|
||||
|
||||
|
Reference in New Issue
Block a user