Skip to content

vibepg exec ​

Synopsis ​

bash
vibepg exec <name> "<sql>"

Description ​

Run a single SQL statement against the instance via psql inside the container. Output is whatever psql writes to stdout.

Arguments ​

NameRequiredDescription
nameyesInstance name
sqlyesSQL statement, quoted

Options ​

None.

Examples ​

bash
vibepg exec demo "select now();"
vibepg exec demo "insert into users(id, name) values (1, 'ada');"
vibepg exec demo "\dt"

Notes ​

  • Quote the SQL so your shell doesn't try to interpret it. Single quotes inside the SQL escape cleanly inside double quotes ("insert into t values ('a');").
  • For multiple statements or anything multi-line, use run with a .sql file.
  • For interactive work, use psql.

See also ​

Released under the MIT License.