Skip to content

Commit 54718de

Browse files
aprimakinaclaude
andcommitted
docs: trim read replica descriptions in CLAUDE.md and spec.md
Condense the overlong CLAUDE.md read-replica bullet to a short pointer and fix the stale ConnectionTarget field names (ConnectionService/CredentialService). Drop the forked_from/service-get implementation detail from spec.md, keeping the user-facing behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 89993fb commit 54718de

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ Tiger CLI is a Go-based command-line interface for managing Tiger, the modern da
273273
- `service.go` - Service management commands (list, create, get, fork, start, stop, resize, delete, update-password, logs)
274274
- `db.go` - Database operation commands (connection-string, connect, test-connection)
275275
- `read_replica.go` - Read replica selection flow for `db connect`/`psql`: in an interactive terminal, when the service has one or more active read replicas (listed via the `/replicaSets` API), prompts to connect to the primary or one of the replicas. Skipped when stdin is not a TTY, when `--no-replica-prompt` is set, or when the service has no read replicas.
276-
- Read replica ID as a connection target: the db connection commands (`db connection-string`, `db connect`/`psql`, `db test-connection`, `db schema`) and the `db_execute_query`/`db_schema` MCP tools accept a read replica set ID anywhere a service ID is accepted. The API's `GetService` resolves both primary and read replica IDs, returning the replica's own endpoint plus a `forked_from` link (`is_standby: true`, parent `service_id`). `common.ResolveConnectionTarget` turns a fetched `api.Service` into a `common.ConnectionTarget{Connect, Credential, IsReplica}`: a standby replica connects to its own endpoint (`Connect`) but resolves credentials/password reset against the parent primary (`Credential`, fetched via `GetService`), since read replicas share the primary's credentials. MCP handlers call `common.ResolveConnectionTargetByID`; the CLI's `resolveConnectionTarget` fetches via `getServiceDetailsFunc` (the test seam) then calls `ResolveConnectionTarget`. The interactive `db connect` menu builds a target from a `/replicaSets` entry via `common.NewReplicaConnectionTarget`. `common.IsReadReplica(service)` reports whether a fetched service is a standby. `service update-password` (CLI and MCP) and `db create role` use it to reject a replica ID (a read-only replica can't be written to). `db save-password` instead redirects to the parent (via `resolveConnectionTarget`), storing the password where the connect commands read it.
276+
- Read replica ID as a connection target: the db connection commands and the `db_execute_query`/`db_schema` MCP tools accept a read replica set ID wherever a service ID is accepted. `GetService` resolves both, returning the replica's endpoint plus a `forked_from` link (`is_standby`, parent `service_id`); `common.ResolveConnectionTarget` (`common/replica.go`) turns that into a `ConnectionTarget{ConnectionService, CredentialService, IsReplica}` — a replica connects to its own endpoint but resolves credentials against the parent. Write commands (`service update-password`, `db create role`) reject a replica ID via `common.IsReadReplica`; `db save-password` redirects to the parent so the password lands where the connect commands read it.
277277
- `config.go` - Configuration management commands (show, set, unset, reset)
278278
- `mcp.go` - MCP server commands (install, start, list, get)
279279
- `version.go` - Version command

specs/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ The `save-password` command accepts passwords through three methods (in order of
569569
The `connect` and `psql` commands support passing additional flags directly to the psql client using the `--` separator. Any flags after `--` are passed through to psql unchanged, allowing full access to psql's functionality while maintaining tiger's connection and authentication handling.
570570

571571
**Read Replica ID as a Connection Target (all db connection commands):**
572-
The `db connection-string`, `db connect` / `db psql`, `db test-connection`, and `db schema` commands accept a read replica set ID anywhere a service ID is accepted (as the positional argument or the default service). The API resolves a read replica ID through the same service-get endpoint, returning the replica's own connection endpoint along with a `forked_from` link identifying it as a standby of its parent primary. The command connects to the replica's endpoint but resolves credentials (and any password reset) against the parent primary, since read replicas share the primary's credentials.
572+
The `db connection-string`, `db connect` / `db psql`, `db test-connection`, and `db schema` commands accept a read replica set ID anywhere a service ID is accepted (as the positional argument or the default service). The command connects to the replica's endpoint but resolves credentials (and any password reset) against the parent primary, since read replicas share the primary's credentials.
573573

574574
**Read Replica Prompt (connect/psql):**
575575
When `tiger db connect` / `tiger db psql` runs in an interactive terminal and is given a *primary service* ID, it checks whether that service has any read replicas (read replica sets). If the service has one or more active read replicas, it presents a menu offering to connect to the primary (default) or to one of the existing replicas. If the service has no read replicas, no menu is shown and the command connects to the primary directly.

0 commit comments

Comments
 (0)