Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: For automation, add more defaults (and ideally, an all option for some) for generate sources #310

Open
jaredx435k2d0 opened this issue Jan 30, 2023 · 3 comments
Assignees
Labels
triaged: yes Has been approved for future implementation

Comments

@jaredx435k2d0
Copy link

jaredx435k2d0 commented Jan 30, 2023

Is your feature request related to a problem? Please describe.
I'm trying to run generate sources automatically via cron on a virtual machine. But, from what I can tell, there isn't a way to suppress some of the prompts (choose relations, flatten JSON, etc.).
It also seems that I have to hardcode the schemas I'd like, using config.yml.

Describe the solution you'd like
I'd like a simple way to be able to generate sources for all relations in a schema, and for all schemas in a database.
I'd like to be able to have the following in my config

  • "all" for schemas
  • "all" for relations"
  • a default for flattening JSON
  • an default update strategy for existing staging models

Describe alternatives you've considered
Not being able to automate it. Closest I've come is by hard coding my schemas in config.yml and then still needing to execute manually so I can interact with the prompts.

@jaredx435k2d0 jaredx435k2d0 changed the title Set defaults for generate sources Feature request: For automation, allow defaults (and ideally, an all option for some) for generate sources Jan 30, 2023
@github-actions github-actions bot added the triaged: no Hasn't been approved for future implementation label Jan 30, 2023
@jaredx435k2d0 jaredx435k2d0 changed the title Feature request: For automation, allow defaults (and ideally, an all option for some) for generate sources Feature request: For automation, add more defaults (and ideally, an all option for some) for generate sources Jan 30, 2023
@BAntonellini
Copy link
Collaborator

@jaredx435k2d0 we've just added a new --no-prompt flag to dbt-coves generate commands (sources, properties and metadata). Check it out in our newest a28 version

This allows you to automate the creation of resources, alongside the usage of already existent flags/args.

For example, the following would generate all sources in all schemas on your DB:

dbt-coves generate sources --schemas "*" --no-prompt

It will auto-flatten and generate all the resulting resources with the filter(s) you use.

A more complex filtering:

dbt-coves generate sources --schemas "my_schema" --select-relations "prefix_*" --update-strategy recreate --no-prompt

@jaredx435k2d0
Copy link
Author

This is awesome! I'm planning to use some dbt-coves commands in a regular automation, so this will be perfect.

Just to be clear, there is currently no way to choose to have it NOT flatten JSON, is that correct?

@jaredx435k2d0
Copy link
Author

Can you please explain the new recreate option? Does that delete and recreate, as in I'd lose any existing documentation? Or would it retain that, but just "recreate" in the sense that it refreshes / would now not include any items deleted since the last execution?

@BAntonellini BAntonellini added triaged: yes Has been approved for future implementation and removed triaged: no Hasn't been approved for future implementation labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged: yes Has been approved for future implementation
Projects
None yet
Development

No branches or pull requests

2 participants