Function: org-roam-db-insert-file

org-roam-db-insert-file is a byte-compiled function defined in org-roam-db.el.

Signature

(org-roam-db-insert-file &optional HASH)

Documentation

Update the files table for the current buffer.

If UPDATE-P is non-nil, first remove the file in the database. If HASH is non-nil, use that as the file's hash without recalculating it.

Source Code

;; Defined in ~/.emacs.d/elpa/org-roam-20260224.1637/org-roam-db.el
(defun org-roam-db-insert-file (&optional hash)
  "Update the files table for the current buffer.
If UPDATE-P is non-nil, first remove the file in the database.
If HASH is non-nil, use that as the file's hash without recalculating it."
  (let* ((file (buffer-file-name))
         (file-title (org-roam-db--file-title))
         (attr (file-attributes file))
         (atime (file-attribute-access-time attr))
         (mtime (file-attribute-modification-time attr))
         (hash (or hash (org-roam-db--file-hash file))))
    (org-roam-db-query
     [:insert :into files
      :values $v1]
     (list (vector file file-title hash atime mtime)))))