-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature proposal #9
Comments
// connection timeout, can set the attribute on ODBC driver connect :-
|
Thanks, it's working, but as you said, it's not very reliable. Real timeout varies according to the type of test.
|
i added query timeout via the API, this seems to be more exact in terms of behavior. I will take a look at adding query request cancel.
|
Can you think of a simple example which should raise more than one error so I can take a look at this request. |
With the recent error handling changes, I think handling multiple errors would be a next logical step. With the following query, only the first error returns an error to the query callback:
Interestingly, the callback does get called two times with a null error. |
OK, This should be supported on latest version. |
I have cancel on a branch checked in and appears to be working. It is a fairly substantial change so I will test over coming days before merging it across and releasing. You can now cancel a stored proc call, prepared query or vanilla query,
|
closing let me know what else is required. |
@TimelordUK Can you please help me figure out how to handle multiple errors? This is my code: sql.open(connectionString, function (err, con) {
if (err) {
console.log('failed to open ' + err.message)
}
const req = con.query('select a;select b;', (err) => {
console.log("done", err)
})
req.on("info", (msg) => {
console.log("info", msg)
})
req.on("error", (msg) => {
console.log("error", msg)
})
}) All I get is:
Running the comamnd via Tedious or SQL Server Management Studio gives me this:
Thank you. Great job on adding all the missing features btw! |
ill release a fix for this const sql = require('msnodesqlv8')
const connectionString = 'Driver={SQL Server Native Client 11.0}; Server=np:\\\\.\\pipe\\LOCALDB#E086FCD9\\tsql\\query; Database={master}; Trusted_Connection=Yes;'
sql.open(connectionString, function (err, con) {
if (err) {
console.log('failed to open ' + err.message)
}
const req = con.query('select a;select b;')
req.on("error", (msg) => {
console.log("error", msg)
})
}) error { [Error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'a'.] sqlstate: '42S22', code: 207 } |
Just a small withlist. You know... it's Christmas :)
The text was updated successfully, but these errors were encountered: