Skip to main content
Version: devel

dlt.common.destination.attach

TAttachType

What a set of attach statements requires of the connection that runs it. The connection runs all sets the same way. This type only tells a primary which sets it accepts (see can_attach).

TAttachStatement Objects

class TAttachStatement(TypedDict)

View source on GitHub

A single statement that the primary runs to attach a foreign dataset.

sql

The SQL of the statement. When secret is True, the persisted model holds ciphertext.

secret

True when sql carries credentials. dlt then encrypts sql in the persisted model.

key

What the statement configures. Statements that share a key form one group, and merge_attach replaces the full group.

attach_statement

def attach_statement(sql: str,
secret: bool = False,
key: str = None) -> TAttachStatement

View source on GitHub

Describes one attach statement. key identifies what a later statement redefines, such as a view over data that grows, or credentials that rotate. Without key, the SQL of the statement supplies the key

TAttachInfo Objects

class TAttachInfo(TypedDict)

View source on GitHub

Serializable attach info that attaches a foreign dataset into a primary SQL client.

alias

ATTACH catalog name. It is also the catalog qualifier that a bound query resolves to.

statements

Statements that the primary connection runs, in order. dlt encrypts the secret ones in the persisted model.

merge_attach

def merge_attach(into: TAttachInfo, info: TAttachInfo) -> TAttachInfo

View source on GitHub

Merges the statements of info into into and keeps one group for each key

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.