Skip to main content
Version: devel

dlt.destinations.impl.duckdb.configuration

DuckDbBaseCredentials Objects

@configspec(init=False)
class DuckDbBaseCredentials(ConnectionStringCredentials)

View source on GitHub

read_only

Open database r or rw

extensions

Extensions loaded on each newly opened connection

global_config

Global config applied once on each newly opened connection

pragmas

Pragmas set applied to each borrowed connection

local_config

Local config applied to each borrowed connection

return_conn

def return_conn(borrowed_conn: DuckDBPyConnection) -> int

View source on GitHub

Closed the borrowed conn, if refcount goes to 0, duckdb connection is deleted

move_conn

def move_conn() -> DuckDBPyConnection

View source on GitHub

Takes ownership of the connection so it won't be closed on refcount 0 and in destructor

never_borrowed

@property
def never_borrowed() -> bool

View source on GitHub

Returns true if connection was not yet created or no connections were borrowed in case of external connection

DuckDbCredentials Objects

@configspec
class DuckDbCredentials(DuckDbBaseCredentials)

View source on GitHub

drivername

type: ignore

__init__

def __init__(conn_or_path: Union[str, DuckDBPyConnection] = None,
*,
read_only: bool = False,
extensions: Optional[List[str]] = None,
global_config: Optional[Dict[str, Any]] = None,
pragmas: Optional[List[str]] = None,
local_config: Optional[Dict[str, Any]] = None) -> None

View source on GitHub

Initialize DuckDB credentials with a connection or file path and connection settings.

Arguments:

  • conn_or_path - Either a DuckDB connection object or a path to a DuckDB database file. Can also be special values like ':pipeline:' or ':memory:'.
  • read_only - Open database in read-only mode if True, read-write mode if False
  • extensions - List of DuckDB extensions to load on each newly opened connection
  • global_config - Dictionary of global configuration settings applied once on each newly opened connection
  • pragmas - List of PRAGMA statements to be applied to each cursor connection
  • local_config - Dictionary of local configuration settings applied to each cursor connection

DuckDbClientConfiguration Objects

@configspec
class DuckDbClientConfiguration(WithLocalFiles,
DestinationClientDwhWithStagingConfiguration)

View source on GitHub

destination_type

type: ignore

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.