ahyatt / ekg

The emacs knowledge graph, app for notes and structured data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ekg-upgrade-db: Searching for program: No such file or directory, sqlite3

sg-qwt opened this issue · comments

Hi,

I installed fresh ekg from melpa.

I tried both melpa stable (0.4.2) and melpa (20231111.513).

On startup calling egk-capture: it reports ekg-upgrade-db: Searching for program: No such file or directory, sqlite3

Then if I tried to save any of the new capture buffer, it says:

apply: Database error: "disk I/O error"
Database error: "disk I/O error"

Note I'm using emacs29.1 with sqlite builtin:
value of triples-sqlite-interface is builtin, (sqlite-available-p) is t

The same emacs works fine with org-roam with the builtin sqlite.

I'm not sure how to proceed with the debug any further, any help would appreciate.

Thanks!

Also I'm able to sqlite-mode-open-file on ~/.config/emacs/triples.db

Here's how the data look like under sqlite-mode:

Table Name  Number of Rows  
triples                  44 
  rowid  subject                     predicate              object           properties  
      46 inline/pos                  base/unique            t                ()          
      47 inline/pos                  base/type              integer          ()          
      49 inline/type                 base/unique            t                ()          
      50 inline/type                 base/type              symbol           ()          
      52 inline/for-text             base/unique            t                ()          
      53 tag                         base/type              schema           ()          
      54 tag                         schema/property        tagged           ()          
      55 tag/tagged                  base/virtual-reversed  tagged/tag       ()          
      56 named                       base/type              schema           ()          
      57 named                       schema/property        name             ()          
      58 email                       base/type              schema           ()          
      59 email                       schema/property        address          ()          
      60 person                      base/type              schema           ()          
      61 titled                      base/type              schema           ()          
      62 titled                      schema/property        title            ()          
      63 titled/title                base/type              string           ()          
      64 ekg                         base/type              schema           ()          
      65 ekg                         schema/property        version          ()          
      66 ekg/version                 base/type              cons             ()          
      67 ekg/version                 base/unique            t                ()          
      68 tagged                      base/type              schema           ()          
      69 tagged                      schema/property        tag              ()          
      70 tagged/tag                  base/type              string           ()          
      71 text                        base/type              schema           ()          
      72 text                        schema/property        text             ()          
      73 text/text                   base/unique            t                ()          
      74 text/text                   base/type              string           ()          
      75 text                        schema/property        mode             ()          
      76 text/mode                   base/unique            t                ()          
      77 text/mode                   base/type              symbol           ()          
      78 text                        schema/property        inlines          ()          
      79 text/inlines                base/virtual-reversed  inline/for-text  ()          
      80 time-tracked                base/type              schema           ()          
      81 time-tracked                schema/property        creation-time    ()          
      82 time-tracked/creation-time  base/unique            t                ()          
      83 time-tracked/creation-time  base/type              integer          ()          
      84 time-tracked                schema/property        modified-time    ()          
      85 time-tracked/modified-time  base/unique            t                ()          
      86 time-tracked/modified-time  base/type              integer          ()          
      87 inline                      base/type              schema           ()          
      88 inline                      schema/property        command          ()          
      89 inline/command              base/unique            t                ()          
      90 inline/command              base/type              symbol           ()          
      91 inline                      schema/property        args             ()          

Thank you for the bug report! I think what is happening is that when the upgrade routine is called, it performs a backup. There is no built-in sqlite backup in emacs. I've attempted to add one, but the maintainers disagreed that it was needed. Because we can't back up via emacs, we have to call out to the sqlite3 executable directly, which you either do not have or is not in your path. If it's the latter, you can set triples-sqlite-executable (which I probably should make into a customized variable).

I can make backup optional, but I'm not sure if that's a good idea. I'm a bit afraid of people losing their work if they start using it without backups.

I didn't realize external sqlite3 is required with emacs29, thanks for the clarification. Too bad the maintainers won't accept the patch, the backup is core function for emacs application based on sqlite.

I've added sqlite3 to my path and everything works fine as expected, I'll take that as workaround for now. I don't think make backup optional is good idea also.

Thanks for the help.

Good to hear, thanks! I won't close this out yet, since at the very least we can make a more useful error message.

I may also see if it makes sense to revive that thread and get this into emacs.

The latest commit should provide a much better experience here. Thank you for reporting the problem.