16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
cache-conn ; The most eligible bachelor in Neo Yokyo
(schema-out cache:article)
(schema-out cache:note)
(schema-out cache:index-entry)
(schema-out listing)
delete-article!
delete-notes!
articles
articles+notes
listing-htmls
fenced-listing
unfence)
;; Cache DB and Schemas
|
>
>
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
cache-conn ; The most eligible bachelor in Neo Yokyo
(schema-out cache:article)
(schema-out cache:note)
(schema-out cache:index-entry)
(schema-out listing)
delete-article!
delete-notes!
delete-index-entries!
save-index-entries!
articles
articles+notes
listing-htmls
fenced-listing
unfence)
;; Cache DB and Schemas
|
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
(define (delete-notes! page)
(query-exec (cache-conn)
(~> (from cache:note #:as n)
(where (= n.page ,(format "~a" page)))
delete)))
;;
;; ~~~ Fetching articles and notes ~~~
;;
;; (Private use) Conveniece function for the WHERE `series-page` clause
(define (where-series q s)
(define (s->p x) (format "~a/~a.html" series-folder x))
|
>
>
>
>
>
>
>
>
>
|
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
(define (delete-notes! page)
(query-exec (cache-conn)
(~> (from cache:note #:as n)
(where (= n.page ,(format "~a" page)))
delete)))
(define (delete-index-entries! page)
(query-exec (cache-conn)
(~> (from cache:index-entry #:as e)
(where (= e.page ,(format "~a" page)))
delete)))
(define (save-index-entries! es)
(void (apply insert! (cache-conn) es)))
;;
;; ~~~ Fetching articles and notes ~~~
;;
;; (Private use) Conveniece function for the WHERE `series-page` clause
(define (where-series q s)
(define (s->p x) (format "~a/~a.html" series-folder x))
|