CLSQL実験(1)

SQLite3を使ったCLSQLの実験。買い物を整理するデータベースのつもり。クラスを定義する



(clsql:def-view-class Kaimono ()
((id :accessor id-of :db-kind :key :db-constraints :not-null :type integer :initarg :id)
(cost :accessor cost-of :type integer :initarg :cost)
;; (date :accessor date-of :type clsql:date :initarg :date) ;; SQLite3 はDATE型がない!!
(date :accessor date-of :type clsql:date :db-type "integer" :initarg :date ;; INTEGERで保存して、DATE(MJD)に変換する
:db-writer clsql ...

more…