Skip to main content
Version: 1.3.0 (latest)

sources.sql_database.schema_types

default_table_adapter

def default_table_adapter(table: Table,
included_columns: Optional[List[str]]) -> None

[view_source]

Default table adapter being always called before custom one

sqla_col_to_column_schema

def sqla_col_to_column_schema(
sql_col: ColumnAny,
reflection_level: ReflectionLevel,
type_adapter_callback: Optional[TTypeAdapter] = None,
skip_nested_columns_on_minimal: bool = False
) -> Optional[TColumnSchema]

[view_source]

Infer dlt schema column type from an sqlalchemy type.

If add_precision is set, precision and scale is inferred from that types that support it, such as numeric, varchar, int, bigint. Numeric (decimal) types have always precision added.

get_primary_key

def get_primary_key(table: Table) -> Optional[List[str]]

[view_source]

Create primary key or return None if no key defined

table_to_columns

def table_to_columns(
table: Table,
reflection_level: ReflectionLevel = "full",
type_conversion_fallback: Optional[TTypeAdapter] = None,
skip_nested_columns_on_minimal: bool = False) -> TTableSchemaColumns

[view_source]

Convert an sqlalchemy table to a dlt table schema.

get_table_references

def get_table_references(table: Table) -> Optional[List[TTableReference]]

[view_source]

Resolve table references from SQLAlchemy foreign key constraints in the table

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.