dlt.destinations.impl.duckdb.configuration
DuckDbBaseCredentials Objects
@configspec(init=False)
class DuckDbBaseCredentials(ConnectionStringCredentials)
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
Closed the borrowed conn, if refcount goes to 0, duckdb connection is deleted
move_conn
def move_conn() -> DuckDBPyConnection
Takes ownership of the connection so it won't be closed on refcount 0 and in destructor
never_borrowed
@property
def never_borrowed() -> bool
Returns true if connection was not yet created or no connections were borrowed in case of external connection
DuckDbCredentials Objects
@configspec
class DuckDbCredentials(DuckDbBaseCredentials)
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
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 Falseextensions
- List of DuckDB extensions to load on each newly opened connectionglobal_config
- Dictionary of global configuration settings applied once on each newly opened connectionpragmas
- List of PRAGMA statements to be applied to each cursor connectionlocal_config
- Dictionary of local configuration settings applied to each cursor connection
DuckDbClientConfiguration Objects
@configspec
class DuckDbClientConfiguration(WithLocalFiles,
DestinationClientDwhWithStagingConfiguration)
destination_type
type: ignore