-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Enabling SQLite FTS5 module by default. #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Compiled using EMSCRIPTEN 1.37.9.
petermolnar
commented
Jan 15, 2018
+1 for this; if the FTS5 engine is on, that'd allow search indexes created by other languages to be used in JS in the browser.
sql.js is already quite a huge dependency to have. I don't think adding other modules by default is a good idea.
But compiling different versions for different needs is a good idea.
I believe I am able to have FTS5 running. Here are the procedures:
- modify Makefile by adding "-DSQLITE_ENABLE_FTS5" in the CFLAGS line. So, the complete CFLAGS line will become
CFLAGS=-O2 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_DISABLE_LFS -DLONGDOUBLE_TYPE=double -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5
- make
- A few .js files will be created at the js directory. I tested worker.sql.js only so far
- In order to test it, I cloned http://kripken.github.io/sql.js/GUI/ to my server and then delete the line
<script src="codemirror/mode/sql/sql.js"></script>
- Modify gui.js to point to my own worker.sql.js at this line
<a href="https://github.com/kripken/sql.js">
tovar worker = new Worker("worker.sql.js");
- run the gui page
- I typed the commands from http://www.sqlitetutorial.net/sqlite-full-text-search/ into the textarea box. All FTS5 commands work perfectly.
In the next few weeks, I will try to test the performance of FTS5 by adding thousands of documents.
@3CE8D2BAC65BDD6AA9 Thank you for posting the steps. I was also able to run FTS5 but this pull request was to enable it by default inside sql.js
; but since I agree with @lovasoa (we shouldn't add modules that most people won't use) I didn't even try to fix the failing unit tests.
@brody4hire
brody4hire
Mar 9, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change the SQLITE_THREADSAFE
default setting? Was this intended?
@3CE8D2BAC65BDD6AA9
3CE8D2BAC65BDD6AA9
Mar 10, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the same thing but no clue why there is such a different.
I am open to the idea of making such compile time extensions into different versions of sql.js (such as memory-growth, debug, etc).
Would that be a good solution here? Can we expect future extensions to pass the standard test suite? Would a standard procedure for adding such extensions help in the future?
b3211a6
to
e902ec2
Compare
351ffdd
to
6e7ec33
Compare
jrocha
commented
Oct 4, 2023
Would be nice to have an extra flavor with FTS5 enabled.
jerefrer
commented
Nov 16, 2023
I also wonder if that would be a good idea to include it by default, but I definitely would love to have a ready-made version with FTS5 enabled.
Compiled using EMSCRIPTEN 1.37.9.
Tests:
Same error I get on master [6dc4ac5].