summaryrefslogtreecommitdiff
path: root/database/category.lisp
blob: 70fb49bfa62f9b04cd7dffb0913a58cc1ffbd4d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(mito:deftable category ()
  ((name :col-type (:varchar 128))
   (percentage :col-type (:varchar 128)))
  (:record-timestamps nil)
  (:conc-name category-))

(mito:deftable category-split ()
  ((name :col-type (:varchar 128))
   (category :col-type category))
  (:record-timestamps nil)
  (:conc-name category-split-))

(defun category-splits (category)
  (mito:select-dao 'category-split
                   (sxql:where (:= :category category))
                   ;; Assumption that split categories are entered in the correct order by id
                   (sxql:order-by :id)))