mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Merge branch 'test-mysql2' into fix-node-mysql
This commit is contained in:
@@ -121,6 +121,7 @@ module.exports = function(RED) {
|
||||
if (done) { done(); }
|
||||
return
|
||||
}
|
||||
|
||||
var bind = [];
|
||||
if (Array.isArray(msg.payload)) {
|
||||
bind = msg.payload;
|
||||
@@ -137,36 +138,15 @@ module.exports = function(RED) {
|
||||
node.error(err, msg);
|
||||
}
|
||||
else {
|
||||
// if (rows.constructor.name === "OkPacket") {
|
||||
// msg.payload = JSON.parse(JSON.stringify(rows));
|
||||
// }
|
||||
// else if (rows.constructor.name === "Array") {
|
||||
// if (rows[0] && rows[0].constructor.name === "RowDataPacket") {
|
||||
// msg.payload = rows.map(v => Object.assign({}, v));
|
||||
// }
|
||||
// else if (rows[0] && rows[0].constructor.name === "Array") {
|
||||
// if (rows[0][0] && rows[0][0].constructor.name === "RowDataPacket") {
|
||||
// msg.payload = rows.map(function(v) {
|
||||
// if (!Array.isArray(v)) { return v; }
|
||||
// v.map(w => Object.assign({}, w))
|
||||
// });
|
||||
// }
|
||||
// else { msg.payload = rows; }
|
||||
// }
|
||||
// else { msg.payload = rows; }
|
||||
// }
|
||||
// else { msg.payload = rows; }
|
||||
msg.payload = rows;
|
||||
send(msg);
|
||||
status = { fill: "green", shape: "dot", text: RED._("mysql.status.ok") };
|
||||
node.status(status);
|
||||
}
|
||||
if (done) { done(); }
|
||||
// if (node.mydbConfig.pool._freeConnections.indexOf(node.mydbConfig.connection) === -1) {
|
||||
// node.mydbConfig.connection.release();
|
||||
// }
|
||||
});
|
||||
})
|
||||
|
||||
}
|
||||
else {
|
||||
if (typeof msg.topic !== 'string') { node.error("msg.topic : "+RED._("mysql.errors.notstring")); done(); }
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<script type="text/html" data-help-name="MySQLdatabase">
|
||||
<p>データベースにアクセスするための認証情報を追加します。</p>
|
||||
<p>タイムゾーンには、GMT, EST5EDT, UTC のような値を設定します。</p>
|
||||
<p>The Charset defaults to the "old" 3 byte Mysql UTF8. 絵文字などをサポートする必要がある場合は、UTF8MB4 を使用してください。</p>
|
||||
<p>文字セットのデフォルトは「古い」3バイトのMysql UTF8です。絵文字などをサポートする必要がある場合は、UTF8MB4 を使用してください。</p>
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="mysql">
|
||||
|
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "node-red-node-mysql",
|
||||
"version": "0.3.0",
|
||||
"version": "1.0.0-beta",
|
||||
"description": "A Node-RED node to read and write to a MySQL database",
|
||||
"dependencies": {
|
||||
"mysql": "^2.18.1"
|
||||
"mysql2": "^2.3.3"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
Reference in New Issue
Block a user