org-sql
org-sql copied to clipboard
Updating taking long / config problem?
Hello,
I'm trying to get org-sql running but have been scratching my head for the past hours over unusual behaviour:
- installation and configuration went through ok. Installed it from Melpa. (1 file compiled, 2 skipped)
- M-x org-sql-user-reset works ok.
- M-x org-sql-user-update works ok with 4 headlines
- M-x org-sql-user-clear-all works ok
- Another org-sql-user-update and clear-all work ok
- I add 5th heading, update gets stuck, clear all gets stuck,...
- If I delete the org.db and start again, it gets stuck with 5 headings.
Configuration seems ok (macOs, Catalina), creating a db worked. As I'm not really experienced in emacs (i.e. lisp), I'm not sure if I configured it ok. I've installed it from Melpa and this is what I have in the config file:
(use-package org-sql :ensure t ;; add config options here... :config (setq org-sql-files '("~/org/inbox.org")) )
Any ideas?
Can you post what headlines seem to be causing the problem? I've also never tested this on mac; I know there are a few problems in windows.
Sure. Here it is:
- TODO Task 1
- Inserted task
- TODO Task 2 ** TODO Another task
- [#B] One more
Interesting to note is also that update in general doesn't work second time. For example:
- reset => OK
- update (4 records) => OK
- delete one heading
- update (3 records) => says OK but nothing changes in db
I can't reproduce this on my system but I'm using linux and I don't have a Mac to test this. It sounds like the SQL buffer is getting hung on a command that isn't completing. Two things:
- Try deleting the *SQL: Org* buffer (and killing the process) after the hang and repeating the commands in the OP. Since you probably won't be able to do anything when org-sql is hung, Ctrl-G should kill the command and allow you to kill the buffer.
- If 1 succeeds, go into the source code and run
edebug-eval-top-level-form
on the functionorg-sql-user-update
right before running the command that hangs (this will run the debugger wheneverorg-sql-user-update
is called). Run the hanging command and step through the function (press space repeatedly) and you will see output in the minibuffer as you evaluate each sexp. Post the output that shows up after stepping through(org-sql-update-db)
(if it is normal it should be(nil nil nil)
but I'm guessing it will have some error message in the place of one of the nils.)
To make 2 easier above, I just pushed a commit that will print the errors you are supposed to see if they exist and you follow the edebug steps. 58a2482672b3af3347dfa789e0f659f2144ae362 adds a debug option which can be enabled by running (setq org-sql-debug t)
. If necessary, please activate this and run your command sequence again instead of 2, and post the output here if it says anything besides "Run successfully" or "Not run".
Consider running .trace
and .log
statements in the SQL: Org buffer before executing org-sql-user-reset
and org-sql-user-update
. The .help
command will give you more info on it.
That's what helped me to diagnose my issue
Awesome! Plan to give it a try asap when I get some time. Will report.