Skip to content

[feat] add flags to limit extraction#108

Closed
flipswitchingmonkey wants to merge 3 commits into
directus-labs:mainfrom
flipswitchingmonkey:add_extraction_flags
Closed

[feat] add flags to limit extraction#108
flipswitchingmonkey wants to merge 3 commits into
directus-labs:mainfrom
flipswitchingmonkey:add_extraction_flags

Conversation

@flipswitchingmonkey

@flipswitchingmonkey flipswitchingmonkey commented Oct 6, 2025

Copy link
Copy Markdown

This PR adds a number of flags to the extract command.

  • --skipCollectionFiles: do not extract the directus_files collection
  • --skipDownloadFiles: do not download the actual file attachments
  • --syncExtractContent: extract content collections in a serial manner to limit load on instance
  • --limitContentCollections "articles,something_else": only extract named content collections

Motivation

We have a few very underpowered instances running Directus in a Kubernetes context, with a limit on CPU usage. Some of these have large collections, for example large amounts of image files. Running the template extract will cause the CPU load on these instances to spike over a long time, causing them to crash eventually (either by running out of RAM or by being forcibly stopped by Kubernetes).

To make the template CLI usable without crashing the instances, we had to disable all file related extractions. Thus, these added flags.

Possible Issues

By selectively extracting collections or files, there is a real danger of breaking relations if other collections point to these missing entries. Managing these issues is the responsibility of the user - since these flags are only to be used in specific use cases, it is assumed that the user knows what he or she does...

Edit: just noticed that a similar PR exists. Oh well...

@zjpiazza

Copy link
Copy Markdown

I would also like to see this feature implemented. The project I'm working on contains a lot of independent "modules" and to work effectively across our team, the ability to extract a subset of collections would be very beneficial.

@zjpiazza

Copy link
Copy Markdown

I forgot this PR existed when I made my own. I used the same conventions for flags on the apply side. Thoughts?

feat: add partial extraction support (#120)

@bryantgillespie

Copy link
Copy Markdown
Collaborator

Closing in favor of #134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants