This commit is contained in:
brianc 2011-06-02 07:29:32 -05:00
commit de7f90f315
3 changed files with 15 additions and 2 deletions

View File

@ -58,7 +58,7 @@ node-postgres supports both an 'event emitter' style API and a 'callback' style.
name: 'insert beatle',
values: ['Paul', 63, new Date(1945, 04, 03)]
});
var query = client.query("SELECT * FROM beatles WHERE name = $1", ['john']);
var query = client.query("SELECT * FROM beatles WHERE name = $1", ['John']);
//can stream row results back 1 at a time
query.on('row', function(row) {
@ -108,6 +108,7 @@ Many thanks to the following:
* [pjornblomqvist](https://github.com/bjornblomqvist)
* [JulianBirch](https://github.com/JulianBirch)
* [ef4](https://github.com/ef4)
* [napa3um](https://github.com/napa3um)
## Documentation

View File

@ -1,5 +1,5 @@
{ "name": "pg",
"version": "0.4.1",
"version": "0.5.0",
"description": "PostgreSQL client - pure javascript & libpq with the same API",
"keywords" : ["postgres", "pg", "libpq", "postgre", "database", "rdbms"],
"homepage": "http://github.com/brianc/node-postgres",

View File

@ -126,3 +126,15 @@ test("timestampz round trip", function() {
client.on('drain', client.end.bind(client));
});
helper.pg.connect(helper.connectionString(), assert.calls(function(err, client) {
assert.isNull(err);
client.query('select null as res;', assert.calls(function(err, res) {
assert.isNull(err);
assert.strictEqual(res.rows[0].res, null)
}))
client.query('select 7 <> $1 as res;',[null], function(err, res) {
assert.isNull(err);
assert.strictEqual(res.rows[0].res, null);
client.end();
})
}))