org roam

inner join nodes source on source.id = l.source
inner join nodes dest on dest.id = l.dest
where l.type = '"id"'
and source.file not like '%daily%';

Find orphaned records

from nodes n
where not exists (
      select null from links l where n.id = l.source
)
and not exists (
    select null from links l where n.id = l.dest
);