Overview
Connections shows the client sessions currently open on a Neki branch’s routers. If a session is stuck, you can cancel its query or terminate the session.Connections only shows router sessions, not the connections between routers and each shard’s Postgres instances.
View connections in the dashboard
Select a database and branch, then select Connections. The list refreshes automatically and shows one row per router session:
Select a row to see the session’s details, including the shard backends serving it.
View connections in the CLI
show prints the current sessions once, and top opens a live terminal view:
show prints each session with its IDs and shard backends. Add --format json for scripts and AI agents.
In top, press s to switch the sort between transaction start and duration, and enter to open a session’s details.
Capture and replay
Record atop session to a trace file and replay it later:
C to start or stop a capture. The capture includes the last few minutes of history that top
already has in memory. If you didn’t pass --capture, the trace is written to connections-<timestamp>.jsonl in the
current directory.
Cancel a query or terminate a session
Before acting, PlanetScale checks that the session is still the one you saw. If the query finished, the transaction
ended, or the PID now belongs to a new session, the action is rejected.
In the CLI, the action commands take effect immediately with no confirmation prompt. Scripts and AI agents should get
IDs from
show --format json, act on one session at a time, and run show again to confirm the result. An agent should
get a person’s approval before running an action.
Permissions
Connections is available to signed-in users (for the CLI, authenticate withpscale auth login) but not when using
service tokens. What you can do depends on your role and whether the branch is a production branch. Acting means
cancelling a query or terminating a session.
Database Administrator access can be granted directly or through a team. If you don’t have the
required role, the request fails with a permission error. See Access control for the full
role model.

