diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2023-12-12 21:59:35 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2023-12-12 21:59:35 +0100 |
commit | bfc1d39d2c9a9f192d94627f05cdc246219cbc16 (patch) | |
tree | 947b77ec6a1ab441b5ef4f053affef42e4705cc6 /search | |
parent | d196a3fe620a16d96a7a0bb9ad6eb929939d9570 (diff) | |
download | www-andreasbaumann-cc-bfc1d39d2c9a9f192d94627f05cdc246219cbc16.tar.gz www-andreasbaumann-cc-bfc1d39d2c9a9f192d94627f05cdc246219cbc16.tar.bz2 |
replaced .ajax with XMLHttpRequest, now binary fetches are working
Diffstat (limited to 'search')
-rw-r--r-- | search/fts5/README | 21 | ||||
-rw-r--r-- | search/fts5/main.js | 12 |
2 files changed, 24 insertions, 9 deletions
diff --git a/search/fts5/README b/search/fts5/README index 5ab27ed..db52dc2 100644 --- a/search/fts5/README +++ b/search/fts5/README @@ -44,15 +44,26 @@ git clone --recursive https://github.com/jlongster/sql.js # emcc: error: setting `INLINING_LIMIT` expects `bool` but got `int` # set -sINLINING_LIMIT as booelean flag, modern emcc doesn't allow a cost integer here anymore it seems make +#https://github.com/sql-js/sql.js/issues/546 + +building emscripten2 +/data/INSTALL/emscripten2/src/llvm-project/llvm/include/llvm/Support/Signals.h:119:8: error: variable or field ‘CleanupOnSignal’ declared void + 119 | void CleanupOnSignal(uintptr_t Context); + | ^~~~~~~~~~~~~~~ +In file included from /data/INSTALL/emscripten2/src/llvm-project/llvm/lib/Support/Signals.cpp:251: +/data/INSTALL/emscripten2/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:348:44: error: ‘void llvm::sys::CleanupOnSignal(uintptr_t)’ should have been declared inside ‘llvm::sys’ + 348 | void sys::CleanupOnSignal(uintptr_t Context) { + + # tons of errors, the containersized version uses VCode and WSL, so this things is # hairy to build # let's try a precompiled one # https://verdicts.listen.dev/npm/sql.js-fts5 npm install sql.js-fts5 -sudo pacman -S browserify -browserify main.js -o sql-fts5.js -cp sql-fts5.js ../../themes/new_theme/static/js/. cp node_modules/sql.js-fts5/dist/sql-wasm.js ../../themes/new_theme/static/js/. +cp node_modules/sql.js-fts5/dist/sql-wasm.wasm ../../themes/new_theme/static/js/. +# WASM is not read because of a charset-utf-8 added to application/wasm: https://github.com/gohugoio/hugo/issues/10734 +# hugo-0.120.1-charset.patch # TODO: add as sqlite.js to page with data (local sqlite fts search) # https://blog.ouseful.info/2022/04/06/compiling-full-text-search-fts5-into-sqlite-wasm-build/ @@ -61,4 +72,8 @@ cp node_modules/sql.js-fts5/dist/sql-wasm.js ../../themes/new_theme/static/js/. # https://github.com/phiresky/sql.js-httpvfs # https://github.com/psanford/sqlite3vfshttp # https://phiresky.github.io/blog/2021/hosting-sqlite-databases-on-github-pages/ + # https://github.com/kbumsik/sqlite-wasm +sudo pacman -S typescript +# typescript compile errors +# 362 this.wasm._free(blobPtr); diff --git a/search/fts5/main.js b/search/fts5/main.js index 70479aa..4f5d648 100644 --- a/search/fts5/main.js +++ b/search/fts5/main.js @@ -1,10 +1,10 @@ const initSqlJs = require( 'sql.js-fts5' ); -const SQL = initSqlJs({ - locateFile: file => `http://localhost:1313/js/${file}` -}); +//~ const SQL = initSqlJs({ + //~ locateFile: file => `http://localhost:1313/js/${file}` +//~ }); -const db = new SQL.Database(); +//~ const db = new SQL.Database(); -let sqlstr = "SELECT * FROM posts"; -db.run(sqlstr); +//~ let sqlstr = "SELECT * FROM posts"; +//~ db.run(sqlstr); |