Skip to content

SNOW-1858339: Support for AbortSignal #487

Open
@TimShilov

Description

@TimShilov

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

What is your Snowflake account identifier, if any?

xe29001

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementThe issue is a request for improvement or a new featurestatus-triage_doneInitial triage done, will be further handled by the driver team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions