Persist items to the database

The database that was chosen here is SQLite, because it's dead simple to
setup and more than enough for this project.

Please note that I took some liberty with the assignment. I chose to use
a numeric field for the `id` column of an item. This leverages automatic
creation and incrementation of the id by SQLite itself.
This commit is contained in:
2026-01-31 01:59:32 +01:00
parent da6f8b4519
commit eded366570
4 changed files with 53 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ default, the server listens on port 3000.
* `reitit`: for handling routes
* `jetty`: web server
* `muuntaja`: JSON handling
* `next.jdbc`: database interface (SQLite)
## Documentation links
@@ -29,3 +30,5 @@ The following links proved more than useful when working on this assignment:
* <https://github.com/metosin/reitit/blob/master/doc/ring/content_negotiation.md>
* <https://ostash.dev/posts/2021-08-22-data-validation-in-clojure/>
* <https://clojurecivitas.github.io/malli/elements_of_malli.html>
* <https://github.com/metosin/reitit/blob/master/doc/coercion/malli_coercion.md>
* <https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.3.1086/doc/getting-started>