用 sqlite3 访问 TheBrain 10 的数据库

连接数据库,仅读取指定节点的基本信息

/* name:节点名, label:节点简述, kind:节点类别, actype:隐私属性 */
select name,label,kind,actype
from thoughts
where id = '2295eb8f-a6fb-4604-9ade-4b344b2ba36c'

同时读取当前节点及其 tag 信息

/* t1.name:标签名, t2.name:节点名 */
select t2.name,t1.name
from thoughts as t1 inner join links as l inner join thoughts as t2
where t2.id = l.thoughtIdA and l.thoughtIdB = t1.id and
l.meaning = 5 and t1.id = '2dbc266e-6928-4dad-b501-5a908438134d'

同时读取当前节点及其笔记/附件信息

/* t.name:节点名, att.name:附件名 */
select t.name,att.name
from thoughts as t inner join attachments as att
where t.id = att.sourceid and t.id = '2295eb8f-a6fb-4604-9ade-4b344b2ba36c'

同时读取当前节点及其后继节点信息

/* curr.name:当前节点名, post.name:后继节点名 */
select curr.name, post.name
from thoughts as curr inner join links as l1 inner join thoughts as post
where curr.id = l1.thoughtIdA and l1.thoughtIdB = post.id and l1.relation = 1 and curr.id="0a3d4f80-e6b4-412a-89a8-7cb3fdc52cf9"

同时读取当前节点及其相关日期信息

select t.name, datetime((t.datetime / 10000000) - 62135553600, 'unixepoch')
最后更新日期: 2019-05-08 21:40:30

使用 GitHub 账号发表评论