SNOW-1858339: Support for AbortSignal
What is the current behavior?
Right now you have to execute the query, get the statement in the response and call statement.cancel() when needed. That makes the cancellation more complicated because the client code needs to keep track of statements and have a custom cancellation logic.
What is the desired behavior?
I would like to have native support for AbortSignal in Snowflake SDK. That way instead of keeping track of running statements and implementing custom logic for each individual asynchronous thing, the client will just need to create a signal, pass it inside .execute() (and any other async operations that needed to be executed in parallel with it) and then abort the signal to stop all the async operations at once.
How would this improve snowflake-connector-nodejs?
AbortSignal is becoming the standard mechanism for cancelling async operations. Most of the asynchronous core Node.js APIs (Events, Streams, Fetch API, Timers Promises API) support it nowadays, and most of the HTTP clients (Axios, Got, Undici to name a few) support it as well. Adding support for AbortSignal will give users a more convenient way of cancelling running queries and will make snowflake-sdk more standardized with the rest of Javascript ecosystem.
References, Other Background
- Blog post from OpenJS talking about it
What is your Snowflake account identifier, if any?
xe29001
hi and thank you for opening this enhancement request. please bear with us until the team gets a chance to look at it and evaluate.
since you're already a Snowflake customer, you have another path into raising this feature request if you wish. You can contact your Sales rep. and tell them why implementing this feature would be important for you, and they have other means to plug into the product team to give the request more priority, if that's necessary.
otherwise, we'll update this issue once in a while but it could take some time