@@ -7,10 +7,12 @@ db/base db/sqlite3 threading pollen/setup racket/match + (rename-in racket/list + (group-by group-list-by)) "dust.rkt" (except-in pollen/core select)) (provide init-cache-db! cache-conn ; The most eligible bachelor in Neo Yokyo @@ -25,11 +27,12 @@ articles+notes listing-htmls - unfence) + unfence + series-grouped-list) ;; Cache DB and Schemas (define DBFILE (build-path (current-project-root) "vitreous.sqlite")) (define cache-conn (sqlite3-connect #:database DBFILE #:mode 'create)) @@ -199,5 +202,12 @@ ;; Remove "" introduced by using ->html on docs containing output from ;; listing functions (define (unfence html-str) (regexp-replace* #px"<[\\/]{0,1}style>" html-str "")) + +;; +;; ~~~ Fetching series ~~~ +;; +(define (series-grouped-list) + (~> (for/list ([row (in-entities cache-conn (from cache:series #:as s))]) row) + (group-list-by cache:series-noun-plural _ string-ci=?)))