Skip to content

API Reference parrot.tools.dataset_manager.sources.dialects

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.dataset_manager.sources.dialects

View source

Driver–Dialect Map for FEAT-228 Data-Plane Authorization.

Maps ai-parrot driver aliases (as returned by normalize_driver) to sqlglot 30.9.0 dialect identifiers. Used by the physical-resource resolver to parse SQL with the correct dialect so that table extraction is accurate for each database backend.

Usage::

from parrot.tools.dataset_manager.sources.dialects import driver_to_dialect

dialect = driver_to_dialect("bigquery")   # returns "bigquery"
dialect = driver_to_dialect("bq")          # returns "bigquery" (via normalize_driver)
dialect = driver_to_dialect("unknown")     # returns None

Function driver_to_dialect

Map an ai-parrot driver name to a sqlglot dialect identifier.

Normalises the driver name via :func:normalize_driver before lookup so that raw aliases ("postgres", "bq", "sqlserver", …) are resolved the same way as canonical names.

Examples::

>>> driver_to_dialect("pg")
'postgres'
>>> driver_to_dialect("bq")
'bigquery'
>>> driver_to_dialect("mssql")
'tsql'
>>> driver_to_dialect("unknown_db_xyz") is None
True

driver_to_dialect(driver: str) -> Optional[str]

Parameter Type Default Description
driver str Raw or pre-normalised ai-parrot driver name.

Returns: Optional[str] — A sqlglot dialect string (e.g. "postgres", "bigquery"), or None if the driver is not in the known map. The caller is responsible for deciding whether an unmapped driver is fail-open or fail-closed.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally