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

Function cancel

cjs/src/index.js:350–363  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

ConnectionFunction · 0.70
cancelMethod · 0.65

Tested by

no test coverage detected