diff --git a/Makefile b/Makefile index 45306539..68d5b966 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,8 @@ SQLITE_COMPILATION_FLAGS = \ -DSQLITE_ENABLE_FTS3 \ -DSQLITE_ENABLE_FTS3_PARENTHESIS \ -DSQLITE_THREADSAFE=0 \ - -DSQLITE_ENABLE_NORMALIZE + -DSQLITE_ENABLE_NORMALIZE \ + -DSQLITE_ENABLE_FTS5 # When compiling to WASM, enabling memory-growth is not expected to make much of an impact, so we enable it for all builds # Since tihs is a library and not a standalone executable, we don't want to catch unhandled Node process exceptions diff --git a/README.md b/README.md index a42cfa8c..f919cdb0 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,40 @@ *sql.js* is a javascript SQL database. It allows you to create a relational database and query it entirely in the browser. You can try it in [this online demo](https://sql.js.org/examples/GUI/). It uses a [virtual database file stored in memory](https://emscripten.org/docs/porting/files/file_systems_overview.html), and thus **doesn't persist the changes** made to the database. However, it allows you to **import** any existing sqlite file, and to **export** the created database as a [JavaScript typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays). +## FTS5-enabled Fork + +This fork of sql.js includes the FTS5 (Full-Text Search) extension, which is disabled in the default sql.js build. Instructions: + +1. Download the fts-enabled build from this repo's [Releases page](https://github.com/chrislee973/sql.js/releases): + - `sql-wasm.js` + - `sql-wasm.wasm` + +2. Include them in your project: +```javascript + + +``` + +All other sql.js functionality remains unchanged. + *sql.js* uses [emscripten](https://emscripten.org/docs/introducing_emscripten/about_emscripten.html) to compile [SQLite](http://sqlite.org/about.html) to webassembly (or to javascript code for compatibility with older browsers). It includes [contributed math and string extension functions](https://www.sqlite.org/contrib?orderby=date). sql.js can be used like any traditional JavaScript library. If you are building a native application in JavaScript (using Electron for instance), or are working in node.js, you will likely prefer to use [a native binding of SQLite to JavaScript](https://www.npmjs.com/package/sqlite3). A native binding will not only be faster because it will run native code, but it will also be able to work on database files directly instead of having to load the entire database in memory, avoiding out of memory errors and further improving performances. diff --git a/test-search-live.html b/test-search-live.html new file mode 100644 index 00000000..04fa5347 --- /dev/null +++ b/test-search-live.html @@ -0,0 +1,291 @@ + + +
+