SQL for everything. Read, write, delete across any API or database.
Project description
Sidol
SQL for everything. Read, write, and delete across any API or database using plain SQL.
SELECT→ executed through DuckDB (fast, in-memory, federated)INSERT/UPDATE/DELETE→ parsed by sqlglot, routed to connector write APIs- Built-in connectors: ServiceNow, CSV, SQLite
- Extensible: implement
BaseConnectorto add any source
import sidol
db = sidol.connect()
db.register("incidents", sidol.ServiceNowConnector(instance="myco", table="incident", ...))
db.register("local", sidol.SQLiteConnector(path="./data.db"))
tbl = db.sql("SELECT number, state FROM incidents WHERE priority = 1") # pyarrow.Table
db.sql("UPDATE incidents SET state = 'closed' WHERE number = 'INC001'")
Setup (with uv — recommended)
uv is a fast Python package manager. Install it once, then:
# Install uv (one-time)
# Windows:
winget install --id=astral-sh.uv -e
# macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone & install all dependencies in ~2 seconds
git clone https://github.com/mitayan0/sidol
cd sidol
uv sync
# Run tests
uv run pytest
# Run linter
uv run ruff check sidol/
# Type-check
uv run mypy sidol/
Setup (classic pip)
pip install -e .
pip install pytest pytest-asyncio respx mypy ruff
python -m pytest
Architecture
SQL string
│
├─ SELECT ──→ DuckDB (in-memory) ──→ connector.fetch() per table ──→ DataFrame
│
└─ DML ─────→ sqlglot AST ──→ extract table/values/filters ──→ connector.insert/update/delete()
Three layers:
- SQL interface —
sidol.connect(),db.sql(),db.register() - Router —
sidol/router.pyparses and dispatches - Connectors — pluggable
BaseConnectorimplementations
Writing a Connector
from sidol.connectors.base import BaseConnector
from sidol.types import Schema, Column, Capabilities, WriteResult
class MyConnector(BaseConnector):
def schema(self) -> Schema:
return Schema(tables={"mytable": [Column("id", "int", primary_key=True)]})
def fetch(self, table, columns, filters, limit, offset):
yield {"id": 1, "name": "hello"}
def capabilities(self) -> Capabilities:
return Capabilities(readable=True, insertable=True)
def insert(self, table, rows) -> WriteResult:
...
return WriteResult(affected_rows=len(rows))
Supported SQL Subset (v1)
| Statement | Support |
|---|---|
SELECT |
✅ Full (via DuckDB — JOINs, aggregates, CTEs) |
INSERT INTO t (cols) VALUES (...) |
✅ Literal values only |
UPDATE t SET col=val WHERE ... |
✅ Simple equality filters |
DELETE FROM t WHERE ... |
✅ Simple equality filters |
CREATE TABLE |
❌ Not supported in v1 |
| Subqueries in DML | ❌ Not supported in v1 |
License
MIT — see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sidol-0.1.0.tar.gz.
File metadata
- Download URL: sidol-0.1.0.tar.gz
- Upload date:
- Size: 49.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41a5a056f5792e1262c7a8dabb3670c120c84988bbd43b1af94973d0632ef999
|
|
| MD5 |
86972f19c23a981c344dcee5fd256d5e
|
|
| BLAKE2b-256 |
d2578f599ac5d00c4c9db0d38fe172fe2cee95c2c8c876f84e004ed3399ad9b9
|
Provenance
The following attestation bundles were made for sidol-0.1.0.tar.gz:
Publisher:
publish.yml on mitayan0/sidol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sidol-0.1.0.tar.gz -
Subject digest:
41a5a056f5792e1262c7a8dabb3670c120c84988bbd43b1af94973d0632ef999 - Sigstore transparency entry: 1492718949
- Sigstore integration time:
-
Permalink:
mitayan0/sidol@20e0a35de6264d91901efb0bd366c17865ec843f -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/mitayan0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@20e0a35de6264d91901efb0bd366c17865ec843f -
Trigger Event:
release
-
Statement type:
File details
Details for the file sidol-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sidol-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
408ae2831b06b68d1b4e3f07267b95ba2a305e6025c42fcf5042c105e6576f63
|
|
| MD5 |
811f751e7e6e4e0b0570441d94ef1c02
|
|
| BLAKE2b-256 |
94c5db48fcbf5f9cba93df1a2021f54c78f121a0530884c4e6e987c8f3bd871c
|
Provenance
The following attestation bundles were made for sidol-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on mitayan0/sidol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sidol-0.1.0-py3-none-any.whl -
Subject digest:
408ae2831b06b68d1b4e3f07267b95ba2a305e6025c42fcf5042c105e6576f63 - Sigstore transparency entry: 1492719085
- Sigstore integration time:
-
Permalink:
mitayan0/sidol@20e0a35de6264d91901efb0bd366c17865ec843f -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/mitayan0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@20e0a35de6264d91901efb0bd366c17865ec843f -
Trigger Event:
release
-
Statement type: