We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$ 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}>
The text was updated successfully, but these errors were encountered:
This is now either resolved either slightly different.
(mito:deftable parent () ()) (mito:deftable child () ((parent :col-type parent))) (mito:connect-toplevel :sqlite3 :database-name "mito-example.db") (mapc #'mito:execute-sql (mapcan #'mito:table-definition '(parent child))) (mito:create-dao 'child :parent (mito:create-dao 'parent)) (mito:find-dao 'child) ;; => <CHILD object> (describe *) #<CHILD {100809C873}> [standard-object] Slots with :INSTANCE allocation: CREATED-AT = @2024-11-04T18:26:48.822588+01:00 UPDATED-AT = @2024-11-04T18:26:48.822588+01:00 SYNCED = T ID = 1 PARENT = #<unbound slot> PARENT-ID = 1
=> parent is unbound, the parent-id is OK,
parent
there is no parent accessor but the child-parent accessor works:
child-parent
(child-parent (mito:find-dao 'child)) ;; => #<PARENT {1009083C63}>
continuing
;; Specify the accessor explicitly (mito:deftable child () ((parent :col-type parent :accessor child-parent))) (child-parent (mito:find-dao 'child)) ;; => #<PARENT {1005BD41D3}> ;; and now (parent (mito:find-dao 'child)) ;; => same
in addition there is now the parent accessor.
However all is not clear when I try accessors on my own projects, specially when the :slot-type is (or :null :a-table), afaik.
:slot-type
(or :null :a-table)
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: