1
0
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:
Kris Daniels 2013-12-20 10:33:06 +01:00
parent f8a303a79a
commit 4b75bfda5f
2 changed files with 18 additions and 13 deletions

View File

@ -1,5 +1,5 @@
<!--
Copyright 2013 IBM Corp.
Copyright 2013 Kris Daniels.
Licensed under the Apache License, Version 2.0 (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>The msg.payload on the output will be a json array of the returned records</p>
<p></p>
<p><b>Insert example</b>b></p>
<p><pre>msg.payload = { 'sensorid': 1, 'value': 2 }</pre></p>
<p><pre>insert into table (field1, field2) values ($sensorid, $value)</pre></p>
<p><b>Payload example</b></p>
<p><pre>
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><b>Select example</b>b></p>
<p><pre>msg.payload = { 'sensorid': 1, 'value': 2 }</pre></p>
<p><pre>select * from table where field1=$sensorid order by time desc limit 1</pre></p>
<p><b>Select example</b></p>
<p><pre>
select * from table
where field1 = $sensorid
order by time desc
limit 1</pre></p>
</script>

View File

@ -1,5 +1,5 @@
/**
* Copyright 2013 IBM Corp.
* Copyright 2013 Kris Daniels.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -14,11 +14,6 @@
* 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 pg=require('pg');
var named=require('node-postgres-named');