Skip to content

Consumption Views

Define filtered slices of entity data in YAML, deployed as SQL views in the warehouse and optionally exposed as read-only REST endpoints.

Overview

  • Consumption views create curated projections of entity data for downstream consumers.
  • Each view is defined in entity YAML under consumption.views.
  • When apiName is set, the view is also exposed via a read-only REST endpoint.
  • Different teams can consume different slices of the same entity.

Defining views in YAML

consumption:
  views:
    - schema: mdm_consume
      name: vw_customer
      apiName: customer
      includeDeleted: false
      includeSystemColumns: false
      columns: [code]

    - schema: mdm_consume
      name: vw_customer_sk
      apiName: customer-sk
      includeDeleted: false
      includeSystemColumns: false
      where: "[Country] = 'SK'"

Per-view properties:

  • schema
  • name
  • apiName
  • includeDeleted
  • includeSystemColumns
  • columns
  • where

Deploy

  • Views are created or updated when an entity is deployed or redeployed.
  • Views read from the approved table when approvalRequired is enabled; otherwise from the entity read table.
  • The where clause is applied as a filter on the underlying table.

Accessing views

SQL

SELECT * FROM mdm_consume.vw_customer WHERE city = 'Bratislava'

REST API

GET /api/v1/entities/{name}/view/{apiName}?skip=0&take=100&format=json

Supports the same skip, take, and format options as data endpoints.

CLI

entihub entities view <entity> <apiName> --skip 0 --take 100 --format csv

Power BI integration

  • Connect Power BI directly to the warehouse.
  • Consumption views appear as regular SQL views.
  • Use DirectQuery for current data without export steps.

Use cases

  • Finance view for reporting.
  • Regional view filtered by country or region.
  • Compliance view excluding soft-deleted rows.
  • Stable apiName endpoint for downstream services.