◊(Local Yarn Code "Diff")

Differences From Artifact [3893f276]:

To Artifact [f6c8c8de]:


82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
  ([path        string/f]
   [title       string/f]
   [author      string/f]
   [published   string/f]
   [updated     string/f]
   [html        string/f]))

(define (init-cache-db!)
  (create-table! (cache-conn) 'cache:article)
  (create-table! (cache-conn) 'cache:note)
  (create-table! (cache-conn) 'cache:index-entry))

(define (delete-article! page)
  (query-exec (cache-conn)
              (~> (from cache:article #:as a)
                  (where (= a.page ,(format "~a" page)))
                  delete)))








|
|
|
|







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
  ([path        string/f]
   [title       string/f]
   [author      string/f]
   [published   string/f]
   [updated     string/f]
   [html        string/f]))

(define (init-cache-db! #:reset? [reset? #f])
  (for ([table (in-list '(cache:article cache:note cache:index-entry))])
    (when reset? (drop-table! (cache-conn) table))
    (create-table! (cache-conn) table)))

(define (delete-article! page)
  (query-exec (cache-conn)
              (~> (from cache:article #:as a)
                  (where (= a.page ,(format "~a" page)))
                  delete)))