Skip to content

Commit 8fa85a5

Browse files
committed
fixup! Adjust connect arguments to accept credentials within the HTTP URI
1 parent f1b2238 commit 8fa85a5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/connect.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Connect to CrateDB
2929
Connect to a single node
3030
========================
3131

32-
To connect to a single CrateDB node, use the ``connect()`` function, like so:
32+
To connect to a single CrateDB node, use the ``connect()`` function, like so::
3333

3434
>>> connection = client.connect("<NODE_URL>", username="<USERNAME>")
3535

@@ -69,7 +69,7 @@ Connect to multiple nodes
6969
=========================
7070

7171
To connect to one of multiple nodes, pass a list of database URLs to the
72-
connect() function, like so:
72+
connect() function, like so::
7373

7474
>>> connection = client.connect(["<NODE_1_URL>", "<NODE_2_URL>"], ...)
7575

@@ -220,10 +220,14 @@ Authentication
220220

221221
See the :ref:`compatibility notes <cratedb-versions>` for more information.
222222

223-
You can authenticate with CrateDB like so:
223+
You can authenticate with CrateDB like so::
224224

225225
>>> connection = client.connect(..., username="<USERNAME>", password="<PASSWORD>")
226226

227+
At your disposal, you can also embed the credentials into the URI, like so::
228+
229+
>>> connection = client.connect("https://<USERNAME>:<PASSWORD>@cratedb.example.org:4200")
230+
227231
Here, replace ``<USERNAME>`` and ``<PASSWORD>`` with the appropriate username
228232
and password.
229233

@@ -238,7 +242,7 @@ and password.
238242
Schema selection
239243
================
240244

241-
You can select a schema using the optional ``schema`` argument, like so:
245+
You can select a schema using the optional ``schema`` argument, like so::
242246

243247
>>> connection = client.connect(..., schema="<SCHEMA>")
244248

0 commit comments

Comments
 (0)