MCPcopy Create free account
hub / github.com/porsager/postgres / cancel

Function cancel

cf/src/index.js:351–364  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

349 }
350
351 function cancel(query) {
352 return new Promise((resolve, reject) => {
353 query.state
354 ? query.active
355 ? Connection(options).cancel(query.state, resolve, reject)
356 : query.cancelled = { resolve, reject }
357 : (
358 queries.remove(query),
359 query.cancelled = true,
360 query.reject(Errors.generic('57014', 'canceling statement due to user request')),
361 resolve()
362 )
363 })
364 }
365
366 async function end({ timeout = null } = {}) {
367 if (ending)

Callers

nothing calls this directly

Calls 2

ConnectionFunction · 0.70
cancelMethod · 0.65

Tested by

no test coverage detected