MCPcopy
hub / github.com/brianc/node-postgres / run

Function run

packages/pg-cursor/test/pool.js:89–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87 it('can close multiple times on a pool', async function () {
88 const pool = new pg.Pool({ max: 1 })
89 const run = async () => {
90 const cursor = new Cursor(text)
91 const client = await pool.connect()
92 client.query(cursor)
93 await new Promise((resolve) => {
94 cursor.read(25, function (err) {
95 assert.ifError(err)
96 cursor.close(function (err) {
97 assert.ifError(err)
98 client.release()
99 resolve()
100 })
101 })
102 })
103 }
104 await Promise.all([run(), run(), run()])
105 await pool.end()
106 })

Callers 1

pool.jsFile · 0.70

Calls 4

readMethod · 0.95
closeMethod · 0.95
connectMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected