Skip to content

Wrong technique for using a many-to-many relationship #2

@larsen

Description

@larsen

I think I'm using the wrong technique for managing the many-to-many relation between bookmarks and their tags.
In particular, I think the function I'm using to fetch the tags for a bookmark is overly complicated, and not what I'm supposed to do with the Mito library.

(defun tags (bookmark)
  (mito:select-dao 'tag
    (sxql:where
     (:in :id (mapcar (lambda (obj) (slot-value obj 'tag-id))
                      (mito:select-dao 'l-bookmark-tag
                        (sxql:where (:= :bookmark_id (mito:object-id bookmark)))))))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions