mito
mito copied to clipboard
The accessor created by deftable cannot access dao.
$ createdb mito-example
(ql:quickload :mito)
(mito:deftable parent ()
())
(mito:deftable child ()
((parent :col-type parent)))
(mito:connect-toplevel :postgres :database-name "mito-example")
(mapc #'mito:execute-sql (mapcan #'mito:table-definition '(parent child)))
(mito:create-dao 'child :parent (mito:create-dao 'parent))
(child-parent (mito:find-dao 'child)) ;; The slot PARENT is unbound in the object
;; Specify the accessor explicitly
(mito:deftable child ()
((parent :col-type parent :accessor child-parent)))
(child-parent (mito:find-dao 'child)) ;; => #<PARENT {1005BD41D3}>