File tree Expand file tree Collapse file tree 2 files changed +200
-191
lines changed Expand file tree Collapse file tree 2 files changed +200
-191
lines changed Original file line number Diff line number Diff line change 1
1
var sys = require ( "sys" ) ;
2
2
var pg = require ( "./lib/postgres-pure" ) ;
3
- pg . DEBUG = 0 ;
3
+ pg . DEBUG = 1 ;
4
4
5
5
var db = new pg . connect ( "pgsql://test:12345@localhost:5432/template1" ) ;
6
- db . query ( "SELECT 1::int as foobar;" , function ( rs ) {
6
+ db . query ( "SELECT 1::int as foobar;" , function ( rs , tx ) {
7
7
sys . puts ( sys . inspect ( rs ) ) ;
8
- db . close ( ) ;
8
+ tx . query ( "SELECT 2::int as foobartwo" , function ( rs ) {
9
+ sys . puts ( sys . inspect ( rs ) ) ;
10
+ } ) ;
11
+ // db.close();
9
12
} ) ;
10
13
11
- // db.prepare("SELECT ?::int AS foobar", function (sth) {
12
- // sth.execute([1] , function (rs) {
14
+ // db.prepare("SELECT ?::int AS foobar", function (sth, tx ) {
15
+ // sth.execute(1 , function (rs) {
13
16
// sys.puts(sys.inspect(rs));
14
17
// });
15
- // sth.execute([2] , function (rs) {
18
+ // sth.execute(2 , function (rs) {
16
19
// sys.puts(sys.inspect(rs));
17
20
//
18
21
// });
22
+ // // db.close();
19
23
// });
24
+ db . close ( ) ;
25
+
20
26
//
21
27
// db.transaction(function (tx) {
22
28
// tx.query("SELECT ?::int AS foobar", 1, function (rs) {
You can’t perform that action at this time.
0 commit comments