// Command pginit applies a psql-style init script with a superuser // connection, for databases that cannot mount deploy/dev/postgres-init.sql // themselves, such as CI service containers. It understands statements // ending in ";" and "\connect " lines. // // go run ./internal/devtools/pginit postgres://postgres:pw@host:5432/postgres deploy/dev/postgres-init.sql package main import ( "bufio" "context" "fmt" "net/url" "os" "strings" "time" "github.com/jackc/pgx/v5" ) func main() { if len(os.Args) != 3 { fmt.Fprintln(os.Stderr, "usage: pginit