Skip to content

Commit c08ecd1

Browse files
committed
fixup! Adjust connect arguments to enable SSL using SQLAlchemy DB URI
1 parent 8fa85a5 commit c08ecd1

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

docs/sqlalchemy.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The CrateDB Python client library provides support for SQLAlchemy. A CrateDB
1111
configuration.
1212

1313
The CrateDB Python client library works with SQLAlchemy versions ``1.0``,
14-
``1.1`` and ``1.2``.
14+
``1.1``, ``1.2`` and ``1.3``.
1515

1616
.. NOTE::
1717

@@ -49,27 +49,33 @@ Locator* (URL) called a `database URL`_.
4949

5050
The simplest database URL for CrateDB looks like this::
5151

52-
crate://<HOST>
52+
crate://<HOST>/[?option=value]
5353

54-
Here, ``<HOST>`` is the node *host string*.
54+
Here, ``<HOST>`` is the node *host string*. After the host, additional query
55+
parameters can be specified to adjust some connection settings.
5556

5657
A host string looks like this::
5758

58-
<HOST_ADDR>:<PORT>
59+
[<USERNAME>:<PASSWORD>@]<HOST_ADDR>:<PORT>
5960

6061
Here, ``<HOST_ADDR>`` is the hostname or IP address of the CrateDB node and
6162
``<PORT>`` is a valid `psql.port`_ number.
6263

63-
Example host strings:
64+
When authentication is needed, the credentials can be optionally supplied using
65+
``<USERNAME>:<PASSWORD>@``. For connecting to an SSL-secured HTTP endpoint, you
66+
can add the query parameter ``?ssl=true`` to the database URI.
6467

65-
- ``localhost:4200``
66-
- ``crate-1.vm.example.com:4200``
67-
- ``198.51.100.1:4200``
68+
Example database URIs:
69+
70+
- ``crate://localhost:4200``
71+
- ``crate://crate-1.vm.example.com:4200``
72+
- ``crate://username:[email protected]:4200/?ssl=true``
73+
- ``crate://198.51.100.1:4200``
6874

6975
.. TIP::
7076

71-
If ``<HOST>`` is blank (i.e. just ``crate://``) then ``localhost:4200`` will
72-
be assumed.
77+
If ``<HOST>`` is blank (i.e. the database URI is just ``crate://``), then
78+
``localhost:4200`` will be assumed.
7379

7480
Getting a connection
7581
--------------------

0 commit comments

Comments
 (0)