mirror of
https://github.com/brianc/node-postgres.git
synced 2026-02-01 16:47:23 +00:00
fixed to match actual api
parent
0acf0f8232
commit
534a6f075a
@ -14,8 +14,9 @@ API. Help? Yes please!
|
|||||||
client.query("create temp table ids(id integer)");
|
client.query("create temp table ids(id integer)");
|
||||||
client.query("insert into ids(id) values(1)");
|
client.query("insert into ids(id) values(1)");
|
||||||
client.query("insert into ids(id) values(2)");
|
client.query("insert into ids(id) values(2)");
|
||||||
var query = client.query("select * from ids", function(row) {
|
var query = client.query("select * from ids");
|
||||||
row.fields[0] // <- that equals 1 the first time. 2 the second time.
|
query.on('row', function(row) {
|
||||||
|
console.log(row);
|
||||||
});
|
});
|
||||||
query.on('end', function() {
|
query.on('end', function() {
|
||||||
client.end();
|
client.end();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user