feat(db): Bun.SQL connection and portable migrations

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Winther
2026-10-30 02:57:34 +01:00
co-authored by Claude Opus 5.5
parent f71a31a5f1
commit 738d813fb8
8 changed files with 193 additions and 2 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Runs the package tests against SQLite and a throwaway postgres:17 container.
set -euo pipefail
PORT="${STC_PG_PORT:-55432}"
cd "$(dirname "$0")/.."
trap 'docker stop stc-pg >/dev/null 2>&1 || true' EXIT
docker rm -f stc-pg >/dev/null 2>&1 || true
docker run -d --rm --name stc-pg -e POSTGRES_PASSWORD=stc -p 127.0.0.1:${PORT}:5432 postgres:17 >/dev/null
for _ in $(seq 1 60); do
docker exec stc-pg pg_isready -U postgres -h 127.0.0.1 >/dev/null 2>&1 && break
sleep 1
done
sleep 1
STC_TEST_PG_URL="postgres://postgres:stc@127.0.0.1:${PORT}/postgres" bun test packages