Skip to content

graflo.connections

Connection configuration and runtime credential resolution.

This package is the single home for how to reach things:

  • :mod:graflo.connections.onto — target-DB config models (DBConfig and per-backend subclasses). Pure pydantic; importable without any DB driver.
  • :mod:graflo.connections.graflo_backend — config for the on-disk GraFlo backend.
  • :mod:graflo.connections.mapping — DBType → config-class mapping.
  • :mod:graflo.connections.sources — runtime source connection models (REST API, Kafka, files on a local disk or S3) and ConnConfig, the union a conn_proxy label resolves to.
  • :mod:graflo.connections.kinds — every connection as one union discriminated by kind, parse_connection and the roles each kind plays.
  • :mod:graflo.connections.env — the conn_proxy → {PREFIX}<FIELD> environment-variable rule.
  • :mod:graflo.connections.provider — ConnectionProvider protocol resolving conn_proxy labels to runtime configs (keeps YAML manifests secret-free).

Layering: onto / graflo_backend / mapping / sources sit below graflo.architecture.contract (bindings reference PostgresConfig); provider sits above it (it resolves contract connectors). The façade is lazy so importing one side never drags in the other.

Modules:

Name Description
bulk

Tuning of a bulk load, carried on a database config as bulk.

env

Where connection settings come from outside a config file.

graflo_backend

Configuration for GraFlo file backend connections.

kinds

Every kind of connection as one typed union, and the roles each kind plays.

mapping
onto
provider

Runtime resolution of conn_proxy labels to connection configs.

sources

Pydantic models for runtime source connection configuration.

Attributes

__all__ = ['CONNECTION_ADAPTER', 'DB_TYPE_MAPPING', 'TARGET_DATABASES', 'AnyConnection', 'ApiAuth', 'ArangoConfig', 'ConnConfig', 'Connection', 'ConnectionKind', 'ConnectionProvider', 'DBConfig', 'EmptyConnectionProvider', 'FalkordbConfig', 'FilesConnConfig', 'GraFloBackendConfig', 'GraphDBConfig', 'InMemoryConnectionProvider', 'KafkaConnConfig', 'KafkaSecurityProtocol', 'MemgraphConfig', 'NebulaConfig', 'Neo4jConfig', 'PostgresConfig', 'RestApiConnConfig', 'Role', 'S3ConnConfig', 'SparqlAuth', 'SparqlEndpointConfig', 'TigergraphConfig', 'connection_kind', 'connector_config', 'get_config_class', 'parse_connection', 'proxy_env_prefix', 'resolve_secrets_from_env', 'roles'] module-attribute

Functions:

__dir__()

Source code in graflo/connections/__init__.py
def __dir__() -> list[str]:
    return sorted(__all__)

__getattr__(name)

Source code in graflo/connections/__init__.py
def __getattr__(name: str) -> Any:
    if name in _EXPORTS:
        import importlib

        value = getattr(importlib.import_module(_EXPORTS[name]), name)
        globals()[name] = value
        return value
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")