Database
Database
The database command inspects the database configured in trilogy.toml. It is the introspection step that comes before trilogy ingest: find out what tables exist, look at their columns, then model the ones you want.
Connection details come from trilogy.toml, so there is no dialect argument and no connection arguments on these commands. See trilogy.toml Configuration.
Usage
trilogy database list [options]
trilogy database describe <table> [options]
trilogy database list
Lists the tables and views in the configured database.
| Option | Description |
|---|---|
-s, --schema TEXT | Restrict to one schema. |
trilogy database list
trilogy database list --schema public
trilogy database describe
Shows the columns and types of a table.
| Argument / Option | Description |
|---|---|
table | Table to describe. |
-s, --schema TEXT | Schema the table is in. |
trilogy database describe orders
trilogy database describe orders --schema public
Typical Flow
# What is in here?
trilogy database list
# What does this table look like?
trilogy database describe store_sales
# Model it
trilogy ingest store_sales,date_dim --fks store_sales.ss_sold_date_sk:date_dim.d_date_sk