Creating a database model
The examples in Database model section are not finished, although hopefully you have learned enough to be able to continue working on this for homework.
Please ask questions and share your approaches in the Practicalli Contact channels
These examples will be updated to use next.jdbc over Winter 2020
Our tasks are quite simple and so its easy to represent them as a single table
- id (auto-generated)
- name of task
- description of task
- type of task
Each task will have a unqiue ID, automatically generated when a new record is created.
The name, description and type of task are all strings.
The type of task could be managed by a second table that lists all the tasks. However, this is only meant to be a simple app at this stage.
We need to decide what namespace to put our data model in. It seems to make sence to create a new namespace, to help keep our code clean and to seperate concerns. So we will create a namespace
We will need to decide wheter to add the
items namespace to core or to the handlers... or maybe create another handler namespace for handlers that just access the database
(:require [todo-list.items :as items]