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

Default transformer to generate value from Enums #2943

Open
jasondamour opened this issue Nov 14, 2024 · 3 comments
Open

Default transformer to generate value from Enums #2943

jasondamour opened this issue Nov 14, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@jasondamour
Copy link

Describe the solution you'd like

Offer a built-in transformer for Enums, which selects a random valid enum value.

Describe alternatives you've considered

Defining a custom transformer to select a random value from enum

Requires lots of code duplication

Additional context

Thank you for your feature request – we love each and every one!

@jasondamour jasondamour added the enhancement New feature or request label Nov 14, 2024
@evisdrenova
Copy link
Contributor

hey @jasondamour have you checked out our [GenerateCategorical(https://docs.neosync.dev/transformers/system#generate-categorical) Transformer? This transformer randomly selects a value from a list of comma separated values that the user providers.

Or where you were looking for something different?

@jasondamour
Copy link
Author

@evisdrenova I am sadly just getting familiar with MySQL, but could the list of values come from the table schema itself?

I'm trying to avoid code duplication, maintaining a list of values both in our schema and in neosync seems avoidable

@evisdrenova
Copy link
Contributor

evisdrenova commented Nov 14, 2024

@jasondamour That makes sense, unfortunately we don't support that today (hence the enhancement :)). We can certainly look into it and add it to the roadmap. Today, you can use the GenerateCategorial or write a custom javascript transformer using the Generate (Transform) Javascript transformer. Otherwise, if you're not concerned with anonymizing it, you can just pass the value through from the source -> destination using the Passthrough Transformer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants