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

feat(c/v3-cli): blacklist(ignore)-based add(model, command, relationship) #10591

Open
jjangga0214 opened this issue Nov 8, 2024 · 1 comment
Labels
c/v3-cli k/enhancement New feature or improve an existing feature retention

Comments

@jjangga0214
Copy link
Contributor

jjangga0214 commented Nov 8, 2024

Component

c/v3-cli

Is your proposal related to a problem?

When I add models, commands, or relationships, I want to ignore a certain target.
For example, let's say I use an ORM-managed migration (e.g. drizzle-kit).
It creates a table __drizzle_migrations in schema drizzle.
And ddn cli cares it when I execute these.

ddn models add <connector> "*"
ddn command add <connector> "*"
ddn relationship add <connector> "*"

Though I can specify whitelist instead of "*", it's too cumbersome.

Describe the solution you'd like

  • glob/regex ignore pattern for table, schema, etc
  • A file-based ignore list like .gitignore or yaml
  • A CLI option or multiple arguments
  • An env var
@jjangga0214 jjangga0214 added the k/enhancement New feature or improve an existing feature label Nov 8, 2024
@linear linear bot added the retention label Nov 9, 2024
@SandeepSamba
Copy link
Contributor

Thank you for this interesting suggestion. We have added this to our backlog. In the meantime, you can try out the following workflow:

  • Use ddn model add <connector> "*" to track all the models and then do ddn model remove <pattern-for-model-names> to remove the ones you don't want to be tracked. (Note: ddn model remove command is available from DDN CLI version v2.12.0)
  • In your case, models generated from schema drizzle will usually have the prefix as drizzle. So your command might be something like ddn model add <connector> "*" && ddn model remove "drizzle*".
  • You can also add this as a custom script with a name like add-models-ignoring-drizzle which can be invoked as ddn run add-models-ignoring-drizzle as a quick way to invoke this quickly in your regular dev workflow.

Let us know if this works out for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/v3-cli k/enhancement New feature or improve an existing feature retention
Projects
None yet
Development

No branches or pull requests

2 participants