Skip to main content
Version: devel

dlt.destinations.impl.duckdb.sql_client

DuckDBDBApiCursorImpl Objects

class DuckDBDBApiCursorImpl(DBApiCursorImpl)

[view_source]

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)

[view_source]

warn_if_catalog_equals_dataset_name

def warn_if_catalog_equals_dataset_name() -> None

[view_source]

Checks if the DuckDB connection's current catalog equals the dataset name (schema).

WithTableScanners Objects

class WithTableScanners(DuckDbSqlClient)

[view_source]

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

[view_source]

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]

[view_source]

List secrets that belong to this dataset

should_replace_view

@abstractmethod
def should_replace_view(view_name: str,
table_schema: PreparedTableSchema) -> bool

[view_source]

Tells if view view_name should be replaced

can_create_view

@abstractmethod
def can_create_view(table_schema: PreparedTableSchema) -> bool

[view_source]

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

[view_source]

Add the required tables as views to the duckdb in memory instance

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.