diff options
Diffstat (limited to 'lisp/queries.lisp')
-rw-r--r-- | lisp/queries.lisp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/queries.lisp b/lisp/queries.lisp index 0ffb302..a7bdc69 100644 --- a/lisp/queries.lisp +++ b/lisp/queries.lisp @@ -141,3 +141,12 @@ (execute-to-list *db* (sql select "url" from "bookmark")))) + +(defun tag-list () + "Get a list of all tags stored." + (execute-to-list + *db* (sql select "name, COUNT(bookmark_id)" + from "tag" + join "bookmark_tag" on ("tag_id = tag.ROWID") + group by "tag.ROWID" + order by "COUNT(bookmark_id)" desc))) |