Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pyworkflow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
... )

Environment Variables:
PYWORKFLOW_STORAGE_TYPE: Storage backend type (file, memory, sqlite, postgres, mysql)
PYWORKFLOW_STORAGE_TYPE: Storage backend type (file, memory, sqlite, postgres, mysql, citus)
PYWORKFLOW_STORAGE_PATH: Path for file/sqlite backends
PYWORKFLOW_POSTGRES_HOST: PostgreSQL host
PYWORKFLOW_POSTGRES_PORT: PostgreSQL port
Expand Down Expand Up @@ -58,9 +58,9 @@ def _load_env_storage_config() -> dict[str, Any] | None:

storage_type = storage_type.lower()

if storage_type == "postgres":
if storage_type in ("postgres", "citus"):
return {
"type": "postgres",
"type": storage_type,
"host": os.getenv("PYWORKFLOW_POSTGRES_HOST", "localhost"),
"port": int(os.getenv("PYWORKFLOW_POSTGRES_PORT", "5432")),
"user": os.getenv("PYWORKFLOW_POSTGRES_USER", "pyworkflow"),
Expand Down
7 changes: 7 additions & 0 deletions pyworkflow/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
except ImportError:
MySQLStorageBackend = None # type: ignore

# Citus distributed PostgreSQL backend - optional import (requires asyncpg + Citus extension)
try:
from pyworkflow.storage.citus import CitusStorageBackend
except ImportError:
CitusStorageBackend = None # type: ignore

__all__ = [
"StorageBackend",
"FileStorageBackend",
Expand All @@ -56,6 +62,7 @@
"DynamoDBStorageBackend",
"CassandraStorageBackend",
"MySQLStorageBackend",
"CitusStorageBackend",
"WorkflowRun",
"StepExecution",
"Hook",
Expand Down
Loading