You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to add a connection method that would remove a queued (waiting) query from the connection queue? It would take a single parameter the query object as returned from connection.query() and it would remove the query from the queue if the query is waiting. It should respond with one of three states: query removed, query currently executing (can't be removed), query not found (probably already executed).
A rough pseudocode what it would do (specific implementation details will need to be refined):
class Connection extends EventEmitter {
...
remove (query) {
if (query === this._command) {
return false; // Query currently executing
}
var idx = this._commands.toArray().indexOf(query)
if (idx < 0) {
return false; // Query not found
}
this._commands.removeOne(idx)
return true;
}
...
}
We need this feature for implementing timeouts in Knex.js, see this discussion knex/knex#4416 (comment). We don't want to hack the driver internals and we would prefer to use a supported feature. I'm willing to create a PR with the implementation if the feature would be accepted.
I'm filing a symmetric feature request to mysql driver mysqljs/mysql#2478. It would be good to implement it in a compatible way in both drivers.
The text was updated successfully, but these errors were encountered:
Would it be possible to add a connection method that would remove a queued (waiting) query from the connection queue? It would take a single parameter the query object as returned from
connection.query()
and it would remove the query from the queue if the query is waiting. It should respond with one of three states: query removed, query currently executing (can't be removed), query not found (probably already executed).A rough pseudocode what it would do (specific implementation details will need to be refined):
We need this feature for implementing timeouts in Knex.js, see this discussion knex/knex#4416 (comment). We don't want to hack the driver internals and we would prefer to use a supported feature. I'm willing to create a PR with the implementation if the feature would be accepted.
I'm filing a symmetric feature request to
mysql
driver mysqljs/mysql#2478. It would be good to implement it in a compatible way in both drivers.The text was updated successfully, but these errors were encountered: