dlt.destinations.impl.duckdb.sql_client
DuckDBDBApiCursorImpl Objects
class DuckDBDBApiCursorImpl(DBApiCursorImpl)
Use native duckdb data frame support if available
native_cursor
type: ignore
vector_size
vector size is 2048
DuckDbSqlClient Objects
class DuckDbSqlClient(SqlClientBase[duckdb.DuckDBPyConnection], DBTransaction)
warn_if_catalog_equals_dataset_name
def warn_if_catalog_equals_dataset_name() -> None
Checks if the DuckDB connection's current catalog equals the dataset name (schema).
WithTableScanners Objects
class WithTableScanners(DuckDbSqlClient)
memory_db
Internally created in-mem database in case external is not provided
__init__
def __init__(remote_client: JobClientBase,
dataset_name: str,
cache_db: DuckDbCredentials = None,
persist_secrets: bool = False) -> None
Allows to maps data in tables accessed via remote_client
as VIEWs in duckdb database.
Creates in memory "cache" database by default or allows for external database via "cache_db".
Will attempt to create views lazily by parsing SQL queries, identifying tables and adding views
before execution.
list_secrets
def list_secrets() -> Sequence[str]
List secrets that belong to this dataset
should_replace_view
@abstractmethod
def should_replace_view(view_name: str,
table_schema: PreparedTableSchema) -> bool
Tells if view view_name
should be replaced
can_create_view
@abstractmethod
def can_create_view(table_schema: PreparedTableSchema) -> bool
Tells if a view for a table table_schema
can be created
create_views_for_tables
def create_views_for_tables(tables: Dict[str, str]) -> None
Add the required tables as views to the duckdb in memory instance