Sqlite3 with FTS5

Hi
Can you enable FTS5 for sqlite3 or make it an option?

Jonas

I’m sure someone can. Why can’t that someone be you?

I don’t have a mac, otherwise I would do it.

Having a mac isn’t a requirement to install homebrew, and especially not to contribute to it. You just have to make a pull request and https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request can help you there.

It looks like the current version of sqlite in Homebrew is already compiled with FTS5 support:

• brew install sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.29.0.mojave.bott
Already downloaded: /Users/caleb/Library/Caches/Homebrew/downloads/e25e54c55f057ca8326d91a83df8eee4796421b683146e7c91e04edb6cab2c0e--sqlite-3.29.0.mojave.bottle.tar.gz
==> Pouring sqlite-3.29.0.mojave.bottle.tar.gz
==> Caveats
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.

If you need to have sqlite first in your PATH run:
  echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc

For compilers to find sqlite you may need to set:
  export LDFLAGS="-L/usr/local/opt/sqlite/lib"
  export CPPFLAGS="-I/usr/local/opt/sqlite/include"

For pkg-config to find sqlite you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/sqlite/3.29.0: 11 files, 3.9MB

~
• /usr/local/opt/sqlite/bin/sqlite3
SQLite version 3.29.0 2019-07-10 17:32:03
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> pragma compile_options;
COMPILER=clang-10.0.1
ENABLE_COLUMN_METADATA
ENABLE_DBSTAT_VTAB
ENABLE_FTS3
ENABLE_FTS3_PARENTHESIS
ENABLE_FTS4
ENABLE_FTS5
ENABLE_JSON1
ENABLE_PREUPDATE_HOOK
ENABLE_RTREE
ENABLE_SESSION
ENABLE_STMTVTAB
MAX_VARIABLE_NUMBER=250000
THREADSAFE=1
sqlite> .exit

Yeah, thanks. I just found that out myself now too. Maybe it’s enabled by default in newer versions of sqlite3. I didn’t see the --enable-fts5 option anywhere that’s why I immediately thought it would be a problem.