cloudquery icon indicating copy to clipboard operation
cloudquery copied to clipboard

feat: Cleanup Old Records When Retiring a Configuration File

Open bbernays opened this issue 2 years ago • 4 comments

Which problem is this feature request solving?

Currently if you have multiple configuration files all syncing to the same database using the overwrite-delete-stale write mode there is no way to delete all records associated with a configuration file as soon as the config file is no longer in use.

Describe the solution you'd like

Azure supports an empty subscription list... maybe AWS should support an empty account list...

Another potential solution would be to implement a remove or delete command

Pull request (optional)

  • [ ] I can submit a pull request

bbernays avatar Apr 07 '23 18:04 bbernays

Hi @bbernays, I think for starts, we could create an how to guide that explains how to do it. For example in Postgres one could drop all tables where source_name = X do accomplish this, WDYT?

erezrokah avatar Apr 09 '23 08:04 erezrokah

While I think we could write a tutorial on how to do it for Postgres, but I don't think it will scale to all of our destinations that support. As we have more users that are doing more parallelization at the config.yml I think this is a use case that more users will run into.

As long as we only support this functionality for destinations that support overwrite-delete-stale then it is not a net new capability but more a exposing of an existing functionality that is currently only done implicitly.

bbernays avatar Apr 10 '23 16:04 bbernays

Could we start with a Postgres guide? If we see that doesn't work we can consider adding the feature. and then probably have more context on it

erezrokah avatar Apr 10 '23 17:04 erezrokah

We have a similar use case with k8s source, wherein when we delete the k8s cluster with the source name same as a cluster ID, then there is no way to delete the data from Postgres DB corresponding to the deleted cluster. (Discord_Msg_link) Looking forward towards a common solution around this.

shani1998 avatar Nov 14 '23 15:11 shani1998