1

I am using https://github.com/mscdex/node-mariasql

I've got these stages in the process of running a query on the DB :

var Client = require('mariasql');
var client = new Client();
client.connect(...);
client.query(...);
client.end();

When should I run these ?

Run the whole thing (except the require of course) on every query ? Keep one instance of client and keep it open all the time, and just run .query for every query ?

Thanks

1 Answer 1

1

You should just need to query() for every query. Although if you want/need query concurrency > 1 then you should use a generic pooling module (there are at least a few on npm) to create a pool of mariasql connections instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.