@@ -29,7 +29,7 @@ Connect to CrateDB
29
29
Connect to a single node
30
30
========================
31
31
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::
33
33
34
34
>>> connection = client.connect("<NODE_URL>", username="<USERNAME>")
35
35
@@ -69,7 +69,7 @@ Connect to multiple nodes
69
69
=========================
70
70
71
71
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::
73
73
74
74
>>> connection = client.connect(["<NODE_1_URL>", "<NODE_2_URL>"], ...)
75
75
@@ -220,10 +220,14 @@ Authentication
220
220
221
221
See the :ref: `compatibility notes <cratedb-versions >` for more information.
222
222
223
- You can authenticate with CrateDB like so:
223
+ You can authenticate with CrateDB like so::
224
224
225
225
>>> connection = client.connect(..., username="<USERNAME>", password="<PASSWORD>")
226
226
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
+
227
231
Here, replace ``<USERNAME> `` and ``<PASSWORD> `` with the appropriate username
228
232
and password.
229
233
@@ -238,7 +242,7 @@ and password.
238
242
Schema selection
239
243
================
240
244
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::
242
246
243
247
>>> connection = client.connect(..., schema="<SCHEMA>")
244
248
0 commit comments