README-dist.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. This is the README for the sqlite3 WASM/JS distribution.
  2. Main project page: https://sqlite.org
  3. Documentation: https://sqlite.org/wasm
  4. This archive contains the following deliverables for the WASM/JS
  5. build:
  6. - jswasm/sqlite3.js is the canonical "vanilla JS" version.
  7. - jswasm/sqlite3.mjs is the same but in ES6 module form
  8. - jswasm/*-bundler-friendly.js and .mjs are variants which are
  9. intended to be compatible with "bundler" tools commonly seen in
  10. node.js-based projects. Projects using such tools should use those
  11. variants, where available, instead of files without the
  12. "-bundler-friendly" suffix. Some files do not have separate
  13. variants.
  14. - jswasm/sqlite3.wasm is the binary WASM file imported by all of the
  15. above-listed JS files.
  16. - The jswasm directory additionally contains a number of supplemental
  17. JS files which cannot be bundled directly with the main JS files
  18. but are necessary for certain usages.
  19. - The top-level directory contains various demonstration and test
  20. applications for sqlite3.js and sqlite3.mjs.
  21. sqlite3-bundler-friendly.mjs requires client-side build tools to make
  22. use of and is not demonstrated here.
  23. Browsers will not serve WASM files from file:// URLs, so the test and
  24. demonstration apps require a web server and that server must, for the
  25. OPFS[^1]-related features, include the following headers in its response
  26. when serving the files:
  27. Cross-Origin-Opener-Policy: same-origin
  28. Cross-Origin-Embedder-Policy: require-corp
  29. Most functionality will work without those headers but the OPFS[^1]
  30. storage capability will not be available without them.
  31. One simple way to get the demo apps up and running on Unix-style
  32. systems is to install althttpd (https://sqlite.org/althttpd) and run:
  33. althttpd --enable-sab --page index.html
  34. [^1]: https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system