jlongster / absurd-sql

sqlite3 in ur indexeddb (hopefully a better backend soon)
MIT License
4.18k stars 102 forks source link

How to add extensions? (fts4 and spellfix1) #32

Open lassebomh opened 3 years ago

lassebomh commented 3 years ago

I am trying to create a fuzzy full-text search for a website and I'm quite lost as to how one would add extensions into absurd-sql.

The extensions are fts4 and spellfix1.

Any solutions?

quolpr commented 3 years ago

What I did:

  1. Cloned https://github.com/jlongster/sql.js
  2. https://github.com/jlongster/sql.js/blob/master/Makefile#L20
  3. Compiled it, and uploaded it to my npm

Here is the commit example where I enabled FTS5 https://github.com/quolpr/sql.js/commit/343e35ddb47716c3a21f5e9a027ca2831d5d4b47

Then in package.json instead of @jlongster/sql.js you need to put your own package name(like @lassebomh/sql.js)

Also check how to compile — https://github.com/sql-js/sql.js/blob/master/CONTRIBUTING.md#host-based-configuration-not-recommended

samueljseay commented 2 years ago

Fwiw FTS4 is already enabled and available (enabling fts3 enables fts4): https://github.com/jlongster/sql.js/blob/master/Makefile#L24