Hacker News new | ask | show | jobs
by llimllib 1310 days ago
Not by default, you can test it out here[1].

I documented how to compile an extension into the wasm build here[2], I assume something like that would work for fts? But I'm not sure exactly.

edit: it does build with fts4 by default, just not fts5; I'm not sure why

edit 2: to build with an apparently-functional fts5, apply this diff followed by "make" from the ext/wasm directory; the wasm files you want are in the ext/wasm/jswasm directory after the build completes

    diff --git ext/wasm/GNUmakefile ext/wasm/GNUmakefile
    index 039dff410..554cf9cda 100644
    --- ext/wasm/GNUmakefile
    +++ ext/wasm/GNUmakefile
    @@ -111,6 +111,7 @@ sqlite3.c := $(dir.top)/sqlite3.c
     sqlite3.h := $(dir.top)/sqlite3.h
     SQLITE_OPT = \
       -DSQLITE_ENABLE_FTS4 \
    +  -DSQLITE_ENABLE_FTS5 \
       -DSQLITE_ENABLE_RTREE \
       -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
       -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION \

I don't know why it's not in the default list of flags.

[1]: https://sqlite.org/fiddle/

[2]: https://github.com/llimllib/wasm_sqlite_with_stats/tree/buil...

1 comments

Huh, I wonder why FTS4 and not FTS5? I could understand omitting both of them for reasons of size, but having the older version but not the new one feels surprising to me.
> Huh, I wonder why FTS4 and not FTS5? I could understand omitting both of them for reasons of size, but having the older version but not the new one feels surprising to me.

It was an oversight on my part. It will be fixed in the trunk momentarily.

Nice! The wasm build is great, thanks for all your work on it