feat: import SQLite db to create a new graph

This commit is contained in:
Tienson Qin
2023-12-11 21:08:05 +08:00
parent 59fb0a58c7
commit 6684f28043
8 changed files with 89 additions and 28 deletions

View File

@@ -147,12 +147,14 @@
On iOS, repo-url might be nil"
[repo-url]
(when (not-empty repo-url)
(let [path (config/get-local-dir repo-url)
path (if (path/is-file-url? path)
(path/url-to-path path)
path)
parts (->> (string/split path #"/")
(take-last 2))]
(if (not= (first parts) "0")
(util/string-join-path parts)
(last parts)))))
(if (config/db-based-graph? repo-url)
(string/replace-first repo-url config/db-version-prefix "")
(let [path (config/get-local-dir repo-url)
path (if (path/is-file-url? path)
(path/url-to-path path)
path)
parts (->> (string/split path #"/")
(take-last 2))]
(if (not= (first parts) "0")
(util/string-join-path parts)
(last parts))))))