[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gnosis 01c37bdbc7 1/7: db: Refactor pragma operations with
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gnosis 01c37bdbc7 1/7: db: Refactor pragma operations without using strings. |
Date: |
Tue, 10 Dec 2024 13:00:30 -0500 (EST) |
branch: elpa/gnosis
commit 01c37bdbc739cf9199735a078ca15ec56e4f0959
Author: Thanos Apollo <public@thanosapollo.org>
Commit: Thanos Apollo <public@thanosapollo.org>
db: Refactor pragma operations without using strings.
---
gnosis.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/gnosis.el b/gnosis.el
index aa209e4365..28efbf9662 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2466,7 +2466,7 @@ Return note ids for notes that match QUERY."
(emacsql gnosis-db [:alter-table decks :add ef-decrease])
(emacsql gnosis-db [:alter-table decks :add ef-threshold])
(emacsql gnosis-db [:alter-table decks :add initial-interval])
- (emacsql gnosis-db (format "PRAGMA user_version = 2"))
+ (emacsql gnosis-db [:pragma (= user-version 2)])
(gnosis--create-table 'activity-log gnosis-db-schema-activity-log)
;; Update to most recent gnosis db version.
(gnosis-db-update-v3)))
@@ -2486,17 +2486,18 @@ Return note ids for notes that match QUERY."
;; Add activity log
(gnosis--create-table 'activity-log gnosis-db-schema-activity-log)
;; Update version
- (emacsql gnosis-db (format "PRAGMA user_version = %s" gnosis-db-version))))
+ (emacsql gnosis-db [:pragma (= user-version gnosis-db-version)])))
(defun gnosis-db-init ()
"Create essential directories & database."
- (let ((gnosis-curr-version (caar (emacsql gnosis-db (format "PRAGMA
user_version")))))
- (unless (length> (emacsql gnosis-db [:select name :from sqlite-master
:where (= type table)]) 3)
+ (let ((gnosis-curr-version (caar (emacsql gnosis-db [:pragma
user-version]))))
+ (unless (length> (emacsql gnosis-db [:select name :from sqlite-master
:where (= type table)])
+ 3)
(emacsql-with-transaction gnosis-db
;; Enable foreign keys
- (emacsql gnosis-db "PRAGMA foreign_keys = ON")
+ (emacsql gnosis-db [:pragma (= foreign-keys 1)])
;; Gnosis version
- (emacsql gnosis-db (format "PRAGMA user_version = %s"
gnosis-db-version))
+ (emacsql gnosis-db [:pragma (= user-version gnosis-db-version)])
;; Create decks table
(gnosis--create-table 'decks gnosis-db-schema-decks)
;; Create notes table
- [nongnu] elpa/gnosis updated (eefd0abb3c -> 112693dd65), ELPA Syncer, 2024/12/10
- [nongnu] elpa/gnosis 01c37bdbc7 1/7: db: Refactor pragma operations without using strings.,
ELPA Syncer <=
- [nongnu] elpa/gnosis 710340b5f2 5/7: manifest: Use emacs-minimal., ELPA Syncer, 2024/12/10
- [nongnu] elpa/gnosis 3fdcb65b0f 2/7: dashboard-streak: Limit to 666 days, ELPA Syncer, 2024/12/10
- [nongnu] elpa/gnosis 112693dd65 7/7: Version bump: 0.4.9, ELPA Syncer, 2024/12/10
- [nongnu] elpa/gnosis ab980e8153 6/7: Update docs, ELPA Syncer, 2024/12/10
- [nongnu] elpa/gnosis b27b930f3e 4/7: makefile: Update tests, ELPA Syncer, 2024/12/10
- [nongnu] elpa/gnosis 40dbaf4c8d 3/7: dashboard: Create dashboard asynch., ELPA Syncer, 2024/12/10