Discussion:
[nodejs] mutilple queries to DB using nodesql 8 and mssqlnodev8 for SQLServer DB
Lucky Jindal
2018-07-16 18:32:42 UTC
Permalink
Hi

I have a usecase where I have to execute multiple select queries with
different params to same table/DB. So bascially same query with different
params

so I formed an array of queries. Number of queries would be dynamic.

Now I want to run those parallel or sequence is also okay, and want to
fetch results back in array or map.
I am using msnodev8sql drivers to make connection and using connection
pooling.
I tried different ways , adding {multipleStatements: true} to db config but
did not work.
First select statement runs and thats all.
Tried tedious-connection-pool and other ways but failed with errors.Can
someone point me in the right direction or tell me if its possible or not.


Basic API/modules I use -

*var sql = require('mssql/msnodesqlv8')*
*var cp = sql.ConnectionPool(dbConfig)*

*var req = new sql.Request(cp);*
*cp.connect().then(function(){.. req.query().then()......})*


Above, I tried different variations like tedious connection pool or
multiple statements: true or even preparedStatements.
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/db9728a7-6d99-4368-8722-efe0dccbe167%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...