Kill a runaway query or connection

connect & shell

// what it does

With --query it cancels just the running query (the gentler option); without, it terminates the whole connection. This is the break-glass tool when a migration script or analyst query is pinning production.

// shell

$ pscale branch connections kill mydb main <query-id> --query
$ pscale branch connections kill mydb main <connection-id>

// gotcha

Killing a connection mid-transaction rolls the transaction back — that's usually what you want, but the app on the other end sees a dropped connection and must handle reconnection.

// resources