Commit 2e80b78b by Orlando Vazquez

Add a createTable function to the common test code.

parent a3db51bf
...@@ -61,3 +61,21 @@ exports.getResultsStep = function (db, callback) { ...@@ -61,3 +61,21 @@ exports.getResultsStep = function (db, callback) {
doStep(); doStep();
}); });
} }
exports.createTable = function (db, name, columns, callback) {
var columnFragment
= '(' +
columns.map(function (i) {
return i.name + " " + i.type
}).join(', ') +
')';
db.prepare('CREATE TABLE ' + name + ' ' + columnFragment,
function (error, createStatement) {
if (error) throw error;
createStatement.step(function (error, row) {
if (error) throw error;
callback();
});
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment