Materializationtypeno test imports ittype Materialization = "view" | "table" | "incremental" | "ephemeral";How a model's result is kept.
A project of transforms (commons data 0023-sql-transforms): models whose SQL asks for the tables of a schema and one another by the words of their names, put in the order of what they ask for, with their tests as SQL and their lineage.
Materializationtypeno test imports ittype Materialization = "view" | "table" | "incremental" | "ephemeral";How a model's result is kept.
Modelinterfaceno test imports itinterface ModelA model, resolved.
| Member | Type | What it is |
|---|---|---|
name | string | |
ref | string | The reference to it, written and qualified. |
schema | string | undefined | |
table | string | |
materialization | Materialization | |
key | readonly string[] | |
sql | string | |
hash | string | The hash of what defines it: its SQL, how it is kept and its key. |
reads | readonly string[] | What its SQL asks for, by the words of their names. |
tests | readonly ResolvedTest[] |
ModelSpecinterfaceinterface ModelSpecWhat a project says of a model.
| Member | Type | What it is |
|---|---|---|
name | string | |
select | (refs: Refs) => string | The model's SQL, given the references of the schema and of the other models. |
materialization? | Materialization | view where it is not said. |
key? | readonly string[] | The columns a row of an incremental model is known by, as its SQL names them. |
tests? | readonly Check[] |
Projectinterfaceinterface ProjectA project of models, in the order they build.
| Member | Type | What it is |
|---|---|---|
models | readonly Model[] | |
lineage | readonly LineageEdge[] | |
dialect | Dialect | |
naming | Naming | |
settings | Transforms | |
ledger | { readonly ref: string; readonly schema: string | undefined; readonly table: string; } | The ledger's table. |
ResolvedTestinterfaceno test imports itinterface ResolvedTestA test as SQL.
| Member | Type | What it is |
|---|---|---|
name | string | |
kind | "accepted-values" | "custom" | "not-null" | "relationship" | "unique" | |
severity | "error" | "warn" | |
failing | string |
TransformErrortypeno test imports ittype TransformError =
| RefError
| { readonly kind: "duplicate"; readonly name: string }
| { readonly kind: "cycle"; readonly models: readonly string[] }
| { readonly kind: "no-key"; readonly model: string }
| { readonly kind: "ephemeral-test"; readonly model: string };Why a transform cannot be defined or applied, as a value.
TransformOptionsinterfaceinterface TransformOptionsWhat a project is made with.
| Member | Type | What it is |
|---|---|---|
dialect | Dialect | |
naming? | Naming | |
schema? | string | The schema the tables are in, as bind was given it. |
settings? | TransformSettings |
transformerfunctionfunction transformer(schema: LogicalSchema, specs: readonly ModelSpec[], options: TransformOptions): Result<Project, readonly TransformError[]>A project of models.
| Parameter | What it is |
|---|---|
schema | the logical schema |
specs | the models |
options | the dialect, naming, the tables' schema and the settings |
Returns: the project, or why not