MCPcopy Index your code
hub / github.com/brianc/node-postgres / _handleReadyForQuery

Method _handleReadyForQuery

packages/pg/lib/client.js:368–391  ·  view source on GitHub ↗
(msg)

Source from the content-addressed store, hash-verified

366 }
367
368 _handleReadyForQuery(msg) {
369 if (this._connecting) {
370 this._connecting = false
371 this._connected = true
372 clearTimeout(this.connectionTimeoutHandle)
373
374 // process possible callback argument to Client#connect
375 if (this._connectionCallback) {
376 this._connectionCallback(null, this)
377 // remove callback for proper error handling
378 // after the connect event
379 this._connectionCallback = null
380 }
381 this.emit('connect')
382 }
383 const activeQuery = this._getActiveQuery()
384 this._activeQuery = null
385 this._txStatus = msg?.status ?? null
386 this.readyForQuery = true
387 if (activeQuery) {
388 activeQuery.handleReadyForQuery(this.connection)
389 }
390 this._pulseQueryQueue()
391 }
392
393 // if we receive an error event or error message
394 // during the connection process we handle it here

Callers

nothing calls this directly

Calls 3

_getActiveQueryMethod · 0.95
_pulseQueryQueueMethod · 0.95
handleReadyForQueryMethod · 0.45

Tested by

no test coverage detected