summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-07 21:28:39 +0300
committerThanos Apollo <[email protected]>2024-08-07 21:28:39 +0300
commitd16942df7e3830cbdf7d81d8dfdd0b73712d9325 (patch)
tree3bae328d9a572eed0834affe3a003dabcc08f0fc
parentbc0d2a3ec6195d79903ad7badec10a26538763c2 (diff)
[fix] drop-table: Seperate verification.
* gnosis--drop-table won't check if table exists, which seems to be buggy in new emacsql version * To check if a table exists, use gnosis-drop-table, although when combined with emacsql-with-transaction macro it might not be needed altogether.
-rw-r--r--gnosis.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/gnosis.el b/gnosis.el
index 8790d5e..f08e1c9 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -317,8 +317,12 @@ Optional argument FLATTEN, when non-nil, flattens the result."
(cl-defun gnosis--drop-table (table)
"Drop TABLE from `gnosis-db'."
+ (emacsql gnosis-db `[:drop-table ,table]))
+
+(cl-defun gnosis-drop-table (table)
+ "Drop TABLE from `gnosis-db'."
(when (gnosis-table-exists-p table)
- (emacsql gnosis-db `[:drop-table ,table])))
+ (gnosis--drop-table table)))
(cl-defun gnosis--insert-into (table values)
"Insert VALUES to TABLE."