node-postgres/test/api-tests.js

31 lines
735 B
JavaScript
Raw Normal View History

require(__dirname+"/test-helper");
2010-10-03 14:08:04 +08:00
//little helper to make a
//fresh client to the test DB
var makeClient = function() {
return new Client({
user: 'brian',
database: 'pgjstest'
});
};
var client1 = makeClient();
client1.connect();
client1.on('ReadyForQuery', function() {
console.log('client1 ready for query');
client1.disconnect();
});
2010-10-03 13:56:35 +08:00
2010-10-03 14:08:04 +08:00
var client2 = makeClient();
client2.connect();
client2.on('ReadyForQuery', function() {
console.log('client2 ready for query');
client2.disconnect();
2010-09-29 15:46:44 +08:00
});
2010-10-03 13:45:10 +08:00
// client.query('create temporary table bang (id integer)');
// client.query('insert into bang(id) VALUES(1)');
// client.query('select * from bang',function(err, results, fields) {
// assert.equal(err, null);
// });