Execute SQL on WeWeb PostgreSQL databases by environment (`staging`, `staging-ignis`, `local`) and service (`back`, `preview`, `plugins`). Use when a user asks to run `psql` queries, inspect data, or apply updates directly in DB, with automatic 1Password credential retrieval and SSH tunneling for private staging RDS hosts.
Run SQL on WeWeb DBs from the terminal without rebuilding connection logic each time.
Run inline SQL:
/home/leoc/.codex/skills/weweb-psql-env-executor/scripts/exec_psql_env.sh \
--env staging \
--service back \
--sql 'SELECT 1;'
Run SQL from file:
/home/leoc/.codex/skills/weweb-psql-env-executor/scripts/exec_psql_env.sh \
--env staging-ignis \
--service plugins \
--file /tmp/query.sql
Pipe SQL:
cat /tmp/query.sql | /home/leoc/.codex/skills/weweb-psql-env-executor/scripts/exec_psql_env.sh --env local
--env--serviceexec_psql_env.sh with --sql, --file, or piped SQL.--env: staging | staging-ignis | local--service: back | preview | plugins | localhost--sql: Inline SQL--file: Path to SQL fileIf --service is omitted:
staging and staging-ignis default to backlocal defaults to localhostop signin.