evoid-sqlite
SQLite storage engine for EVOID — Intent Handler system
Quick Start • Intent Handler • Config • API
Quick Start
uv add evoid-sqlite
Method 1: Intent Handler (Recommended)
from evoid_sqlite import register_handlers
from evoid.core.storage import storage_read, storage_write, storage_delete
# Register SQLite as storage handler
register_handlers(db_path="my_app.db")
# Use high-level API — goes through Intent pipeline
await storage_write("user:1", {"name": "Alice", "role": "admin"})
user = await storage_read("user:1")
await storage_delete("user:1")
Method 2: Direct API
from evoid_sqlite import create_storage
storage = create_storage("my_app.db")
await storage.write("user:1", {"name": "Alice"})
user = await storage.read("user:1")
Intent Handler
evoid-sqlite registers these Intent handlers:
| Intent | Handler | Description |
|---|---|---|
storage.read |
handle_read |
Read from SQLite |
storage.write |
handle_write |
Write to SQLite |
storage.delete |
handle_delete |
Delete from SQLite |
storage.health |
handle_health |
Check connection |
How it works
register_handlers()registers Intent handlers for storage operationsstorage_read()/storage_write()create Intents and execute through pipeline- Pipeline routes to SQLite handler
- Handler connects to SQLite and performs operation
Configuration
TOML
[engines]
storage = "sqlite"
[engines.options.sqlite]
db_path = "data/my_app.db"
Python
from evoid.config import config
app = config(
engines={
"storage": "sqlite",
"options": {
"sqlite": {"db_path": "data/production.db"},
},
},
)
API
register_handlers(db_path: str)
Register SQLite as Intent handlers.
| Parameter | Type | Default | Description |
|---|---|---|---|
db_path |
str |
evoid.db |
Path to SQLite database file |
create_storage(db_path: str) -> SQLiteStorage
Factory function for direct API access.
Methods
| Method | Signature | Returns | Description |
|---|---|---|---|
read |
async read(key: str) |
Any | None |
Read value by key |
write |
async write(key: str, data: dict) |
bool |
Write value (JSON serialized) |
delete |
async delete(key: str) |
bool |
Delete by key |
health |
async health() |
bool |
Check connection |
list_keys |
async list_keys(namespace: str) |
list[str] |
List all keys |
Dependencies
evoid>=0.4.3evoid-di>=0.1.0aiosqlite>=0.20.0
DI Integration
Registers as storage.sqlite in evoid-di:
from evoid_di import di
# Auto-registered when you call register_handlers()
di.register("storage.sqlite", lambda: SQLiteStorage("app.db"))
# Resolve with fallback
storage = di.resolve_with_fallback("storage.postgresql")
# Falls back to storage.sqlite if postgresql fails
Links
License
MIT
Release files for evoid-sqlite 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| evoid_sqlite-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / evoid_sqlite-0.1.2-py3-none-any.whl
| Download URL | evoid_sqlite-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d8a96fc6973f8486b837c9b1525daea424339debd4bb3b6ac0f05ecbac93f38
|
|
BLAKE2b-256 checksum How to use checksums |
e05575394c95d4523b6074e5a4d125ece943cdbde3079bd88911abdb3bdcf00d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|