Skip to content

Sources ​

Use diver sources to find the data for a dashboard: the sources in your workspace, what each one holds, and the columns of a table.

List the sources ​

bash
diver sources
text
SOURCE          NAME
warehouse-prod  Warehouse Prod
stripe          Stripe

A dataset in a *.diver.yml file names its source by the resource name in the first column.

See what a source holds ​

Name a source to list its dbt models, with their descriptions, and the tables Diver found in the database:

bash
diver sources warehouse-prod
text
warehouse-prod  Warehouse Prod (postgresql)

DBT MODELS
dim_customers  analytics.dim_customers  One row per customer
fct_orders     analytics.fct_orders     One row per order, with its total

TABLES
analytics.dim_customers
analytics.fct_orders

dbt models are listed when the source has a dbt project in Diver. Tables are what Diver last found in the schemas it syncs.

To find a table in a large source, add --search with part of its name:

bash
diver sources warehouse-prod --search order

See a table's columns ​

Name a table, a dbt model or a relation to list its columns:

bash
diver sources warehouse-prod analytics.fct_orders
text
analytics.fct_orders  dbt model fct_orders
One row per order, with its total

COLUMN      TYPE       DESCRIPTION
order_id    integer    Primary key
ordered_at  timestamp  When the order was placed
amount      numeric    The order total, in euros

Types come from the database and descriptions from dbt. When several schemas have a table with the same name, write it with its schema, such as analytics.fct_orders.

Use it in scripts ​

When the output goes to a file or another program, every line is tab-separated and nothing is colored. A source lists model and table lines, and a table lists its columns:

bash
diver sources warehouse-prod analytics.fct_orders | cut -f1

Reach new depths