Skip to main content

PyPI Python License

evoid-sqlite

SQLite storage engine for EVOID — Intent Handler system

Quick StartIntent HandlerConfigAPI


Quick Start

pip install 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

  1. register_handlers() registers Intent handlers for storage operations
  2. storage_read() / storage_write() create Intents and execute through pipeline
  3. Pipeline routes to SQLite handler
  4. 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.0
  • aiosqlite>=0.20.0

Links

License

MIT

Release files for evoid-sqlite 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for evoid-sqlite 0.1.1
File Interpreter ABI Platform
evoid_sqlite-0.1.1-py3-none-any.whl Python 3 none any Details

Release files / evoid_sqlite-0.1.1-py3-none-any.whl

Download URL evoid_sqlite-0.1.1-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1b81760e32dfa0a49b8e100939375e79c2eaf1354163fa02223b1dc3697b929
BLAKE2b-256 checksum
How to use checksums
939967b0052089d36e0f518544e901ad0e1e0de3363e29100781c783c5cec3b0
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}

Release history Release notifications | RSS feed

0.2.0

1 release file

0.1.2

1 release file

This release

0.1.1 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page