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

Method close

packages/pg-cursor/index.js:211–232  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

209 }
210
211 close(cb) {
212 let promise
213
214 if (!cb) {
215 promise = new this._Promise((resolve, reject) => {
216 cb = (err) => (err ? reject(err) : resolve())
217 })
218 }
219
220 if (!this.connection || this.state === 'done') {
221 setImmediate(cb)
222 return promise
223 }
224
225 this._closePortal()
226 this.connection.once('readyForQuery', function () {
227 cb()
228 })
229
230 // Return the promise (or undefined)
231 return promise
232 }
233
234 read(rows, cb) {
235 let promise

Callers 12

runFunction · 0.95
submittable.jsFile · 0.45
error-handling.jsFile · 0.45
_closePortalMethod · 0.45
poolQueryPromiseFunction · 0.45
close.jsFile · 0.45
transactions.jsFile · 0.45
index.jsFile · 0.45
endMethod · 0.45
_destroyMethod · 0.45

Calls 2

_closePortalMethod · 0.95
cbFunction · 0.85

Tested by

no test coverage detected