Skip to main content

oh sql

Execute raw SQL statements against the Onehouse control-plane API, or check the status of a previous request.


oh sql exec

Executes a SQL statement.

FlagRequiredDescription
--command / -cYesThe SQL string to execute
--async-modeNoSubmit without polling. Prints the request ID immediately and exits.
# Blocking (default) — waits for the operation to complete
oh sql exec -c "SHOW CLUSTERS"

# Non-blocking — returns a request ID to poll later
oh sql exec -c "CREATE CLUSTER my-cluster OF TYPE Managed" --async-mode
# → request ID: a1b2c3...

oh sql status REQUEST_ID

Checks the status of a previous request. Useful after --async-mode or when a previous command timed out.

oh sql status a1b2c3...

Prints the api_status (e.g., SUCCESS, FAILED, PENDING) and the response payload.

When a command times out, the CLI prints the request ID and a hint:

Timed out after 600s waiting for request a1b2c3...
Check status with: onehouse-cli sql status a1b2c3...