feat(repo): SQLite builds, database picked at compile time (#79) #90
No reviewers
Labels
No labels
bug
docs
duplicate
enhancement
help wanted
invalid
nice-to-have
pre-1.0
question
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jfro/lamplighter!90
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/79-sqlite"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
PR #90 adds SQLite builds: LAMPLIGHTER_DB, set when the app is built, picks the adapter (Postgres stays the default), and migrations, queries, Docker and CI cover both. It also bumps ecto_sql to 3.14. Both suites pass locally and in CI (C24, C26), and the SQLite image migrates and is healthy (C25).
Fixes #79
Red, then green
bash -c 'source ~/.rmenv; eval "$(mise activate bash --shims)"; env -u FORGEJO_TOKEN MIX_TEST_PARTITION=_79p mix test test/lamplighter/repo/sql_test.exs test/lamplighter/portable_queries_test.exs'fe7f4e6): exit 146893bd): exit 0bash -c 'source ~/.rmenv; export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; env -u FORGEJO_TOKEN LAMPLIGHTER_DB=sqlite MIX_BUILD_ROOT=_build_sqlite MIX_ENV=test MIX_TEST_PARTITION=_79p mix test test/lamplighter'b43f616): exit 1428c773): exit 0Checks
bash -c 'source ~/.rmenv; eval "$(mise activate bash --shims)"; env -u FORGEJO_TOKEN MIX_TEST_PARTITION=_79p mix precommit 2>&1 | tail -4', exit 0bash -o pipefail -c 'source ~/.rmenv; eval "$(mise activate bash --shims)"; env -u FORGEJO_TOKEN MIX_TEST_PARTITION=_79p mix precommit 2>&1 | tail -4', exit 0bash -c 'set -e; docker build -q --build-arg LAMPLIGHTER_DB=sqlite -t lamplighter:sqlite79 . >/dev/null; docker rm -f l79p >/dev/null 2>&1 || true; docker volume rm l79p >/dev/null 2>&1 || true; docker run -d --name l79p -p 127.0.0.1:4798:4000 -v l79p:/data -e DATABASE_PATH=/data/lamplighter.db -e SECRET_KEY_BASE=$(openssl rand -hex 48) -e PHX_HOST=localhost -e PHX_SCHEME=http lamplighter:sqlite79 >/dev/null; sleep 15; out=$(curl -s --noproxy "*" localhost:4798/healthz); echo "$out"; docker logs l79p 2>&1 | grep -c "Migrated"; docker rm -f l79p >/dev/null; docker volume rm l79p >/dev/null; echo "$out" | grep -q "\"database\":\"ok\""', exit 0428c773passes for both matrix builds, postgres and sqlite (the full suite of 1305 tests plus the migration round trip). (Upper Wolfjaw):curl -sf -H "Authorization: token $FORGEJO_TOKEN" https://git.knope.dev/api/v1/repos/jfro/lamplighter/commits/428c773/status | jq -e '.state == "success" and ([.statuses[] | select(.status == "success") | .context] | unique | length) == 2', exit 0428c773I ran the full suite on Postgres (1305 pass) and under LAMPLIGHTER_DB=sqlite (1305 pass). I read the diff: the migrations keep Postgres behavior (citext, backfill and GIN index stay Postgres-only), and release.yml still triggers only on v* tags, so merging doesn't ship. Not tested: upgrading a real Postgres install, SQLite under load, arm64. (Prover):bash -c 'source ~/.rmenv; export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; env -u FORGEJO_TOKEN LAMPLIGHTER_DB=sqlite MIX_BUILD_ROOT=_build_sqlite MIX_ENV=test MIX_TEST_PARTITION=_p79c mix test 2>&1 | tail -3 | grep -q "1305 passed"', exit 0Shipping it
Prover
Passed (Sonnet): In a fresh worktree at
428c773I ran the full suite on Postgres (1305 pass) and under LAMPLIGHTER_DB=sqlite (1305 pass). I read the diff: the migrations keep Postgres behavior (citext, backfill and GIN index stay Postgres-only), and release.yml still triggers only on v* tags, so merging doesn't ship. Not tested: upgrading a real Postgres install, SQLite under load, arm64.Every command above was run by Fortysix's Basecamp itself, on the branch named.
jfro referenced this pull request2026-11-28 18:40:50 +00:00