feat: wire SQLite database adapter for tests

SQLite gives e2e tests a single shared file across all containers without
needing a heavyweight MariaDB/MongoDB/PostgreSQL service. WAL + busy_timeout
keep multi-process writers tolerable. Memory adapter was considered but its
per-process PHP arrays don't survive Swoole worker fan-out or cross-container
queue handoffs, so file-backed SQLite is the practical choice.

- registers: add 'sqlite' scheme to pool factory and worker db register,
  configured with PRAGMA journal_mode=WAL, busy_timeout=5000, foreign_keys=ON
- compose: pass _APP_DB_SQLITE_PATH and mount appwrite-sqlite:/storage/sqlite
  on every service that touches the main DB
- .env: switch _APP_DB_ADAPTER to sqlite, drop mariadb from COMPOSE_PROFILES
- ci.yml: add SQLite to the e2e matrix alongside MongoDB so each service
  is timed against both adapters in the same workflow run

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jake Barnby
2026-04-30 00:41:09 +12:00
co-authored by Claude Opus 4.7
parent c1dee1cd7e
commit 7e25b4fad9
5 changed files with 102 additions and 12 deletions
+8 -2
View File
@@ -210,10 +210,10 @@ jobs:
uses: actions/github-script@v8
with:
script: |
const allDatabases = ['MariaDB', 'PostgreSQL', 'MongoDB'];
const allDatabases = ['MariaDB', 'PostgreSQL', 'MongoDB', 'SQLite'];
const allModes = ['dedicated', 'shared'];
const defaultDatabases = ['MongoDB'];
const defaultDatabases = ['MongoDB', 'SQLite'];
const defaultModes = ['dedicated'];
const pr = context.payload.pull_request;
@@ -475,6 +475,12 @@ jobs:
echo "_APP_DB_ADAPTER=postgresql" >> $GITHUB_ENV
echo "_APP_DB_HOST=postgresql" >> $GITHUB_ENV
echo "_APP_DB_PORT=5432" >> $GITHUB_ENV
elif [ "${{ matrix.database }}" = "SQLite" ]; then
echo "COMPOSE_PROFILES=mongodb" >> $GITHUB_ENV
echo "_APP_DB_ADAPTER=sqlite" >> $GITHUB_ENV
echo "_APP_DB_HOST=mongodb" >> $GITHUB_ENV
echo "_APP_DB_PORT=0" >> $GITHUB_ENV
echo "_APP_DB_SQLITE_PATH=/storage/sqlite/appwrite.db" >> $GITHUB_ENV
fi
- name: Login to Docker Hub