Skip to content

Commit 960916d

Browse files
committed
add readme
1 parent 9520fd1 commit 960916d

File tree

1 file changed

+128
-14
lines changed

1 file changed

+128
-14
lines changed

README.md

Lines changed: 128 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,149 @@
1-
# sqlalchemy-parseable
1+
# SQLAlchemy Parseable Connector for Apache Superset
22

3-
A DBAPI and SQLAlchemy dialect for Parseable.
3+
A SQLAlchemy dialect and DBAPI implementation for connecting Apache Superset to Parseable, enabling seamless data visualization and analytics of your log data.
44

5-
## Getting Started on local machine.
5+
## Features
66

7-
- Install superset, initalise parseable connector and configure superset.
7+
- Full SQLAlchemy dialect implementation for Parseable
8+
- Support for timestamp-based queries
9+
- Automatic schema detection
10+
- Support for special characters in table names (e.g., "ingress-nginx")
11+
- Type mapping from Parseable to SQLAlchemy types
12+
- Connection pooling and management
813

9-
## Install Superset
14+
## Prerequisites
1015

11-
- Make sure ```Python 3.11.6``` is installed.
16+
- Python 3.11.6 or higher
17+
- Apache Superset
18+
- A running Parseable instance
1219

13-
```
20+
## Installation
21+
22+
### 1. Set Up Python Environment
23+
24+
First, create and activate a Python virtual environment:
25+
26+
```bash
1427
python3 -m venv venv
15-
. venv/bin/activate
28+
source venv/bin/activate # On Linux/Mac
29+
# or
30+
.\venv\Scripts\activate # On Windows
31+
```
32+
33+
### 2. Install and Configure Superset
34+
35+
Install Apache Superset and perform initial setup:
36+
37+
```bash
38+
# Install Superset
1639
pip install apache-superset
17-
export SUPERSET_SECRET_KEY=YOUR-SECRET-KEY
40+
41+
# Configure Superset
42+
export SUPERSET_SECRET_KEY=your-secure-secret-key
1843
export FLASK_APP=superset
44+
45+
# Initialize the database
1946
superset db upgrade
47+
48+
# Create an admin user
2049
superset fab create-admin
50+
51+
# Load initial data
2152
superset init
2253
```
2354

24-
- Initalise parseable connector.
55+
### 3. Install Parseable Connector
2556

26-
```
57+
Install the Parseable connector in development mode:
58+
59+
```bash
2760
cd sqlalchemy-parseable
2861
pip install -e .
2962
```
3063

31-
- Run superset.
64+
## Running Superset
3265

33-
```
66+
Start the Superset development server:
67+
68+
```bash
3469
superset run -p 8088 --with-threads --reload --debugger
35-
```
70+
```
71+
72+
Access Superset at http://localhost:8088
73+
74+
## Connecting to Parseable
75+
76+
1. In the Superset UI, go to Data → Databases → + Database
77+
2. Select "Other" as the database type
78+
3. Use the following SQLAlchemy URI format:
79+
```
80+
parseable://username:password@host:port/table_name
81+
```
82+
Example:
83+
```
84+
parseable://admin:[email protected]:443/ingress-nginx
85+
```
86+
87+
## Query Examples
88+
89+
The connector supports standard SQL queries with some Parseable-specific features:
90+
91+
```sql
92+
-- Basic query with time range
93+
SELECT method, status, COUNT(*) as count
94+
FROM ingress-nginx
95+
WHERE p_timestamp >= '2024-01-01T00:00:00Z'
96+
AND p_timestamp < '2024-01-02T00:00:00Z'
97+
GROUP BY method, status;
98+
99+
-- Status code analysis
100+
SELECT status, COUNT(*) as count
101+
FROM ingress-nginx
102+
WHERE p_timestamp >= '2024-01-01T00:00:00Z'
103+
GROUP BY status;
104+
```
105+
106+
## Development
107+
108+
The connector implements several key components:
109+
110+
- `ParseableDialect`: SQLAlchemy dialect implementation
111+
- `ParseableClient`: HTTP client for Parseable API
112+
- `ParseableConnection`: DBAPI connection implementation
113+
- `ParseableCursor`: DBAPI cursor implementation
114+
115+
## Features and Limitations
116+
117+
### Supported Features
118+
- Query execution with time range filtering
119+
- Schema inspection
120+
- Column type mapping
121+
- Connection testing
122+
- Table existence checking
123+
124+
### Current Limitations
125+
- No transaction support (Parseable is append-only)
126+
- No write operations support
127+
- Limited to supported Parseable query operations
128+
129+
## Troubleshooting
130+
131+
### Common Issues
132+
133+
1. Connection Errors
134+
- Verify Parseable host and port are correct
135+
- Ensure credentials are valid
136+
- Check if table name exists in Parseable
137+
138+
2. Query Errors
139+
- Verify time range format (should be ISO8601)
140+
- Check if column names exist in schema
141+
- Ensure proper quoting for table names with special characters
142+
143+
## Contributing
144+
145+
Contributions are welcome! Please feel free to submit a Pull Request.
146+
147+
## License
148+
149+
[Apache License 2.0](LICENSE)

0 commit comments

Comments
 (0)