1
1
mirror of https://github.com/qfpl/applied-fp-course.git synced 2024-11-26 06:38:40 +03:00
applied-fp-course/level04
Sean Chalmers 959eb576aa Issue Fixes & More feedback driven development
Fixes: #15, #13, #14, #11, #8

Add the IDEAS to a 'Suggestions' section in the FUTURE_PLANS file.

* Updated the cabal instructions for level 03
* Removed the duplicated config loading in level 05
* Add the implementations for File.hs for levels 06 & 07
* Renamed the slightly misleading 'readObject' function
* Fixed the capitalisation of init and close DB functions between levels
  04 & 05.
2018-01-22 11:40:11 +10:00
..
bin Fix project restructure 2017-08-14 16:48:34 +10:00
src/FirstApp Issue Fixes & More feedback driven development 2018-01-22 11:40:11 +10:00
tests Updates based on course run feedback. 2018-01-16 12:36:57 +10:00
changelog.md change changelog files to lowercase 2017-09-01 11:17:26 +10:00
default.nix Overhauled nix file setup to be more like the other QFPL projects. 2017-09-18 10:14:29 +10:00
level04.cabal Updates based on course run feedback. 2018-01-16 12:36:57 +10:00
level04.nix Updates based on course run feedback. 2018-01-16 12:36:57 +10:00
LICENCE update copyright notice 2017-09-12 11:51:26 +10:00
README.md Updates based on course run feedback. 2018-01-16 12:36:57 +10:00
Setup.hs Add Level 04 2017-08-11 10:40:05 +10:00
stack.yaml Add stack.yaml files for all directories. 2018-01-10 10:33:56 +10:00
test.json Rebuilt Conf File Read Handling 2017-09-12 11:21:27 +10:00

Level 04

We need a place to store our Comments/Topics, so we're going to add a database to our application, specifically the SQLite database. We've chosen SQLite because it was the simplest to have up and running for the purposes of the course.

There is an example module included for using PostgreSQL, however the course will focus on the SQLite implementation.

For reference, the packages we will use to talk to our database are:

You will also need the SQLite database application installed and available on your system.

Also we will not necessarily provide all of the required imports any more, there may be other things you have to bring into scope.

The steps for this level:

  1. src/FirstApp/DB/Types.hs
  2. src/FirstApp/Types.hs
  3. src/FirstApp/DB.hs
  4. src/FirstApp/Main.hs

For the sake of simplicity, any configuration requirements will be hardcoded in FirstApp/Conf.hs for now. We will return to that in the next level.

NB: The PostgreSQL example module is in src/FirstApp/DB/PostgreSQL.hs.