mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Merge branch 'master' of github.com:brianc/node-pg-cursor
This commit is contained in:
commit
71dde045ea
3
index.js
3
index.js
@ -94,7 +94,8 @@ Cursor.prototype._sendRows = function () {
|
||||
})
|
||||
}
|
||||
|
||||
Cursor.prototype.handleCommandComplete = function () {
|
||||
Cursor.prototype.handleCommandComplete = function (msg) {
|
||||
this._result.addCommandComplete(msg)
|
||||
this.connection.sync()
|
||||
}
|
||||
|
||||
|
||||
@ -160,4 +160,18 @@ describe('cursor', function () {
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('returns rowCount on insert', function (done) {
|
||||
var pgCursor = this.pgCursor
|
||||
this.client.query('CREATE TEMPORARY TABLE pg_cursor_test (foo VARCHAR(1), bar VARCHAR(1))')
|
||||
.then(function () {
|
||||
var cursor = pgCursor('insert into pg_cursor_test values($1, $2)', ['a', 'b'])
|
||||
cursor.read(1, function (err, rows, result) {
|
||||
assert.ifError(err)
|
||||
assert.equal(rows.length, 0)
|
||||
assert.equal(result.rowCount, 1)
|
||||
done()
|
||||
})
|
||||
}).catch(done)
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user