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

Restrict which rows are dumped? #17

Closed
gregwebs opened this issue Feb 19, 2024 · 5 comments
Closed

Restrict which rows are dumped? #17

gregwebs opened this issue Feb 19, 2024 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@gregwebs
Copy link

Is it possible to conditionally dump rows?

https://github.com/datanymizer/datanymizer?tab=readme-ov-file#transform-conditions-and-limit

Have you considered creating a Discussions section where questions like these could be asked?

@wwoytenko wwoytenko self-assigned this Feb 19, 2024
@wwoytenko wwoytenko added the question Further information is requested label Feb 19, 2024
@wwoytenko
Copy link
Contributor

wwoytenko commented Feb 19, 2024

Hi!
Thank you for your question. I will open discussions in a few minutes. We can raise this conversation in discussion if you want.

About your question. For now, greenmask does not support conditions for data dumping especially if we are talking about table dependencies introspected by PK references. We are working on database subsetting and it is going to be published 2024 Q2-Q3. So it will solve your problem, but not now.

But now you can override the query for the table:

- schema: "humanresources"
  name: "employee"
  query: "select * from humanresources.employee where birthdate > '1980-01-1';"
  transformers:
    - name: "RandomDate"
      params:
        column: "modifieddate"
        max: "2024-01-21 11:32:30.385227"
        min: "2020-01-21 11:32:30.385227"

@gregwebs
Copy link
Author

okay, thanks! So that would work as long as it doesn't create FK issues.

@wwoytenko
Copy link
Contributor

Definitely. But it is the only way to control it right now.

@wwoytenko
Copy link
Contributor

I've just opened discussions and raised conversation in #18

@wwoytenko
Copy link
Contributor

I think this issue can be closed. If any related questions will be there, let's raise them in discussions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants