Skip to content

Commit f43db40

Browse files
craig[bot]petermattis
andcommitted
Merge #150624
150624: cli: update --database and --url flag help text for virtual clusters r=petermattis a=petermattis Release note (cli change): Update the help text for the --database and --url CLI flags to document support for virtual cluster syntax. The --database flag now shows examples of both simple database names and the cluster:virtual-cluster/database format. The --url flag examples now include the virtual cluster syntax in PostgreSQL connection URLs. Co-authored-by: Peter Mattis <[email protected]>
2 parents 658cecb + da66890 commit f43db40

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

pkg/cli/cliflags/flags.go

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,25 @@ example [::1]:26257 or [fe80::f6f2:::]:26257.`,
284284
}
285285

286286
Database = FlagInfo{
287-
Name: "database",
288-
Shorthand: "d",
289-
EnvVar: "COCKROACH_DATABASE",
290-
Description: `The name of the database to connect to.`,
287+
Name: "database",
288+
Shorthand: "d",
289+
EnvVar: "COCKROACH_DATABASE",
290+
Description: `
291+
The name of the database and (optionally) virtual cluster to connect to:
292+
<PRE>
293+
-d [database]
294+
-d cluster:[virtual-cluster]/[database]
295+
296+
</PRE>
297+
For example:
298+
<PRE>
299+
-d mydb
300+
-d cluster:mycluster/mydb
301+
302+
</PRE>
303+
If empty or unspecified, the virtual cluster defaults to the
304+
"server.controller.default_target_cluster" cluster setting.
305+
`,
291306
}
292307

293308
DumpMode = FlagInfo{
@@ -1229,9 +1244,13 @@ The value "disabled" will disable all local file I/O.
12291244
Connection URL, of the form:
12301245
<PRE>
12311246
postgresql://[user[:passwd]@]host[:port]/[db][?parameters...]
1247+
postgresql://[user[:passwd]@]host[:port]/cluster:[virtual-cluster]/[db][?parameters...]
1248+
12321249
</PRE>
1233-
For example, postgresql://myuser@localhost:26257/mydb.
1250+
For example:
12341251
<PRE>
1252+
postgresql://myuser@localhost:26257/mydb
1253+
postgresql://myuser@localhost:26257/cluster:mycluster/mydb
12351254
12361255
</PRE>
12371256
If left empty, the discrete connection flags are used: host, port,

0 commit comments

Comments
 (0)