Skip to content

Commit f56cee1

Browse files
author
Aurynn Shaw
committed
Prepared queries work As Expected.
Lots of debugging symbols still defaulting to on, that need to be cleaned up. Other code that needs to be written: * Disengagement code, so that a messages block that's retired can be primed when it is placed back onto the query buffer. (say a .execute gets run later.) * LISTEN. It makes so much sense.
1 parent 54b0035 commit f56cee1

File tree

2 files changed

+260
-148
lines changed

2 files changed

+260
-148
lines changed

demo.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var sys = require("sys");
22
var pg = require("./lib/postgres-pure");
3-
pg.DEBUG=1;
3+
// pg.DEBUG=1;
44

55
var db = new pg.connect("pgsql://test:12345@localhost:5432/template1");
66
db.query("SELECT 1::int as foobar;", function (rs, tx) {
@@ -11,16 +11,16 @@ db.query("SELECT 1::int as foobar;", function (rs, tx) {
1111
// db.close();
1212
});
1313

14-
// db.prepare("SELECT ?::int AS foobar", function (sth, tx) {
15-
// sth.execute(1, function (rs) {
16-
// sys.puts(sys.inspect(rs));
17-
// });
18-
// sth.execute(2, function (rs) {
19-
// sys.puts(sys.inspect(rs));
20-
//
21-
// });
22-
// // db.close();
23-
// });
14+
db.prepare("SELECT ?::int AS foobar", function (sth, tx) {
15+
sth.execute(1, function (rs, tx) {
16+
sys.puts(sys.inspect(rs));
17+
});
18+
sth.execute(2, function (rs) {
19+
sys.puts(sys.inspect(rs));
20+
21+
});
22+
// db.close();
23+
});
2424
db.close();
2525

2626
//

0 commit comments

Comments
 (0)