Skip to content

Instantly share code, notes, and snippets.

View akashpal-21's full-sized avatar

Akash akashpal-21

View GitHub Profile
@akashpal-21
akashpal-21 / org-roam-node-cache.el
Last active May 21, 2024 12:32
org-roam-node-cache.el
;; org-roam-node-cache.el
;; When `org-roam-node-read' is called --
;; `org-roam-node-read--completions' is initiated which fetches the list of struct nodes, applies FILTER-FN if any,
;; then formats them as specified by `org-roam-node-display-template' and finally
;; after sorting according to `org-roam-node-default-sort' or user SORT-FN
;; passes this final list further down.
;; `org-roam-node-read--completions' makes two subcalls -
;; A. To `org-roam-node-list' which queries the db and generates a nodes struct for each node.
@akashpal-21
akashpal-21 / org-roam-read+.el
Created May 28, 2024 10:20
org-roam-read+.el
;; org-roam-node-read+.el
(require 'org-roam-node)
;; Add a new constructor function to the org-roam-node struct
;; This constructor function avoids using &keys, and only takes a
;; curated lists of slots to construe the node struct.
(cl-defstruct (org-roam-node (:constructor org-roam-node-create)
(:constructor +org-roam-node-create
(id &optional file-title file-mtime level point file title olp))
@akashpal-21
akashpal-21 / org-roam-db-materialized-view.md
Last active June 2, 2024 14:14
Materialized View for org-roam.db

Introduction

While using Org-roam - the data is stored across tables in the database. The tables are as follows

(files . file title hash atime mtime)

(nodes . id file level pos todo priority scheduled deadline title properties olp)
@akashpal-21
akashpal-21 / org-roam-link-utils.el
Last active June 10, 2024 17:26
org-roam-link-utils.el