Python client for Titan Distributed SQLite
Project description
Titan DB — Python Client
Python client for Titan Distributed SQLite.
Install
pip install -e .
Or just copy titan_db.py into your project.
Usage
from titan_db import TitanClient
# Connect to the cluster
db = TitanClient([
"http://127.0.0.1:8001",
"http://127.0.0.1:8002",
"http://127.0.0.1:8003",
])
# Write (auto-discovers and sends to the Leader)
db.execute("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)")
db.execute("INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com')")
db.execute("INSERT INTO users (name, email) VALUES ('Bob', 'bob@example.com')")
# Read (goes to any reachable node)
rows = db.query("SELECT * FROM users")
for row in rows:
print(row)
# {'id': '1', 'name': 'Alice', 'email': 'alice@example.com'}
# {'id': '2', 'name': 'Bob', 'email': 'bob@example.com'}
# Cluster status
print(db.status())
print(db.leader())
API
| Method | Description |
|---|---|
execute(sql) |
Write SQL — auto-routes to Leader via Raft |
query(sql) |
Read SQL — returns list of dicts |
status() |
Get status of all nodes |
leader() |
Get current leader info |
Project details
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 titan_db-0.1.1.tar.gz.
File metadata
- Download URL: titan_db-0.1.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8839f03fa442643e2a41072111f06d2a1d1d6c27dfee0017491ef6d2d3c8fc1
|
|
| MD5 |
ec0c2de455afaf746603c2c80de5c747
|
|
| BLAKE2b-256 |
fad6ec702bcb1c3e84ef01e5725ecb6faf57f4186ed568ca9f5edfb819e60936
|
Provenance
The following attestation bundles were made for titan_db-0.1.1.tar.gz:
Publisher:
pypi-publish.yml on Yogendra-sodha/titan-distributed-sqlite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
titan_db-0.1.1.tar.gz -
Subject digest:
e8839f03fa442643e2a41072111f06d2a1d1d6c27dfee0017491ef6d2d3c8fc1 - Sigstore transparency entry: 1280258458
- Sigstore integration time:
-
Permalink:
Yogendra-sodha/titan-distributed-sqlite@eed267fadb8edbedeb0d7c4694e651118565eb24 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Yogendra-sodha
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@eed267fadb8edbedeb0d7c4694e651118565eb24 -
Trigger Event:
release
-
Statement type:
File details
Details for the file titan_db-0.1.1-py3-none-any.whl.
File metadata
- Download URL: titan_db-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.7 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 |
625fff0578695b799e8c1c1be37e35dfafb207459a6c2de7d1b649fcf2f9730c
|
|
| MD5 |
ee6a4090fa841741b65c3d30741b24cd
|
|
| BLAKE2b-256 |
4ef09931dd8542c4f423c51c963be25e737d32d477adc98b4a9601b3545c34fd
|
Provenance
The following attestation bundles were made for titan_db-0.1.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on Yogendra-sodha/titan-distributed-sqlite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
titan_db-0.1.1-py3-none-any.whl -
Subject digest:
625fff0578695b799e8c1c1be37e35dfafb207459a6c2de7d1b649fcf2f9730c - Sigstore transparency entry: 1280258470
- Sigstore integration time:
-
Permalink:
Yogendra-sodha/titan-distributed-sqlite@eed267fadb8edbedeb0d7c4694e651118565eb24 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Yogendra-sodha
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@eed267fadb8edbedeb0d7c4694e651118565eb24 -
Trigger Event:
release
-
Statement type: