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

Method _pulseQueryQueue

packages/pg/lib/client.js:603–624  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

601 }
602
603 _pulseQueryQueue() {
604 if (this.readyForQuery === true) {
605 this._activeQuery = this._queryQueue.shift()
606 const activeQuery = this._getActiveQuery()
607 if (activeQuery) {
608 this.readyForQuery = false
609 this.hasExecuted = true
610
611 const queryError = activeQuery.submit(this.connection)
612 if (queryError) {
613 process.nextTick(() => {
614 activeQuery.handleError(queryError, this.connection)
615 this.readyForQuery = true
616 this._pulseQueryQueue()
617 })
618 }
619 } else if (this.hasExecuted) {
620 this._activeQuery = null
621 this.emit('drain')
622 }
623 }
624 }
625
626 query(config, values, callback) {
627 // can take in strings, config object or query object

Callers 3

_handleReadyForQueryMethod · 0.95
queryMethod · 0.95
client.jsFile · 0.80

Calls 3

_getActiveQueryMethod · 0.95
submitMethod · 0.45
handleErrorMethod · 0.45

Tested by

no test coverage detected