diff --git a/.gitignore b/.gitignore index bbe392a..9a310ad 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ node_modules config.js registration.yaml coverage -db/ooye.db +db/ooye.db* diff --git a/readme.md b/readme.md index 2a217e5..7ad21d3 100644 --- a/readme.md +++ b/readme.md @@ -51,6 +51,8 @@ Only necessary data and columns are queried from the database. We only contact t File uploads (like avatars from bridged members) are checked locally and deduplicated. Only brand new files are uploaded to the homeserver. This saves loads of space in the homeserver's media repo, especially for Synapse. +Switching to [WAL mode](https://www.sqlite.org/wal.html) could improve your database access speed even more. Run `node scripts/wal.js` if you want to switch to WAL mode. + # Setup If you get stuck, you're welcome to message @cadence:cadence.moe to ask for help setting up OOYE! diff --git a/scripts/wal.js b/scripts/wal.js new file mode 100644 index 0000000..1ad15d0 --- /dev/null +++ b/scripts/wal.js @@ -0,0 +1,6 @@ +// @ts-check + +const sqlite = require("better-sqlite3") +const db = new sqlite("db/ooye.db", {fileMustExist: true}) +db.pragma("journal_mode = wal") +db.close()