DRDataRaft/ docs
GitHub ↗

dr_contract()

Declare columns and keys here. Add business metadata with dr_contract_meta() and validation policy with dr_contract_policy(). Attach to a product with dr_add_contract(). Construction does not read data.

Usage

dr_contract(
  id = "contract",
  columns,
  key = character(),
  rules = list(),
  version = "1.0.0"
)

Arguments

id
Contract identifier; omitted identifiers are scoped to their product.


columns
Named R type vector, or named list of zero-length prototypes.


key
Unique, non-null key columns.


rules
Quality rules or named row predicates.


version
Immutable definition version.

Value

A serializable contract specification.

Examples

dr_contract("orders", c(id = "integer", amount = "numeric"), key = "id") |>
  dr_contract_meta(owner = "Analytics") |>
  dr_contract_policy(allow_extra = TRUE)
Documentation source snapshot · View source at d9cb454 ↗
Code examples are documented source examples; they are not executed in this website build.

Search documentation

Search functions, packages and guides.