From 209281dcd98231be16b8c67d05597758ae64f43b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 6 Oct 2013 15:06:19 +0200 Subject: Add tags command --- lisp/queries.lisp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp/queries.lisp') 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))) -- cgit v1.2.3-54-g00ecf