This is a repository that demonstrates how to use Clojure libraries: Toucan, HoneySQL This repository uses Uses Clerk to show up as notebook.
https://sindhubb.github.io/clerk-databases/
- Ensure you have Postgres installed
- Create a postgres user called 'chef'
- Create a database called recipes Make chef the owner of recipes
- From this repo, run
lein migrate -- --migrate
. This will create all the required tables and seed data.
- Install dependencies with
lein deps
- Ensure you have Calva installed on your VSCode
- Start Calva Leiningen project REPL
- Add this to this repository's
.vscode
intosettings.json
:
{
"calva.jackInEnv": {
},
"calva.customREPLCommandSnippets": [
{
"name": "Open in Clerk",
"key": "d",
"snippet": "(require '[nextjournal.clerk :refer [show!]]) (show! \"$file\")"
},
{
"name": "Start Clerk",
"key": "s",
"snippet": "(require '[nextjournal.clerk :refer [serve!]]) (serve! {:port <PORT> :watch-paths [\"src/databases\"]})"
}
],
}
Remember to replace with your desired port.
- Press these keys:
control + option + space - starts custom calva commands
s -> start clerk
d -> open current file in clerk
- Browse
http://localhost:<PORT>
to see the live notebook
Run lein make-docs
and you should see html files generated under src/databases
You can open ./docs/index.html
in any browser and browse as you normally would. You can also serve these HTML files with lein ring server-headless <PORT>
- design a recipes database ?
- add things to utilise in honeysql
- add things to utilise in toucan
- how to honeysql?
- how to toucan?
- how to connection pool?
- how to pg rls?
- how to clickhouse?