mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
removed template remarks and adjusted name
This commit is contained in:
parent
f8a303a79a
commit
4b75bfda5f
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Copyright 2013 IBM Corp.
|
Copyright 2013 Kris Daniels.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -79,14 +79,24 @@
|
|||||||
<p>To receive the results from a query, simply set the outputs to 1 and connect a node</p>
|
<p>To receive the results from a query, simply set the outputs to 1 and connect a node</p>
|
||||||
<p>The msg.payload on the output will be a json array of the returned records</p>
|
<p>The msg.payload on the output will be a json array of the returned records</p>
|
||||||
<p></p>
|
<p></p>
|
||||||
<p><b>Insert example</b>b></p>
|
<p><b>Payload example</b></p>
|
||||||
<p><pre>msg.payload = { 'sensorid': 1, 'value': 2 }</pre></p>
|
<p><pre>
|
||||||
<p><pre>insert into table (field1, field2) values ($sensorid, $value)</pre></p>
|
msg.payload = {
|
||||||
|
'sensorid': 1,
|
||||||
|
'value': 2
|
||||||
|
}</pre></p>
|
||||||
|
<p><b>Insert example</b></p>
|
||||||
|
<p><pre>
|
||||||
|
insert into table (field1, field2)
|
||||||
|
values ($sensorid, $value)</pre></p>
|
||||||
|
|
||||||
<p></p>
|
<p></p>
|
||||||
<p><b>Select example</b>b></p>
|
<p><b>Select example</b></p>
|
||||||
<p><pre>msg.payload = { 'sensorid': 1, 'value': 2 }</pre></p>
|
<p><pre>
|
||||||
<p><pre>select * from table where field1=$sensorid order by time desc limit 1</pre></p>
|
select * from table
|
||||||
|
where field1 = $sensorid
|
||||||
|
order by time desc
|
||||||
|
limit 1</pre></p>
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2013 IBM Corp.
|
* Copyright 2013 Kris Daniels.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -14,11 +14,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
// If you use this as a template, replace IBM Corp. with your own name.
|
|
||||||
|
|
||||||
// Sample Node-RED node file
|
|
||||||
|
|
||||||
// Require main module
|
|
||||||
var RED = require(process.env.NODE_RED_HOME+"/red/red");
|
var RED = require(process.env.NODE_RED_HOME+"/red/red");
|
||||||
var pg=require('pg');
|
var pg=require('pg');
|
||||||
var named=require('node-postgres-named');
|
var named=require('node-postgres-named');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user