https://github.com/proddata/streamlit-cratedb
https://github.com/proddata/streamlit-cratedb
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/proddata/streamlit-cratedb
- Owner: proddata
- Created: 2024-06-25T12:21:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-26T19:16:43.000Z (almost 2 years ago)
- Last Synced: 2025-01-16T07:23:17.510Z (over 1 year ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Streamlit with CrateDB Cloud
This Streamlit app allows you to execute SQL queries against a CrateDB Cloud database and display the results interactively.
## Installation
1. Clone the repository:
```sh
git clone https://github.com/proddata/streamlit-cratedb-example.git
cd streamlit-cratedb-example
```
2. Create and activate a virtual environment:
```sh
python3 -m venv .venv
source .venv/bin/activate
```
3. Install the required packages:
```sh
pip install -r requirements.txt
```
4. Set up your secrets. Create a `secrets.toml` file in the `.streamlit` directory:
```toml
[connections.cratedb]
dialect = "crate"
host = "localhost"
port = "4200"
username = "crate"
password = ""
```
## Running the App
1. Start the Streamlit app:
```sh
streamlit run main.py
```
2. Open your web browser and go to `http://localhost:8501` to interact with the app.
## Usage
- Enter your SQL query in the provided editor.
- Click the "Execute Query" button to run the query.
- View the results in the table displayed below the editor.