praval.storage.providers.postgresql
PostgreSQL storage provider for Praval framework
Provides relational database capabilities with SQL query support, transactions, and schema management.
Classes
|
PostgreSQL storage provider with async connection pooling. |
- class praval.storage.providers.postgresql.PostgreSQLProvider(name, config)[source]
Bases:
BaseStorageProviderPostgreSQL storage provider with async connection pooling.
Features: - Async connection pooling - SQL query execution - Transaction support - Schema management - JSON column support - Full-text search capabilities
- Parameters:
name (str)
config (Dict[str, Any])
- async store(resource, data, **kwargs)[source]
Store data in PostgreSQL table.
- Parameters:
resource (
str) – Table namedata (
Any) – Data to store (dict or list of dicts)**kwargs – Additional parameters (upsert, returning, etc.)
- Return type:
- Returns:
StorageResult with operation outcome
- async retrieve(resource, **kwargs)[source]
Retrieve data from PostgreSQL table.
- Parameters:
resource (
str) – Table name**kwargs – Query parameters (where, limit, offset, order_by, etc.)
- Return type:
- Returns:
StorageResult with retrieved data
- async query(resource, query, **kwargs)[source]
Execute SQL query against PostgreSQL.
- Parameters:
resource (
str) – Table name (ignored for raw SQL)query (
Union[str,Dict]) – SQL query string or structured query dict**kwargs – Query parameters
- Return type:
- Returns:
StorageResult with query results
- async delete(resource, **kwargs)[source]
Delete data from PostgreSQL table.
- Parameters:
resource (
str) – Table name**kwargs – Delete parameters (where clause required)
- Return type:
- Returns:
StorageResult with operation outcome