Skip to content

feat: add structured GET /api/v1/connections response#39

Merged
ahmadnazir merged 1 commit into
beamlynx:masterfrom
Koziar:feat/structured-connections-endpoint
May 21, 2026
Merged

feat: add structured GET /api/v1/connections response#39
ahmadnazir merged 1 commit into
beamlynx:masterfrom
Koziar:feat/structured-connections-endpoint

Conversation

@Koziar

@Koziar Koziar commented May 20, 2026

Copy link
Copy Markdown
Contributor

Related PR

beamlynx/beamlynx-ui#29

Summary

Replaces the raw GET /api/v1/connections response with a structured payload the UI can use to list live database connections, show human-readable labels, and know which connection Pine currently has selected.

Changes

API — GET /api/v1/connections

Response shape (wrapped in result, consistent with GET /api/v1/connection):

{
  "result": {
    "version": "0.35.0",
    "selected-connection-id": "localhost:5432",
    "connections": [
      {
        "id": "localhost:5432",
        "label": "localhost:5432 · myapp_dev"
      }
    ]
  }
}
  • selected-connection-id — value of @db/connection-id (Pine’s currently selected connection), or null when no connection is selected.
  • connections — all registered connection pools.
  • id — existing connection handle (host:port), unchanged from prior behavior.
  • label — display string {host}:{port} · {dbname}, derived from the pool JDBC URL.

API surface

Only change to an existing route: GET /api/v1/connections — same path, new response shape (was raw @pools map; now structured result as above).

docker/init-pine.sh calls it once for debug logging and does not parse the body.

@ahmadnazir ahmadnazir merged commit a407ff8 into beamlynx:master May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants