set -e command -v psql [ -n "$SUPABASE_DB_URL" ] && echo DB_URL_SET || echo DB_URL_MISSING [ -n "$SUPABASE_URL" ] && echo URL_SET || true printf '%s' "$SUPABASE_DB_URL" | sed -E 's#(postgres(ql)?://[^:]+:)[^@]+@#\1***@#'
/usr/bin/psql DB_URL_SET URL_SET postgresql://postgres.<ref>:***@aws-0-us-east-1.pooler.supabase.com:5432/postgres
set -euo pipefail psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 <<'SQL' BEGIN; CREATE TABLE public.authors ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), name text NOT NULL, email text NOT NULL UNIQUE ); CREATE TABLE public.courses ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), author_id uuid NOT NULL REFERENCES public.authors(id), title text NOT NULL, price_cents integer NOT NULL CONSTRAINT courses_price_cents_nonnegative CHECK (price_cents >= 0), published boolean NOT NULL DEFAULT false, created_at timestamptz NOT NULL DEFAULT now() ); CREATE TABLE public.enrollments ( id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, course_id uuid NOT NULL REFERENCES public.courses(id) ON DELETE CASCADE, student_email text NOT NULL, enrolled_at timestamptz NOT NULL DEFAULT now(), CONSTRAINT enrollments_course_student_email_key UNIQUE (course_id, student_email) ); CREATE INDEX courses_author_id_idx ON public.courses (author_id); CREATE INDEX enrollments_student_email_idx ON public.enrollments (student_email); -- Make the tables readable through the project's anonymous REST role. GRANT USAGE ON SCHEMA public TO anon; GRANT SELECT ON TABLE public.authors, public.courses, public.enrollments TO anon; GRANT USAGE, SELECT ON SEQUENCE public.enrollments_id_seq TO anon; -- Ensure PostgREST notices the newly-created relations without waiting for a reload. NOTIFY pgrst, 'reload schema'; COMMIT; SQL echo 'Schema created.'
BEGIN CREATE TABLE CREATE TABLE CREATE TABLE CREATE INDEX CREATE INDEX GRANT GRANT GRANT NOTIFY COMMIT Schema created.
set -euo pipefail curl --fail-with-body -sS -D /tmp/courses_headers -o /tmp/courses_body \ -H "apikey: $SUPABASE_ANON_KEY" \ -H "Authorization: Bearer $SUPABASE_ANON_KEY" \ "$SUPABASE_URL/rest/v1/courses?select=*&limit=1" cat /tmp/courses_headers printf '\nBODY:\n'; cat /tmp/courses_body; echo
HTTP/2 200 date: Sat, 25 Jul 2026 05:36:23 GMT content-type: application/json; charset=utf-8 content-length: 2 content-range: */* cf-ray: a208ce82dce5d27e-FRA cf-cache-status: DYNAMIC content-location: /courses?limit=1&select=%2A server: cloudflare strict-transport-security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff content-profile: public sb-gateway-version: 1 sb-project-ref: <ref> sb-request-id: 019f97c6-4dc8-7685-ba3e-8d79e4d8eacc x-envoy-attempt-count: 1 x-envoy-upstream-service-time: 3 set-cookie: __cf_bm=pKUYfrFTrSgaUxjfHmdii7Y0wkyRqANZxkKuraX8Nz8-1784957783.4926293-1.0.1.1-0F146xRB4iAjf4vhFkxOy7KtzmEkKnYzH8rMp5KSq9FTLOtvbHMRUVy_vqAubjlTOQlVAtRdkO9bvay7SjI6Va_4.G19E8l1ybnTvcy1mZtekTVfOZ6hSOV0hOUf9cj2; HttpOnly; SameSite=None; Secure; Path=/; Domain=supabase.co; Expires=Sat, 25 Jul 2026 06:06:23 GMT alt-svc: h3=":443"; ma=86400 BODY: []
set -euo pipefail
psql "$SUPABASE_DB_URL" -X -At <<'SQL'
SELECT c.relname, count(*)
FROM pg_class c JOIN pg_namespace n ON n.oid=c.relnamespace
WHERE n.nspname='public' AND c.relkind='r' AND c.relname IN ('authors','courses','enrollments')
GROUP BY c.relname ORDER BY c.relname;
SELECT indexname FROM pg_indexes WHERE schemaname='public' AND tablename IN ('courses','enrollments') ORDER BY indexname;
SQLauthors|1 courses|1 enrollments|1 courses_author_id_idx courses_pkey enrollments_course_student_email_key enrollments_pkey enrollments_student_email_idx
A shell script executed against the live project and asserted on the state the agent left behind. No model judged another model.
Raw transcript · Task definition and verifier · Every attempt