#!/usr/bin/env bash
# Real demos for P070 "Why SQLite Is the Most Used Database in the World". Runs on render01 (Docker).
# One container, ce-p070-laptop: a stock Ubuntu 24.04 with the sqlite3 tool and Python 3 (lab/Dockerfile), no
# network, no database server. Ana's tea shop keeps its data in ~/shop/shop.db.
# Every command shown is typed into a real interactive bash in a pty (demo_driver.py), two windows on one laptop.
set -euo pipefail
cd "$(dirname "$0")"
P=ce-p070
cleanup() { docker rm -f $P-laptop >/dev/null 2>&1 || true; }
cleanup
[ -n "${KEEP:-}" ] || trap cleanup EXIT
docker build -q -t $P-laptop lab >/dev/null
docker run -d --name $P-laptop --hostname laptop --network none $P-laptop >/dev/null
python3 - "$P" < demo_driver.py
