Files
zeekay b99bbd985a fix: make ZAP opt-in so hanzo/sql works as vanilla PostgreSQL
The zap_fdw background worker previously always registered itself and
connected to a hardcoded "postgres" database. This broke deployments
that don't use ZAP or use a different database name.

Changes:
- Add zap.enabled GUC (default false) — worker only starts when true
- Add zap.database GUC — falls back to POSTGRES_DB env var then "postgres"
- Build zap_fdw in Dockerfile but keep it out of shared_preload_libraries
- Fix compile errors: move got_sigterm before use, add signal handler
- Fix Makefile PG_MAJOR (16 -> 18), compose.yml (use hanzo/sql:18)
- Remove hardcoded database names from healthchecks and init.sql
- Trigger CI on contrib/zap_fdw/** changes
2026-03-30 19:15:44 -07:00

30 lines
708 B
Makefile

.PHONY: build push run test clean
IMAGE := ghcr.io/hanzoai/sql
TAG := latest
PG_MAJOR := 18
build:
docker build --build-arg PG_MAJOR=$(PG_MAJOR) -t $(IMAGE):$(TAG) .
push: build
docker push $(IMAGE):$(TAG)
run:
docker run -d --name hanzo-sql \
-e POSTGRES_PASSWORD=hanzo \
-e POSTGRES_DB=hanzo \
-e POSTGRES_USER=hanzo \
-p 5432:5432 \
$(IMAGE):$(TAG)
test: run
@echo "Waiting for postgres to start..."
@sleep 5
@docker exec hanzo-sql psql -U hanzo -d hanzo -c "CREATE EXTENSION IF NOT EXISTS vector; SELECT extversion FROM pg_extension WHERE extname='vector';"
@docker stop hanzo-sql && docker rm hanzo-sql
clean:
-docker stop hanzo-sql 2>/dev/null
-docker rm hanzo-sql 2>/dev/null