sources.sql_database.schema_types
default_table_adapter
def default_table_adapter(table: Table,
included_columns: Optional[List[str]]) -> None
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]
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]]
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
Convert an sqlalchemy table to a dlt table schema.