node-postgres/test/integration/client/result-metadata-tests.js

29 lines
1.0 KiB
JavaScript
Raw Normal View History

var helper = require(__dirname + "/test-helper");
var pg = helper.pg;
var conString = helper.connectionString();
2011-05-20 08:19:58 +08:00
test('should return insert metadata', function() {
return false;
pg.connect(conString, assert.calls(function(err, client) {
assert.isNull(err);
2011-05-20 08:19:58 +08:00
client.query("CREATE TEMP TABLE zugzug(name varchar(10))", assert.calls(function(err, result) {
assert.isNull(err);
//let's list this as ignored for now
// process.nextTick(function() {
// test('should identify "CREATE TABLE" message', function() {
// return false;
// assert.equal(result.command, "CREATE TABLE");
// assert.equal(result.rowCount, 0);
// })
// })
assert.equal(result.oid, null);
client.query("INSERT INTO zugzug(name) VALUES('more work?')", assert.calls(function(err, result) {
assert.equal(result.command, "INSERT");
assert.equal(result.rowCount, 1);
process.nextTick(client.end.bind(client));
return false;
}))
}))
}))
2011-05-20 08:19:58 +08:00
})