Skip to content

Instantly share code, notes, and snippets.

@rts-rob
Created September 9, 2017 10:07
Show Gist options
  • Save rts-rob/a4d17421ef8129081997960415827c7b to your computer and use it in GitHub Desktop.
Save rts-rob/a4d17421ef8129081997960415827c7b to your computer and use it in GitHub Desktop.
Sample query execution
let fs = require('fs');
...
const resetScript = fs.readFileSync("resetdata.sql");
const query = `USE ${requestingUser}; ${resetScript}`;
...
connection.query(query, function (error, results, fields) {
connection.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment