Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim
Created February 4, 2018 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vdeturckheim/e0001d68dbbc530186afdcc6e2de9ee3 to your computer and use it in GitHub Desktop.
Save vdeturckheim/e0001d68dbbc530186afdcc6e2de9ee3 to your computer and use it in GitHub Desktop.
const DB_NAME = 'tests-express-sqlite';
const Fs = require('fs');
const Path = require('path');
const Sqlite = require('sqlite3');
try {
Fs.unlinkSync(`./${DB_NAME}`);
}
catch (_ign) {}
const DB = new Sqlite.Database(DB_NAME);
const init = Fs.readFileSync(Path.join(process.cwd(), './database/init.sql'), 'utf-8');
DB.exec(init);
module.exports = DB;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment