
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
dbt-invoke is a CLI (built with Invoke) for creating, updating, and deleting dbt property files.
Supported dbt resource types:
Under the hood, this tool works by combining the power of the
dbt ls and
dbt run-operation
commands with dbt's built-in get_columns_in_query
macro.
pip install dbt-invoke
pip install dbt-invoke~=0.2
You must have previously executed dbt run
/dbt seed
/dbt snapshot
on the
resources for which you wish to create/update property files.
dbt run
/dbt seed
/dbt snapshot
) before using this tool to
create/update property files.Property files will be created, updated, or deleted on a one-to-one basis in
the same paths as the resource files they represent (the only change being a
.yml
file extension).
models/marts/core/users.sql
, this tool will create, update, or delete a
property file in the location models/marts/core/users.yml
..yml
file, see the
Migrating to One Resource Per Property File
section.Any newly generated property files are created with the correct resource type, resource name, and columns. A blank description field will be included for each column and for the resource itself.
users
with
column names user_id
and created_at
, the following yaml will be
generated:
version: 2
models:
- name: users
description: ''
columns:
- name: user_id
description: ''
- name: created_at
description: ''
When updating an already existing property file, new columns in the resource will be added, and columns that no longer exist will be removed.
You may fill in the blank description
properties and add other properties
(e.g. tests
). They will remain intact when updating existing property
files as long as the column/resource name to which they belong still exists.
dbt-invoke properties.update <options>
# OR, because 'update' is set as the default command:
dbt-invoke properties <options>
The first time you run this command, you should be prompted to add a short
macro called _log_columns_list
to your dbt project.
dbt-invoke properties.echo-macro
.<options>
primarily uses the same arguments as the dbt ls
command to
allow flexibility in selecting the dbt resources for which you wish to
create/update property files (run dbt ls --help
for details).
Notes:
dbt ls
options (for
example: --models
, and not short flags like -m
).--models modelA,modelB
)
Two additional flags are made available.
--log-level
to alter the verbosity of logs.
--threads
to set a maximum number of concurrent threads to use in
collecting resources' column information from the data warehouse and in
creating/updating the corresponding property files. Each thread will run
dbt's get_columns_in_query macro against the data warehouse.Some examples:
# Create/update property files for all supported resource types
dbt-invoke properties
# Create/update property files for all supported resource types, using 4 concurrent threads
dbt-invoke properties --threads 4
# Create/update property files for all models in a models/marts directory
dbt-invoke properties --models marts
# Create/update property files for a 'users' model and an 'orders' models
dbt-invoke properties --models users,orders
# Create/update property files for a 'users' model and all downstream models
dbt-invoke properties --models users+
# Create/update property files for all seeds
dbt-invoke properties --resource-type seed
# Create/update a property file for a snapshot called 'users_snapshot'
dbt-invoke properties --resource-type snapshot --select users_snapshot
# Create/update property files when your working directory is above your dbt project directory
dbt-invoke properties --project-dir path/to/dbt/project/directory
dbt-invoke properties.delete <options>
<options>
uses the same arguments as for creating/updating property files,
except for --threads
.Two conventions for dbt property files are:
dbt-invoke abides by the "One resource per property file" convention.
If your dbt project uses the "Multiple resources per property file"
convention, you can migrate to one resource per property file by using
dbt-invoke's properties.migrate
command as shown here:
dbt-invoke properties.migrate <options>
version: 2
) will be automatically deleted.<options>
uses the same arguments as for creating/updating property
files, except for --threads
.To view the list of available commands and their short descriptions, run:
dbt-invoke --list
To view in depth command descriptions and available options/flags, run:
dbt-invoke <command_name> --help
>
or |
on your
multiline strings, as recommended
here.get_columns_in_query
macro is run for each
matching resource. As of the time of writing, get_columns_in_query
uses a
SELECT statement limited to zero rows.
While this is not typically a performance issue for table or incremental
materializations, execution may be slow for complex analyses, views, or
ephemeral materializations.
--threads
option in dbt-invoke properties.update
.FAQs
dbt-invoke is a CLI for creating, updating, and deleting dbt property files.
We found that dbt-invoke demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.