evoid-postgresql
PostgreSQL storage engine — Intent Handler system
Quick Start • Intent Handler • Config • API
Quick Start
uv add evoid-postgresql
Method 1: Intent Handler (Recommended)
from evoid_postgresql import register_handlers
from evoid.core.storage import storage_read, storage_write, storage_delete
# Register PostgreSQL as storage handler
register_handlers(url="postgresql+asyncpg://user:pass@localhost/evoid")
# Use high-level API
await storage_write("user:1", {"name": "Alice"})
user = await storage_read("user:1")
await storage_delete("user:1")
Method 2: Direct API
from evoid_postgresql import create_storage
storage = create_storage("postgresql+asyncpg://user:pass@localhost/evoid")
await storage.write("user:1", {"name": "Alice"})
user = await storage.read("user:1")
Intent Handler
evoid-postgresql registers these Intent handlers:
| Intent | Handler | Description |
|---|---|---|
storage.read |
handle_read |
Read from PostgreSQL |
storage.write |
handle_write |
Write to PostgreSQL |
storage.delete |
handle_delete |
Delete from PostgreSQL |
storage.health |
handle_health |
Check connection |
Configuration
TOML
[engines]
storage = "postgresql"
[engines.options.postgresql]
url = "postgresql+asyncpg://user:pass@localhost/evoid"
Python
from evoid.config import config
app = config(
engines={
"storage": "postgresql",
"options": {
"postgresql": {
"url": "postgresql+asyncpg://prod:secret@db/evoid",
},
},
},
)
API
register_handlers(url: str)
Register PostgreSQL as Intent handlers.
| Parameter | Type | Default | Description |
|---|---|---|---|
url |
str |
postgresql+asyncpg://localhost/evoid |
SQLAlchemy async connection URL |
create_storage(url: str) -> PostgresStorage
Factory function for direct API access.
Methods
| Method | Signature | Returns | Description |
|---|---|---|---|
write |
async write(key: str, data: dict) |
bool |
Upsert data (JSONB) |
read |
async read(key: str) |
Any | None |
Read data by key |
delete |
async delete(key: str) |
bool |
Delete by key |
health |
async health() |
bool |
Check connection |
Dependencies
evoid>=0.4.3sqlalchemy[asyncio]>=2.0.0asyncpg>=0.29.0
Optional
evoid-di>=0.1.0— for DI integration (auto-registered whenregister_handlers()is called)
DI Integration
When you call register_handlers(), PostgreSQL is auto-registered as storage.postgresql in evoid-di:
from evoid_di import di
# After register_handlers(), set up fallback chain:
di.set_fallback("storage.postgresql", ["storage.sqlite", "cache.redis"])
# Auto-fallback on failure:
storage = di.resolve_with_fallback("storage.postgresql")
Links
License
MIT
Metadata
Release files for evoid-postgresql 0.2.0
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 | Actions Reset |
|---|---|---|---|---|
| evoid_postgresql-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for evoid_postgresql-0.2.0-py3-none-any.whl |
Release files / evoid_postgresql-0.2.0-py3-none-any.whl
| Download URL | evoid_postgresql-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca6b308d5a38be7e045f2b7bc5f75fb635d68ba5e4a92927a1f05aad76133060
|
|
BLAKE2b-256 checksum How to use checksums |
6a02ea8546cc7b1003087e91bfb55a37981a93803dd0af363bb4b9c4bacf889d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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}
|
Security for evoid-postgresql 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.