node-odbc icon indicating copy to clipboard operation
node-odbc copied to clipboard

[Feature Request] Support SQLCancel

Open anotherminh opened this issue 7 months ago • 1 comments

Currently, SQLCancel is not supported by node-odbc.

This makes it tricky for production workloads where we want to implement a timeout for long-running queries, so we can serve other requests.

An example of what supporting such feature may look like:

// For connections
const connection = await odbc.connect(connectionString);
const queryPromise = connection.query('SELECT * FROM large_table', { timeout: 30 });

// Cancel after 10 seconds
setTimeout(() => {
  connection.cancel(); // Cancel the current query
}, 10000);

Happy to PR as well.

anotherminh avatar Sep 17 '25 16:09 anotherminh

this would be so helpful 🙏

michaelfarrell76 avatar Sep 17 '25 17:09 michaelfarrell76