sql.js icon indicating copy to clipboard operation
sql.js copied to clipboard

Enables FTS5 by default

Open arcanis opened this issue 1 year ago • 3 comments

This PR enables the FTS5 extension by default.

Why I think it should be supported by default:

  • The feature is very useful to a wide range of client-based applications, one core use case for sql.js.

  • The size increase seems reasonable considering the new capabilities, being only 744K for the wasm file (638K before this PR).

  • Using a custom sql.js build should be last resort, as it means it'll be harder for users to upgrade.

Closes #199, which included additional unrelated changes and didn't have tests.

arcanis avatar Sep 18 '24 19:09 arcanis

This would be great. It would mean we wouldn't need a custom build anymore.

P-de-Jong avatar Oct 31 '24 08:10 P-de-Jong

Hi ! Asset sizes are often a limiting factor when integrating large libraries like sql.js.

I agree we should include a FTS5 build in our build process, include it in tests, and distribute pre-compiled wasm files for easy access. But it should not be part of the default build.

Ideally, we could make it so that switching to fts5 would be as easy as

const SQL = await initSqlJs({ locateFile: file => `/dist/fts5.${file}` });

lovasoa avatar Nov 03 '24 10:11 lovasoa

fts5 seems to be supported in the official build https://www.npmjs.com/package/sqlite-wasm-http

lsb avatar Aug 13 '25 23:08 lsb