I am trying to create a utility that will read the select statements from
the raw sql files, putting them in a string and executing the
connection.reader.
with something like var reader = connection.reader(sql_file(inventory.sql),
[]);, Is this possible?
Util.js
var fs = require('fs');
function sql_file(sql_file, cb) {
var fileName = "./SQLs/" + sql_file;
fs.readFile(fileName, function(err, buffer) {
if (err) return cb(err);
return cb(null, buffer.toString());
});
}
module.exports.sql_file = sql_file;
Main.js
var sqlUtil = require('./sqlUtil');
var reader = connection.reader(sql_file(inventory.sql), []);
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.