How evokoa/polygres-sdk works
Polygres is a Python SDK for a project-scoped Runtime API, not a PostgreSQL driver. The principal workflow is to construct a client with a project API key and Runtime URL, select a project, call a retrieval or pgContext operation, and receive typed results or SDK errors. The README documents graph, vector, text, hybrid, and Context capabilities. Several retrieval surfaces are documented but their implementations are not sampled; those links are shown only where the README supports them.
Main entry points: client.py Polygres client · context.py Context operations · rows.py Row operations · _api_version.py SDK version adapter
Components 22
Client and transport
- Polygres client
src/polygres/client.py - API key validation
src/polygres/_vendor/polygres_lib/auth/api_keys.py - API version contract
src/polygres/_vendor/polygres_lib/api_versions.py - SDK version adapter
src/polygres/_api_version.py - Method metadata
src/polygres/_method_metadata.py - Version notices
src/polygres/version_notices.py
Retrieval APIs
- Graph retrieval
src/polygres/client.py - Vector retrieval
src/polygres/client.py - Text retrieval
src/polygres/client.py - Hybrid retrieval
src/polygres/client.py - Row operations
src/polygres/rows.py
pgContext
- Context operations
src/polygres/context.py - Query input handling
src/polygres/_query_input.py - Context validation
src/polygres/context_validation.py - Operation waiting
src/polygres/context_wait.py
Models and contracts
- Context models
src/polygres/_vendor/polygres_lib/context/models.py - Context validation rules
src/polygres/_vendor/polygres_lib/context/validation.py - SDK result models
src/polygres/models.py - SDK errors
src/polygres/errors.py - Error catalog
src/polygres/_vendor/polygres_lib/errors/generated.py
Other components
- Python application
- Polygres Runtime API
Connections 30
- Python application → Polygres client: constructs
- Polygres client → API key validation: validates key
src/polygres/client.py - Polygres client → SDK version adapter: sets API version
src/polygres/client.py - SDK version adapter → API version contract: uses contract
src/polygres/_api_version.py - Polygres client → Method metadata: uses metadata
src/polygres/client.py - Polygres client → Version notices: checks notices
src/polygres/client.py - Python application → Graph retrieval: calls
- Python application → Vector retrieval: calls
- Python application → Text retrieval: calls
- Python application → Hybrid retrieval: calls
- Python application → Context operations: calls
- Polygres client → Context operations: creates namespace
src/polygres/client.py - Polygres client → Polygres Runtime API: sends requests
- Graph retrieval → Polygres Runtime API: requests retrieval
- Vector retrieval → Polygres Runtime API: requests retrieval
- Text retrieval → Polygres Runtime API: requests retrieval
- Hybrid retrieval → Polygres Runtime API: requests retrieval
- Context operations → Polygres Runtime API: sends operations
- Context operations → Query input handling: validates query input
src/polygres/context.py - Context operations → Context validation: validates requests
src/polygres/context.py - Context operations → Operation waiting: waits for operation
src/polygres/context.py - Context operations → Context models: builds models
src/polygres/context.py - Query input handling → Context models: validates against
src/polygres/_query_input.py - Context validation → Context validation rules: uses rules
src/polygres/context_validation.py - Polygres client → Row operations: exposes row operations
src/polygres/client.py - Row operations → Polygres Runtime API: requests row access
- Row operations → SDK result models: parses results
src/polygres/rows.py - Polygres client → SDK result models: parses responses
src/polygres/client.py - Polygres client → SDK errors: raises API errors
src/polygres/client.py - SDK errors → Error catalog: normalizes errors
src/polygres/errors.py