Skip to content

Commit 88912ab

Browse files
committed
Update docstring for tunnel command
Include tunnel command in generated sgr documentation.
1 parent 64c3593 commit 88912ab

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

docs/generate_reference.py

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
stub_c,
3232
sync_c,
3333
token_c,
34+
tunnel_c,
3435
upload_c,
3536
validate_c,
3637
)
@@ -97,6 +98,7 @@
9798
"cloud stub",
9899
"cloud validate",
99100
"cloud seed",
101+
"cloud tunnel",
100102
],
101103
),
102104
]
@@ -137,6 +139,7 @@
137139
"cloud stub": stub_c,
138140
"cloud validate": validate_c,
139141
"cloud seed": seed_c,
142+
"cloud tunnel": tunnel_c,
140143
}
141144

142145

splitgraph/commandline/cloud.py

+23-3
Original file line numberDiff line numberDiff line change
@@ -1284,10 +1284,30 @@ def start_ephemeral_tunnel(remote: str, local_address: str) -> None:
12841284
@click.argument("repository_or_local_address", type=str)
12851285
def tunnel_c(remote: str, repositories_file: List[Path], repository_or_local_address: str):
12861286
"""
1287-
Start the tunnel client to make tunneled external repo available.
1287+
Start tunnel to query a private data source.
1288+
The tunnel will run in the foreground providing Splitgraph Cloud access
1289+
to the data source for the duration of the process.
1290+
1291+
To provide access to a private data source during repository creation,
1292+
provide its `host:port` address, e.g.:
1293+
1294+
```
1295+
sgr cloud tunnel localhost:5432
1296+
```
1297+
1298+
Then, create an external repository with the host and port output by
1299+
the command.
1300+
1301+
To query existing external repositories requiring a tunnel to access
1302+
their backing data source, run:
1303+
1304+
```
1305+
sgr cloud tunnel namespace/repo
1306+
```
1307+
1308+
Note that for this to work, the `splitgraph.yml` definition of the
1309+
repository must include `tunnel: true`.
12881310
1289-
This will load a splitgraph.yml file and tunnel the host:port address of the
1290-
external repository specified in the argument.
12911311
"""
12921312

12931313
if "/" in repository_or_local_address:

0 commit comments

Comments
 (0)