From 58906c635ad0ea2028f99997cb673ef40a2ea2bb Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 12 May 2025 22:10:39 +0200 Subject: Add sqlite database --- src/chef/database/init.clj | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/chef/database/init.clj (limited to 'src/chef/database') diff --git a/src/chef/database/init.clj b/src/chef/database/init.clj new file mode 100644 index 0000000..f791e39 --- /dev/null +++ b/src/chef/database/init.clj @@ -0,0 +1,16 @@ +(ns chef.database.init + (:require [next.jdbc :as jdbc] + [honey.sql :as sql])) + +(defn exec! [db] + (jdbc/execute! db (sql/format {:create-table :categories + :with-columns [[:id :integer :auto-increment :primary-key] + [:name :text] + [:question :text] + [:children :text] + [:parent :text]]})) + (jdbc/execute! db (sql/format {:create-table :recipes + :with-columns [[:id :integer :auto-increment :primary-key] + [:category :integer] + [:title :text] + [:description :text]]}))) -- cgit v1.2.3