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)
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
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)
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
Merges the statements of info into into and keeps one group for each key