mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
* Add connection & query timeout if all clients are checked out This addresses [pg#1390](https://github.com/brianc/node-postgres/issues/1390). Ensure connection timeout applies both for new connections and on an exhuasted pool. I also made the library return an error when passing a function as the first param to `pool.query` - previosuly this threw a sync type error. * Add pg-cursor to dev deps
20 lines
532 B
JavaScript
20 lines
532 B
JavaScript
'use strict'
|
|
const Cursor = require('pg-cursor')
|
|
const expect = require('expect.js')
|
|
const describe = require('mocha').describe
|
|
const it = require('mocha').it
|
|
|
|
const Pool = require('../')
|
|
|
|
describe('submittle', () => {
|
|
it('is returned from the query method', false, (done) => {
|
|
const pool = new Pool()
|
|
const cursor = pool.query(new Cursor('SELECT * from generate_series(0, 1000)'))
|
|
cursor.read((err, rows) => {
|
|
expect(err).to.be(undefined)
|
|
expect(!!rows).to.be.ok()
|
|
cursor.close(done)
|
|
})
|
|
})
|
|
})
|