const Sequelize = require('sequelize'); const sequelize = new Sequelize({ dialect: 'sqlite', storage: 'notes.sqlite', logging: false }); global.sqlite = { initialize: async () => await sequelize.sync(), fetchNotes: async () => await sqlite.Note.findAll({ where: { spent: false } }), fetchShifterNotes: async (shifter) => await sqlite.Note.findAll({ where: { shifter: shifter } }), spentNote: async (note) => await sqlite.Note.update({ spent: true }, { where: { note: note } }), saveNote: async (note) => await sqlite.Note.create({ note: note.note, shifter: note.shifter, spent: false }), Note: sequelize.define('note', { shifter: Sequelize.STRING, note: Sequelize.STRING, spent: Sequelize.BOOLEAN }) }