Comments (8)
Looking forward to that feature ^_^
from tedious.
Basic support for parameters has been added. Add parameters to the request, and call execSql
as usual.
var TYPES = require('tedious').TYPES;
var request = new Request('select @param1, @anotherParam', function(err) {
....
});
request.addParameter(TYPES.VarChar, 'param1', 'qwerty');
request.addParameter(TYPES.Int, anotherParam', 42);
connection.execSql(request);
Output parameters can be added too. See issue #16 for an example.
Note: I am not convinced that the API is quite right. There's a good chance that it will change.
from tedious.
same looking forward to this however on master or anything above this commit 5765a3d seems to break the request events 'row' and 'done'
from tedious.
The done
event I might have an idea about, but a problem with row
event would be puzzling. If it wasn't being emitted I'd expect a number of the integration tests to fail.
I'll take a look tomorrow, and try and recreate the problem.
from tedious.
Ok also a bit more information, we are using it in a system of ours and the first statement that is running was an insert statement so that may be why the row event was not firing and so if that the expected behavior that is fine, the done event should still work though i would think.
from tedious.
Please note, the first two arguments to the Request.addParameter and Request.addOutputParameter functions have been swapped around. The first argument is now the parameter name.
request.addParameter('parameterName', TYPES.VarChar, string);
request.addParameter('anotherParameterName', TYPES.Int, number);
from tedious.
The parameterisation support was achieved using the sp_executesql
procedure. This means that the doneProc
event is emitted, when previously the done
event would typically have been emitted. I suspect that trying to subvert TDS and hide this, would probably be difficult, and give rise to a never ending stream of edge case bugs.
Instead, I've added a row count parameter to the Request
callback. So in many use cases the done
, doneInProc
and doneProc
event can probably be ignored.
from tedious.
Included in v0.0.4.
from tedious.
Related Issues (20)
- [High Severity] Regular Expression Denial of Service (ReDoS) in [email protected] introduced by tedious HOT 3
- [QUESTION] Expected behavior of parallel Strategy for MultiSubnetFailover option HOT 5
- Minor addition to exception information on failed bulk-load data due to type validation: Mention the failed column and errorneous value HOT 1
- Network socket not correctly cleaned up when connection timeout fires during TDS8.0 TLS negotiation HOT 2
- Unable to connect to Azure SQL using azure directory password authentication. HOT 2
- not able to connect to Microsoft Fabric HOT 6
- [QUESTION] How do I check the status of a connection? HOT 3
- Dead Links in documentation HOT 3
- [FEATURE REQUEST] Cloudflare Workers support HOT 3
- unsupported type "BitN" from querying a BIT column HOT 5
- connection error: SSL routines:ssl_choose_client_version:unsupported HOT 2
- [perf] Performance loss on `<instance_members_initializer>` during token parsing HOT 3
- `MessageIO.prototype.startTls` should follow `tls.connect` semantics HOT 1
- Always Encrypted Roadmap
- Need to update @azure/msal-node to 2.0 for NodeJs 20 compatability HOT 9
- Login failure with caret (^) in password HOT 2
- [FEATURE REQUEST] HOT 3
- README Getting Started Links Out-of-Date HOT 1
- [FEATURE REQUEST] Connection socket ref/unref HOT 1
- Getting RangeError [ERR_OUT_OF_RANGE] for "smalldatetime" type column while using bulk insert HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tedious.