Skip to content

Commit 891a656

Browse files
committed
Framework/Streamlit: Add information about connecting to CrateDB Cloud
1 parent ba6ef8a commit 891a656

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Streamlit secrets file for CrateDB Cloud.
2+
# https://docs.streamlit.io/develop/api-reference/connections/secrets.toml
3+
# .streamlit/secrets.toml
4+
5+
[connections.cratedb]
6+
dialect = "crate"
7+
host = "example.gke1.us-central1.gcp.cratedb.net"
8+
port = "4200"
9+
username = "admin"
10+
password = "g_,8.F0fNbVSk0.*!n54S5c,"
11+
12+
[connections.cratedb.create_engine_kwargs.connect_args]
13+
ssl = true

framework/streamlit/.streamlit/secrets.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Streamlit secrets file for CrateDB on localhost.
2+
# https://docs.streamlit.io/develop/api-reference/connections/secrets.toml
13
# .streamlit/secrets.toml
24

35
[connections.cratedb]

framework/streamlit/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Configure database connection address and credentials within
99
make sure to use valid credentials matching your environment.
1010

1111
## Usage
12+
13+
### CrateDB on localhost
1214
To start a CrateDB instance on your machine, invoke:
1315
```shell
1416
docker run -it --rm \
@@ -17,6 +19,15 @@ docker run -it --rm \
1719
crate:latest -Cdiscovery.type=single-node
1820
```
1921

22+
### CrateDB Cloud
23+
Please have a look at the [secrets-cratedb-cloud.toml](.streamlit/secrets-cratedb-cloud.toml)
24+
file as a blueprint. It includes a configuration snippet that is essential for
25+
connecting to CrateDB Cloud.
26+
```toml
27+
[connections.cratedb.create_engine_kwargs.connect_args]
28+
ssl = true
29+
```
30+
2031
Install dependencies.
2132
```shell
2233
pip install -r requirements.txt
@@ -36,7 +47,7 @@ Enjoy the list of mountains.
3647

3748
## Development
3849

39-
Acquire `cratedb-example` repository, and set up sandbox:
50+
Acquire `cratedb-example` repository, and set up development sandbox.
4051
```shell
4152
git clone https://github.com/crate/cratedb-examples
4253
cd cratedb-examples
@@ -45,7 +56,7 @@ source .venv/bin/activate
4556
pip install -r requirements.txt
4657
```
4758

48-
Then, invoke the integration test cases:
59+
Invoke the integration test cases.
4960
```shell
5061
ngr test framework/streamlit
5162
```

0 commit comments

Comments
 (0)