Skip to content

Commit 228eb73

Browse files
committed
fix: minor review comments
1 parent c5bb2e6 commit 228eb73

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

internal/tiger/cmd/db.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,17 @@ from your configuration. This command will launch an interactive psql session
145145
with the appropriate connection parameters.
146146
147147
Authentication is handled automatically using:
148-
1. Stored password (keyring, ~/.pgpass, or none based on --password-storage setting)
148+
1. Stored password (keyring, ~/.pgpass, or none based on --password-storage setting)
149149
2. PGPASSWORD environment variable
150150
3. If authentication fails, offers interactive options:
151151
- Enter password manually (will be saved for future use)
152152
- Reset password (update or generates a new password via the API)
153153
154+
Use --read-only to open the psql session in Tiger Cloud's immutable read-only
155+
mode (writes and DDL are rejected by the server). The global read_only config
156+
option (or TIGER_READ_ONLY=true) also forces this behavior, so sessions started
157+
while read-only mode is on are always read-only.
158+
154159
Examples:
155160
# Connect to default service
156161
tiger db connect

internal/tiger/common/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var ErrReadOnly = errors.New("this operation is not allowed in read-only mode")
1313
// CheckReadOnly returns ErrReadOnly if read-only mode is enabled. Callers
1414
// should invoke this before any destructive API call.
1515
func CheckReadOnly(cfg *config.Config) error {
16-
if cfg != nil && cfg.ReadOnly {
16+
if cfg.ReadOnly {
1717
return ErrReadOnly
1818
}
1919
return nil

internal/tiger/common/errors_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ func TestCheckReadOnly(t *testing.T) {
1414
cfg *config.Config
1515
wantErr error
1616
}{
17-
{name: "nil cfg allows writes", cfg: nil, wantErr: nil},
1817
{name: "read-only off allows writes", cfg: &config.Config{ReadOnly: false}, wantErr: nil},
1918
{name: "read-only on blocks writes", cfg: &config.Config{ReadOnly: true}, wantErr: ErrReadOnly},
2019
}

0 commit comments

Comments
 (0)