Usage of Fastify with Sqlite (database and memory store) for development and testing using Sequelize.
- Fork repository
- Clone repository to the local environment
- Run
npm install
to install dependencies
For development we are using sqlite file database.sqlite3
, where we can store simplest data in sql schema. (We can use Postgres, MySQL, MariaDB, MsSql for persistant storage in development mode.)
- Run migrations
npm run migrate
- It will generate database.sqlite3
file if we don't have it.
- Seed database
npm run seed
- It will seed our database with the data.
- Start the application
npm run start
- Run application on PORT 3000
- Run tests
npm run test
- run tests with data placed in memory
store.
In app.js
we are using .sync()
method to sync all data contained in database or memory
store.