(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 :primary-key :autoincrement] [:name :text] [:question :text] [:parent :integer]]})) ;TODO: create root category (jdbc/execute! db (sql/format {:create-table :recipes :with-columns [[:id :integer :auto-increment :primary-key] [:category :integer] [:title :text] [:description :text]]})))