-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathir-helper.el
More file actions
41 lines (36 loc) · 1.25 KB
/
ir-helper.el
File metadata and controls
41 lines (36 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
;;; ir-helper.el --- Help in working with the db -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2022 Adham Omran
;;
;; Author: Adham Omran <adham.rasoul@gmail.com>
;; Maintainer: Adham Omran <adham.rasoul@gmail.com>
;; Created: June 23, 2022
;; Modified: June 23, 2022
;; Version: 0.0.1
;; Keywords: abbrev bib c calendar comm convenience data docs emulations extensions faces files frames games hardware help hypermedia i18n internal languages lisp local maint mail matching mouse multimedia news outlines processes terminals tex tools unix vc wp
;; Homepage: https://github.com/adham/ir-db-helper-functions
;; Package-Requires: ((emacs "24.3"))
;;
;; This file is not part of GNU Emacs.
;;
;;; Commentary:
;;
;;
;;
;;; Code:
;; (setq ir--table-list '("ir"))
(defun ir-helper-select-all ()
(interactive)
"Select all rows from TABLE."
(message "%s" (emacsql ir-db [:select *
:from ir])))
(defun ir-helper-drop-table ()
"Drop TABLE."
(interactive)
(emacsql ir-db [:drop :table ir]))
(defun ir-helper-find-item-from-id ()
"Find the item in the db based on the org-id in context."
(interactive)
(message "%s" (ir--query-by-column (org-id-get) 'id t)))
(provide 'ir-db-helper-functions)
;;; ir-db-helper-functions.el ends here