Comments (3)
Cancelling queries isn't a frequent feature to be used by developers, for sure. In fact, you are the first one to ever ask about it.
I personally have never used it. And now that you have asked, I just had a quick look at its implementation in file index.js
// cancel the query runned by the given client
PG.prototype.cancel = function(config, client, query) {
if(client.native) {
return client.cancel(query);
}
var c = config;
//allow for no config to be passed
if(typeof c === 'function') {
c = defaults;
}
var cancellingClient = new this.Client(c);
cancellingClient.cancel(client, query);
};
I'm not sure how this function really works underneath - is it synchronous or asynchronous? If it is the latter, then what even does it provide? It would be interesting to find out.
In the meantime, you can access the pg
instance via pgp.pg
property, and call pgp.pg.cancel()
the way you used to, I just don't know yet how it will work in this case. I think it was initially designed for use with the native client only, and since this library relies on connections from the pool,...
Try and see if it works, and let us know ;)
from pg-promise.
@DomenicoColandrea86 any update there? ;)
from pg-promise.
Closing due to inactivity.
from pg-promise.
Related Issues (20)
- helpers.sets() formats arrays with objects in them as text arrays instead of JSON / JSONB arrays HOT 2
- Timeout connection while inserting from text file. HOT 1
- Can't forcibly close connection after creating a template DB HOT 1
- ISSUE REGARDING INSERTION OF STRING IN POSTGRES QUERY HOT 2
- types: interop between Database and Task HOT 9
- "pg" dependency upgrade HOT 2
- Query methods are failing due to legacy Array checking methods not working with cross-realm objects HOT 2
- 10.15.1 crash on NodeJS 12 HOT 1
- IClient.release() has no return type annotation HOT 4
- Query re: WARNING: Creating a duplicate database object for the same connection HOT 3
- Request to update the RobustListener example to use async/await HOT 1
- Add https:// to link in About section HOT 2
- Is it possible to enum and timestamp using pgp.helpers.update? HOT 1
- Error not being thrown when statement cancelled due to timeout HOT 5
- batch is deprecated?
- ColumnSet does not recognize a table with schema HOT 6
- Question: Is it possible to use pg.helpers.ColumnSet to skip updating value based on column's new value
- CI issue HOT 3
- How safe is helpers concat against SQL injections HOT 1
- pg return error HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pg-promise.