pipekit/pipekit/drivers/__init__.py
Paul Trowbridge 574ada5258 Initial commit: Pipekit rewrite.
Orchestration layer around the jrunner Java JDBC CLI, replacing the
previous shell-based sync system in .archive/pre-rewrite. Includes
the FastAPI + Jinja web frontend, per-driver adapters (DB2, MSSQL,
PG), wizard-driven module creation with editable dest types and
source-sourced table/column descriptions, watermark/hook CRUD,
and the engine that runs modules end-to-end.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 00:38:26 -04:00

33 lines
962 B
Python

"""Driver registry — one :class:`Driver` instance per kind."""
from __future__ import annotations
from .base import (BrowseField, Driver, RemoteColumn, RemoteTable,
validate_identifier)
from .db2 import DB2Driver
from .mssql import MSSQLDriver
from .pg import PGDriver
_REGISTRY: dict[str, Driver] = {
DB2Driver.kind: DB2Driver(),
MSSQLDriver.kind: MSSQLDriver(),
PGDriver.kind: PGDriver(),
}
def get_driver(kind: str) -> Driver:
try:
return _REGISTRY[kind]
except KeyError:
known = ", ".join(sorted(_REGISTRY))
raise ValueError(f"unknown driver kind {kind!r} (known: {known})")
def available_kinds() -> list[tuple[str, str]]:
"""Return [(kind, label), ...] for every registered driver."""
return [(d.kind, d.label) for d in _REGISTRY.values()]
__all__ = ["BrowseField", "Driver", "RemoteColumn", "RemoteTable",
"validate_identifier", "get_driver", "available_kinds"]