dr_dbt_publish()
Requires a successful
dbt build result containing the selected materialized
node. Copies the relation currently visible to this connection into an
immutable candidate, validates its contract, then commits the release marker.
Omit the contract for structural checks only: column names and R types are
inferred, while empty data and missing values are allowed. Business keys,
quality rules, ownership and freshness are never guessed. Later dbt builds
cannot change this snapshot. The dbt invocation is
recorded as provenance, not as proof that the live relation has not changed
since that build. Coordinate writers between build and publication.
Usage
dr_dbt_publish(
lake,
result,
model,
contract = NULL,
asset = NULL,
code_version = NULL,
version = NULL,
layer = NULL,
business_date = NA_character_,
notify = NULL,
stop_on_failure = TRUE
)Arguments
- lake
- Connected lake or
dataraft.lake::dr_lake_config()for the database used by dbt. Caller connections stay open; connections opened from a config are closed. - result
- Successful result from
dr_dbt_build(). - model
- Exact dbt unique ID, such as
"model.shop.customer_revenue", or an unambiguous node name such as"customer_revenue". Selection expressions and ambiguous names are rejected. - contract
- Optional contract for the copied candidate. An unnamed
contract is scoped to the asset, as with
dataraft.core::dr_add_contract(). - asset
- Governed asset ID. Defaults to the selected node's name.
- code_version
- Optional explicit code/dependency version. By default, hashes normalized manifest node, source and macro definitions and dbt version, excluding invocation IDs, timings and file locations. Include an explicit version when additional dependencies are not represented in the manifest.
- version
- Optional publication definition version. Omitted versions are derived from the full publication definition, including its contract.
- layer
- Configured destination layer. Defaults to
"marts"if configured, otherwise"products". Supply a layer explicitly when neither exists. - business_date
- Business date, separate from build or publication time.
- notify
- Optional existing notification callback.
- stop_on_failure
- Signal failure after persisting quality evidence.
Value
A
dr_run_result accepted by dataraft.core::dr_collect(). $outputs identifies the
exact database, schema, immutable table, asset and release. Use dataraft.lake::dr_source_release()
to compose a consumer workflow; a dbt model relation remains mutable.
Details
Each call validates a fresh snapshot; there is no cache based solely on a
dbt invocation ID. This prevents changed tables reusing stale quality
evidence.
This publishes one relation, not an atomic bundle of all dbt models.
Examples
# After dr_dbt_build() and reopening the lake connection:
# release <- dr_dbt_publish(config, result, "customer_revenue")
# dataraft.core::dr_collect(release)Documentation source snapshot · View source at 3a9d744 ↗
Code examples are documented source examples; they are not executed in this website build.
Code examples are documented source examples; they are not executed in this website build.