Created
February 4, 2018 20:10
-
-
Save vdeturckheim/e0001d68dbbc530186afdcc6e2de9ee3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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