(feat): cache all link-types (#1009)

Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
This commit is contained in:
odomanov
2020-08-10 14:59:02 +07:00
committed by GitHub
parent 9753ee451f
commit 0318983cac
3 changed files with 65 additions and 61 deletions

View File

@ -329,7 +329,7 @@ Insertions can fail if the key is already in the database."
If the file does not have any connections, nil is returned."
(let* ((query "WITH RECURSIVE
links_of(file, link) AS
(WITH filelinks AS (SELECT * FROM links WHERE \"type\" = '\"file\"'),
(WITH filelinks AS (SELECT * FROM links WHERE NOT \"type\" = '\"cite\"'),
citelinks AS (SELECT * FROM links
JOIN refs ON links.\"to\" = refs.\"ref\"
AND links.\"type\" = '\"cite\"')
@ -351,7 +351,7 @@ This includes the file itself. If the file does not have any
connections, nil is returned."
(let* ((query "WITH RECURSIVE
links_of(file, link) AS
(WITH filelinks AS (SELECT * FROM links WHERE \"type\" = '\"file\"'),
(WITH filelinks AS (SELECT * FROM links WHERE NOT \"type\" = '\"cite\"'),
citelinks AS (SELECT * FROM links
JOIN refs ON links.\"to\" = refs.\"ref\"
AND links.\"type\" = '\"cite\"')