1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-09 00:40:26 +00:00
TiddlyWiki5/plugins/tiddlywiki/multiwikiserver/modules
Jeremy Ruston 3fca82321e
MWS: Add support for node-sqlite-wasm alongside better-sqlite3 (#7996)
* Switch from better-sqlite3 to node-sqlite3-wasm

Seems to be slower, but might make cloud deployments easier by not having any binary dependencies

* More logging

* Temporarily use a memory database

We will make this configurable

* Revert "More logging"

* Resume loading demo tiddlers

* Cache prepared statements

Gives a 20% reduction in startup time on my machine

* Some more logging

* Update package-lock

* More logging

* Route regexps should allow for proxies that automatically decode URLs

Astonishingly, Azure does this

* Go back to a file-based database

* Less logging

* Update package-lock.json

* Simplify startup by not loading the docs edition

* Tiddler database layer should mark statements as having been removed

* Re-introduce better-sqlite3

* Make the SQLite provider be switchable

* Support switchable SQL engines

I am not intending to make this a long term feature. We will choose one engine and stick with it until we choose to change to another.

* Adjust dependency versions

* Setting up default engine

* Make transaction handling compatible with node-sqlite3-wasm

https://github.com/tndrle/node-sqlite3-wasm doesn't have transaction support so I've tried to implement it using SQL statements directly.

@hoelzro do you think this is right? Should we be rolling back the transaction in the finally clause? It would be nice to have tests in this area...

I looked at better-sqlite3's implementation - https://github.com/WiseLibs/better-sqlite3/blob/master/lib/methods/transaction.js

* Default to better-sqlite3 for compatibility after merging
2024-02-22 11:57:41 +00:00
..
command-mws-load.js mws-load command: more validation tiddler files 2024-02-16 16:41:39 +00:00
init.js MWS: Add support for node-sqlite-wasm alongside better-sqlite3 (#7996) 2024-02-22 11:57:41 +00:00
route-delete-recipe-tiddler.js Allow backslashes in trailing API path components 2024-02-21 17:54:56 +00:00
route-get-bag-tiddler.js Allow backslashes in trailing API path components 2024-02-21 17:54:56 +00:00
route-get-bag.js Allow backslashes in trailing API path components 2024-02-21 17:54:56 +00:00
route-get-recipe-tiddler.js Allow backslashes in trailing API path components 2024-02-21 17:54:56 +00:00
route-get-recipe-tiddlers-json.js Introduce $tw.mws for MWS globals 2024-02-05 14:49:08 +00:00
route-get-recipe.js Introduce $tw.mws for MWS globals 2024-02-05 14:49:08 +00:00
route-get-status.js Implement APIs for client wikis to sync with the server 2024-01-03 16:27:13 +00:00
route-post-recipe-tiddlers.js WIP: Add a multipart/form-data convenience function 2024-02-02 15:42:02 +00:00
route-put-bag.js Allow backslashes in trailing API path components 2024-02-21 17:54:56 +00:00
route-put-recipe-tiddler.js Allow backslashes in trailing API path components 2024-02-21 17:54:56 +00:00
route-put-recipe.js Allow backslashes in trailing API path components 2024-02-21 17:54:56 +00:00
server-extension.js Server extension framework 2024-01-17 22:42:01 +00:00
sql-tiddler-database.js MWS: Add support for node-sqlite-wasm alongside better-sqlite3 (#7996) 2024-02-22 11:57:41 +00:00
sql-tiddler-store.js MWS: Add support for node-sqlite-wasm alongside better-sqlite3 (#7996) 2024-02-22 11:57:41 +00:00
tests-sql-tiddler-database.js A few more tests 2024-01-28 17:11:53 +00:00
upload-manager.js WIP: Support for streaming multipart form data to the file system 2024-02-16 16:02:40 +00:00