Sqlite now in Emacs distribution

Not sure if you all saw this, but thought you might be interested. Looks like sqlite got added (optionally) to the emacs distribution emacs.git - Emacs source repository

I know that there’s been some talk in the past about migrating some of the db related features to org proper, in order for them to be taken advantage of in more than just roam. Seems like this might make that more of a possibility. At the very least, it might be even easier/simpler to install org-roam in the future.

5 Likes

Wow, I totally want to try this. Since it was added in the last week, is the only way to try this out to check out HEAD and build from source?

I was tempted to try just copying the lisp/sqllite-mode.el file into my local configuration, but I read in there that it depends on sqlite.c, which gave me the impression that wouldn’t work.

sqlite.c has been added to the dev branch of Emacs (for version 29, not the upcoming 28), if I’m reading this correctly.

I can’t assess how useful it will be for Org-roam – the foreign key switch needs to be turned on somehow, perhaps in the source code (?)

I build Emacs 29 (from git) myself. But it seems (based on system-configuration-features) that SQLITE3 is not part of it by default.

Do you know how I can switch it on via build or where should I look into the build system to get the switch myself?

What’s your OS?

As far as I see in the source, and from my build on Ubuntu, the switch is on by default; below is what I did (from my log for December 2022)

    $ git clone https://git.savannah.gnu.org/git/emacs.git --branch emacs-29 --depth 1 emacs-29
    $ ./autogen.sh
    $ ./configure --with-native-compilation --with-tree-sitter --with-small-ja-dic
    $ make -j$(nproc)

If SQLITE is not part of your Emacs feature, you probably do not have the sqlite3 library. Again on Ubuntu:

sudo apt install libsqlite3-dev

Use function sqlite-available-p to check sqlite availability in your Emacs.

In addition, when you have run configure, at the end it should display a summary. You should be able to see if you have the correct sqlite library so that make can build it with the feature.

probably do not have the sqlite3 library

Them it can not be “on by default” if ti depends on an installed libraray. The buld system need to take care of that.
The state of the on/off switch shouldn’t depend on the available libraries installed. The system need to inform the user if a lib is missing in that case.

I do not follow your argument but perhaps you can take it to Emacs development mailing list and see what they might say.

I don’t have any further comment on this matter from a perspective of an Org-roam and Emacs user.

Like I said, you get to see a summary and see this.